java - Gradle properties chosen based on build version used -


for android app, if build.gradle has 2 schemes, prod , qa, how can choose gradle_${chosen}.properties based on scheme? ie in build

prod {   //use gradle_prod.properties }    qa {   //use gradle_qa.properties }  

if try like:

qa {  processresources{    // ...    }  } 

i not find method processresources()...

you can use .properties file using like:

def properties props = new properties() def propfile = file('../filename.properties') if (propfile.canread()){      props.load(new fileinputstream(propfile))       xxx = file(props['my_key'])    } 

instead if want use tasks defined in other .gradle files can use in file:

apply from: 'myfilename.gradle' 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -