I got a project which was a eclipse project. And now I'm using Android Studio with gradle 2.2.1. I've found that when I create a project with Android Studio, it will generate a gradlew file, and it may include some CLI functions. But when I transfer my project from eclipse to Android Studio, I didn't find my gradlew file. So, here is my question: what does a gradlew file exactly do? Can it be customized?
with the command gradle eclipse or ./gradlew eclipse you can generate Eclipse project files. After generating the Eclipse project files, you can import the project into a Eclipse workspace.
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.
From Gradle's documentation: The scripts generated by this task are intended to be committed to your version control system. This task also generates a small gradle-wrapper. jar bootstrap JAR file and properties file which should also be committed to your VCS.
gradlew is for gradle wrapper which can let your project independent with the environment. For example, in CI server, if your project brings gradle wrapper, then you don't have to install gradle in the environment.
If you create a project with android studio, it will generate gradle wrapper into your project by default.
You can see more information in Gradle wrapper
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