Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass build.gradle directory to gradlew?

Tags:

gradle

build

./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?

like image 690
HaiXin Tie Avatar asked Mar 12 '13 23:03

HaiXin Tie


People also ask

What is gradlew build command?

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.

How do I run a gradlew build?

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.

Where is the build directory in Gradle?

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.

How do I access the build Gradle file?

The app level build. gradle file is located inside your project folder under app/build. gradle.


1 Answers

Just found it from Appendix D. Gradle Command Line.

The answer is -p <your project directory>, which defaults to the current directory.

like image 110
HaiXin Tie Avatar answered Sep 22 '22 02:09

HaiXin Tie