openbakery / gradle-xcodePlugin

gradle plugin for building Xcode Projects for iOS, watchOS, macOS or tvOS
Apache License 2.0
457 stars 127 forks source link

How to read OSX environment variables and iOS app build number? #412

Closed saravnandm closed 5 years ago

saravnandm commented 5 years ago

Is there a way to access OSX environment variables from bash_profile file via gradle script? I wanna store my 'Appstore' credential in bash file and read it from there to supply to Jenkins.

Also, Any chance to read iOS app build number via gradle script?

renep commented 5 years ago

I is better to do it the other way. You build server should be in charge. I have replaced jenkins as build server a long time ago (I use gocd.org now), but as far as I remember you can specify credentials that you can pass as parameter when you execute the appstoreUpload task. e.g. the command on my Build Server looks like this: "./gradlew appstoreUpload -Pappstore.username=${APPSTORE_USER} -Pappstore.password=${APPSTORE_PASSWORD}" The APPSTORE_USER and APPSTORE_PASSWORD are variables that was set by my build server, and are stored also encryped, and removed from log output.

Also my build server is responsible for the version number, and it is passed to the build and here the Info.plist is updated, prior to the build.