this post was submitted on 27 Jun 2026
10 points (100.0% liked)

Programming

27447 readers
183 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS
 

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?

all 5 comments
sorted by: hot top controversial new old
[–] tyler@programming.dev 2 points 23 hours ago

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

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.