oliviergauthier / gradle-appcenter-plugin

This gradle plugin allow you to upload each build variant of your android application to separate AppCenter Apps.
MIT License
84 stars 44 forks source link

Set appName as environment variable #22

Closed kingargyle closed 4 years ago

kingargyle commented 5 years ago

I haven't been able to get appName to take an in an environment variable if it has been assigned. I basically want to do something like.

flavorDebug { appName = "${System.env.APP_NAME}" }

unfortunately every way I've tried, it ignores it and fails the upload. Only hard coding the name seems to work.

oliviergauthier commented 4 years ago

It works with System.getenv("APP_NAME")

Sample :

appcenter {
    apiToken = project.properties.get("apiToken", "")
    ownerName = project.properties.get("ownerName", "")
    distributionGroups = ["Collaborators"]
    releaseNotes = "A Sample Upload"
    notifyTesters = false
    apps {
        release {
            appName = System.getenv("APP_NAME")
        }
    }
}
kingargyle commented 4 years ago

I kept trying that exact code, and for some reason it would always return null. I'll keep checking and if I get it working or not I'll close this out.

oliviergauthier commented 4 years ago

can you copy both your root gradle script and your app gradle script ? Did you tried to print all env variables in your script ?

kingargyle commented 4 years ago

unfortunately I can't copy the copy the clients scripts here. I'll do some more debugging today and see if I can track down the problem. Will report back here my findings.

kingargyle commented 4 years ago

Closing this as I haven't had time to revisit.