Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUTO_INCREMENT_ONE_STEP not saving to version.properties file #5

Open
quentin23soleil opened this issue Feb 10, 2015 · 7 comments
Open
Milestone

Comments

@quentin23soleil
Copy link

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

@moallemi
Copy link
Owner

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'
  }
}

@quentin23soleil
Copy link
Author

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

@moallemi
Copy link
Owner

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

@quentin23soleil
Copy link
Author

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

@moallemi
Copy link
Owner

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.

@quentin23soleil
Copy link
Author

Oh, I do a ./gradlew clean build

@moallemi moallemi added this to the 1.6 milestone Feb 12, 2015
@Kiran-B
Copy link

Kiran-B commented Mar 6, 2019

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'
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants