How to make a tree from an android assembly using gradle

One of the most attractive features of cmake is the paradigm outside the tree, which allows you to build project options in separate folders, which allows you to quickly switch between build configurations.

Is there such a mechanism in android + gradle? Ideally, no file will be created or modified in the source tree.

EDIT. What do I mean by tree:

My source folder looks something like this:

/work/project/build.gradle
/work/project/src/...
/work/project/res/...       

When I run gradle build , I get new folders, for example:

/work/project/.gradle/...
/work/project/build/..
/work/project/res/...       

I would like to create a project using gradle so that the new folders and generated files are in a folder outside the project , for example:

/work/build-project/.gradle/...
/work/build-project/build/..
/work/build-project/res/...       

: http://voices.canonical.com/jussi.pakkanen/2013/04/16/why-you-should-consider-using-separate-build-directories/

+4
3

build.gradle:

allprojects {
  buildDir = "/external/path/${rootProject.name}/${project.name}"
}
+1

Android . Gradle :

0

allprojects.buildDir, , .

, :

buildDir = "${rootDir.absolutePath}/../../../bin/Android/${project.name}"

0

All Articles