> I have a build.gradle file where I have the version of my project
> within a variable: version = '1.1'.
> And I also have a source file with a method returning the version, say
> something like String getVersion() { '1.1' }.
> 
> I'd like to know what's the easiest way to factor that version number,
> for example in some build.properties file, and have gradle taking care
> of replacing some token (like the Ant token replace mechanism) in my
> source file, and I could reference that properties file from my build
> file as well.

I usually don't store version numbers in source files, but instead I store them 
in properties files on the classpath instead. These properties files are very 
easy to create using the "echoproperties" Ant task. But you do need a bit of 
code to load the properties file in the class of course.

--
Regards, Johan


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to