Coder Social home page Coder Social logo

Comments (8)

wesleym avatar wesleym commented on June 22, 2024 2

I find when I set track to ${track} that non-publish tasks like assemble now fail if I don't specify org.gradle.project.track.

./gradlew assembleDevDebug

...

* What went wrong:
A problem occurred evaluating root project 'nextdoor'.
> Track has to be one of 'alpha', 'beta', 'rollout' or 'production'.

Is this the expected behaviour? Does this mean that I need to add -Dorg.gradle.project.track=alpha to every invocation of Gradle for this project? Is there a way to specify a default?

from gradle-play-publisher.

bhurling avatar bhurling commented on June 22, 2024 1

Another solution would be to use a property for the track

play {
    // ...
    track = "${track}"
}

and then define your CI server to run the publish task with an additional argument:

 ./gradlew publishApkRelease -Dorg.gradle.project.track=alpha

Jenkins for example does that automatically if you are using parameterized builds along with the gradle build step.

Does that help you?

from gradle-play-publisher.

appplemac avatar appplemac commented on June 22, 2024

@bhurling Yep, that works. Thank you so much!

from gradle-play-publisher.

bhurling avatar bhurling commented on June 22, 2024

If you use properties in your build script you have to provide them externally. But you can set defaults in your gradle.properties:

track=alpha

-Dorg.gradle.project.track overrides the values in the gradle.properties (see here).

from gradle-play-publisher.

wesleym avatar wesleym commented on June 22, 2024

That works great. Thanks! It might be worth mentioning that trick in the docs.

from gradle-play-publisher.

vitorprado avatar vitorprado commented on June 22, 2024

Add it to docs PLEASE.

from gradle-play-publisher.

Byronium avatar Byronium commented on June 22, 2024

For some reason, using

play {
    track = "${track}"
}

always pushed to alpha even if I set the default to internal in gradle.properties and passed in the -Dorg.gradle.project.track=internal parameter...

Changing the syntax to the following

play {
    track = project.properties['track']
}

worked for me.

I'm a bit confused about this since "${track}" seems like valid syntax, and if I test it in other places in the build.gradle file, it works as intended. Also, if the syntax isn't working and is thus creating a null or empty string, I thought that Gradle Play Publisher would complain that the specified track isn't in the accepted list and fail instead of defaulting to Alpha, which seems to be what's happening.

from gradle-play-publisher.

golanshy avatar golanshy commented on June 22, 2024

Worked for me, as long as you default the track i.e. track = internal in your gradle.properties you can refer to it in your build.gradle as
play { track = project.properties['track'] }
and then in your CI you can override e.g

./gradlew publishApkRelease -Dorg.gradle.project.track=alpha

from gradle-play-publisher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.