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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -