gradle-advanced-build-version icon indicating copy to clipboard operation
gradle-advanced-build-version copied to clipboard

AUTO_INCREMENT_ONE_STEP not saving to version.properties file

Open quentin23soleil opened this issue 9 years ago • 7 comments

Using AUTO_INCREMENT_ONE_STEP as a codeOption doesn't update the version.properties file.

quentin23soleil avatar Feb 10 '15 13:02 quentin23soleil

According to documentation AUTO_INCREMENT_ONE_STEP only increases when you are releasing your app. if you want it to change every time (I mean on every task you want) you can set dependsOnTasks to any task name you want

for example:

advancedVersioning {
  codeOptions {
      versionCodeType org.moallemi.gradle.internal.VersionCodeType.AUTO_INCREMENT_ONE_STEP
      dependsOnTasks 'debug', 'release', 'assemble'
  }
}

moallemi avatar Feb 11 '15 11:02 moallemi

I know, but when I create a release build, the versionCode is always at 1. Even if I (release) build it many times.

quentin23soleil avatar Feb 11 '15 12:02 quentin23soleil

What is your release task name? did you add it to dependsOnTasks property?

moallemi avatar Feb 12 '15 09:02 moallemi

I haven't added dependsOnTasks so I guess it's by default "release".

quentin23soleil avatar Feb 12 '15 09:02 quentin23soleil

I mean witch task name do you use to publish the release version of your app? if you use

./gradlew  TASK_NAME 

to make the release version then you should add it to dependsOnTasks.

I will add an option to use build Variants instead of task names in later version.

moallemi avatar Feb 12 '15 09:02 moallemi

Oh, I do a ./gradlew clean build

quentin23soleil avatar Feb 12 '15 09:02 quentin23soleil

Indeed specifying variants in dependsOnTasks does not work.

The following works:

advancedVersioning {
    codeOptions {
        versionCodeType org.moallemi.gradle.internal.VersionCodeType.AUTO_INCREMENT_ONE_STEP
        dependsOnTasks 'assemble', 'bundle'
    }
}

while the following does not work:

advancedVersioning {
    codeOptions {
        versionCodeType org.moallemi.gradle.internal.VersionCodeType.AUTO_INCREMENT_ONE_STEP
        dependsOnTasks 'assembleRelease', 'bundleRelease'
    }
}

Kiran-B avatar Mar 06 '19 14:03 Kiran-B