Get gradle.properties file from Gradle custom plugin -


i'm developing gradle plugin , need read , write gradle.properties project file. have tried this:

@taskaction public void myaction() {      properties properties = new properties();         try {             properties.load(new fileinputstream(getproject().file("gradle.properties")));         } catch (ioexception e) {             e.printstacktrace();         } } 

but filenotfoundexception. how can file?

i found error. gradle api documentation says .file(object path) method in project class:

resolves file path relative project directory of project.

my gradle.properties file in root project, instead of in module plugin applied.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -