Hug
Hug

Reputation: 597

Gradle buildDir does not move all the folders inside the build folder

I'm trying to move the generated folder "build" with all the files and folders in there to another folder.

In order to achieve this I'm using the gradle property.

buildDir = '/new_build_folder'

Gradle creates the folder (new_build_folder) with only one subfolder called generated, and inside that folder there are some autogenerated java files, but gradle still creates the build folder with the generated, intermediates and output sub folders on it.

What am I missing?

Is there any other gradle property to move those files?

I'm using gradle 3.3.

Upvotes: 0

Views: 232

Answers (1)

Vampire
Vampire

Reputation: 38734

There are two possible reasons I can think of out of the box.

  1. You e. g. did make this setting (which is the correct one) not on all projects, e. g. you did it on the root project, but not on the subprojects. This setting is a setting of the project and is not inherited, so it only is effective where you set it. If this is the case, you could e. g. do allprojects { buildDir 'new_build_folder' }.

  2. Maybe some plugins you use have 'build' hardcoded, instead of using buildDir. But if it does not work for all the standard tasks, I don't think this is the reason, but more likely reason one.

If none of this applies, you need to supply more information, like e. g. your build scripts.

Upvotes: 2

Related Questions