[Android] Gradle: Get or Change build output directory from terminal?

For a script I'm making, I'm looking for a way to either get the build output directory Gradle uses, or change it to something different.

I'm aware you could edit one of the gradle files in a project, but my script requires not altering the android app project (It only uses gradlew / gradle.bat that comes with it to build)

Is there some way to change gradle's build output directory, or if not, a way to get it from the command line?

10 points · 2 comments · view on lemmy.world

2 Comments

tyler@programming.dev · 2 pts · 54d

I can’t remember fully right now but you should be able to just set it at the command line. https://docs.gradle.org/current/userguide/build_environment.html#setting_a_project_property

Dunstabzugshaubitze@feddit.org · 1 pts · 54d

why do you want this?

and does the build need to happen elswhere? otherwise you could read the target directory from the build file and move the stuff afterwards.

tyler@programming.dev · 1 pts · 54d
[ removed ]
tyler@programming.dev · 1 pts · 54d
[ removed ]
tyler@programming.dev · 1 pts · 54d
[ removed ]