Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the buildDir of a subproject in Gradle?

Tags:

gradle

In gradle.build you can reference the buildDir and use it as a source or destination. How can I reference the buildDir of a subproject from the root build.gradle file?

(And a similar supplementary question, how can I reference subprojects in a Copy task? I have tried ':subproject_name/some_directory' but it errors).

like image 313
jimmy_terra Avatar asked Jul 10 '17 14:07

jimmy_terra


People also ask

What is rootDir in gradle?

rootDir. The root directory of this project. The root directory is the project directory of the root project. rootProject. The root project for the hierarchy that this project belongs to.

What is the file name built by gradle?

Gradle uses the name build. gradle as the default name for a build file. If we write our build code in a file build. gradle then we don't have to specify the build filename when we run tasks.

What is Ziptree in gradle?

A FileTree represents a hierarchy of files. It extends FileCollection to add hierarchy query and manipulation methods. You typically use a FileTree to represent files to copy or the contents of an archive. You can obtain a FileTree instance using Project.


1 Answers

project(':a-subproject').buildDir
like image 102
ToYonos Avatar answered Oct 03 '22 00:10

ToYonos