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
Post a Comment