./gradlew
can be run in the same directory as the build.gradle
file, but how can I run gradlew
(standard Gradle wrapper) from another directory? For Make, one can pass "-C DIRECTORY
" to "Change to DIRECTORY before doing anything.". Is there an equivalent parameter in Gradle?
gradlew command. The gradlew command, also known as the Gradle wrapper, is a slightly different beast. It's a script that comes packaged up within a project. Yes, it gets committed into version control so when you clone the project you get the gradlew script automatically.
To run a Gradle command, open a command window on the project folder and enter the Gradle command. Gradle commands look like this: On Windows: gradlew <task1> <task2> … e.g. gradlew clean allTests.
get global build path from environment variable or fallback to build directory inside project directory; include project group in path, this makes path more unique especially if you have several projects with the same name.
The app level build. gradle file is located inside your project folder under app/build. gradle.
Just found it from Appendix D. Gradle Command Line.
The answer is -p <your project directory>
, which defaults to the current directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With