Skip to content

Using version code and version name for renaming generated packages with archivesBaseName #9

@timmikk

Description

@timmikk

In my project I need to rename the generated packages. Previously I have done it with following code in android defaultConfig block:

android {
    defaultConfig {
        versionCode = getMyVersionCode()
        versionName = VERSION_NAME
        archivesBaseName = "${versionName}-vc${versionCode}"
    }
}

Now as I took the app-versioning plugin into use (actually the 0.4.0 version) I removed the versionCode and versionName definitions:

android {
    defaultConfig {
        archivesBaseName = "${versionName}-vc${versionCode}"
    }
}

The problem is that the versionName and versionCode are now null and package name will be something like null-vcnull-release.apk

What might be best practice to rename the package when using the app-versioning plugin? Is there some way to get the versionName and versionCode from the app-versioning plugin in build.gradle during build?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions