That means that to run gradle on a specific gradle build script you must change directory in the command prompt into the directory where the build script is located.
How to build with gradle command line. Add it to your version control system and everyone that clones your project can build it just the same. The gradle build script typically contains one or more tasks which you can execute. It s available as a batch file for windows gradlew bat and a shell script for linux and mac gradlew sh and it s accessible from the root of each project you create with android studio. You can execute multiple tasks in a single build by listing each of the tasks on the command line.
Gradle the gradle command will run gradle on the gradle build script located in the same directory as the command prompt is located in. Use of the gradle wrapperis highly encouraged. You can execute multiple tasks in a single build by listing each of the tasks on the command line. You might want to do this in order to automate builds or build on a remote server.
When you run the gradle command it looks for a build file in the current directory. You can use the b option to select a particular build file along with absolute path. Gradle will execute the tasks in the order that they are listed on the command line and will also execute the dependencies for each task. It can be used in the exact same way as an installed version of gradle.
Build your app from the command line you can execute all the build tasks available to your android project using the gradle wrapper command line tool. For example the command gradle compile test will execute the compile and test tasks. For example the command gradle compile test will execute the compile and test tasks. The gradle wrapper is now available for building your project.
When installed correctly you can run gradle using this command line. The version and sourcecompatibility property can be set in the build gradle file. Version 0 1 0 sourcecompatibility 1 8 if the artifact is an executable java application the manifest mf file must be aware of the class with the main method. Selecting which build to execute.
The following example selecting a project hello from myproject gradle file which is located in the subdir take a look into it. Gradle will execute the tasks in the order that they are listed on the command line and will also execute the dependencies for each task. Gradle from the command line while android studio provides a nice gui for interacting with gradle there are times when a command line approach is more helpful.