Pesegato
(Ameiurus Melas)
August 25, 2016, 7:47am
1
On my gradle I have something like this:
def DEV_MODE=false
def myloader="com.github.Pesegato"
def myversion="-SNAPSHOT"
if (DEV_MODE){
myloader="com.pesegato"
myversion="latest.integration"
}
I’m not super happy with it, because I need to keep DEV_MODE to true on my development machine, and when committing I must ignore a line of the file… is there a cleaner way to do this? Like check the presence of a local file or something?
I usually do it the other way around, I have the CI build set an environment variable.
Eg for travis
1 Like
Rene
(René Groeschke)
August 25, 2016, 9:20am
3
you can also detect if you’re on CI or not. Usually the different CI servers out there expose this via a environment variable or system property. We at gradle for example use teamcity and do it like this: https://github.com/gradle/gradle/blob/feb4c534f3b55331edf3d6279df25ba0b9f86162/build.gradle#L145-L145
cheers,
René
1 Like
Pesegato
(Ameiurus Melas)
August 25, 2016, 9:20am
4
Cool idea but
Could not find property 'CI' on root project
Unless I redefine with def…?
Pesegato
(Ameiurus Melas)
August 25, 2016, 9:24am
5
Cool the answer below is for travis: