Dynamically apply a common dependent gradle file? -


i have gradle file (common-utils.gradle) bunch of useful functions common across various projects. i've got file in artifactory. now, want project's build.gradle pull down common-utils.gradle file , "apply from: 'common-utils.gradle'" can use utility methods.

is there way dynamically, first time run "gradle test" fetches common file , applies it? or have have sort of 1 time "init" task run after clone repository go fetch file?

well easiest way apply *.gradle file have in artifactory reference remote file in apply method:

apply from:'http://yourartifactory/repo/path/to/1.0/common-utils.gradle' 

one downside of is, gradle not cache file atm. resolve every single gradle invocation. there open issue listed in gradle issue tracker. can vote caching @ http://issues.gradle.org/browse/gradle-835

cheers, rené


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -