android - How can I get Gradle module name programmatically -
is possible obtain gradle's module name programmatically in java code?
i need access module's build files under module_name/build/intermediates
directory, hardcoding module name bad idea.
you can access project
variable inside build script instance of project. has various getters projectdir
or builddir
, since quite common use them documented in user guide.
alternatively can find path if output of task generates files there.
if need know location in test can pass build script using system property this: test { systemproperty "buildfolder", project.builddir.absolutepath }
btw: https://github.com/gradle/gradle/blob/master/gradle/idea.gradle#l192 has trick how update run configurations in intellij's workspace properties need test execution. can useful if run junit test inside ij (without delegating gradle).
Comments
Post a Comment