Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate the gradlew

I am trying to figure out, how to build apk-s using shell. I came over gradlew script, that should do the work for me. Yet, I miss this file in my directory, I have only the windows gradlew.bat file, that doesn't fit my purposes. I read that i have to add in my build.gradle file.

task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}

Yet, i still don't know if this task should be placed to my project build file or to my module build file(tried out both - didn't help). Any tipps are appreciated.

like image 820
Fattum Avatar asked Jul 10 '15 12:07

Fattum


People also ask

Where is the gradlew file?

The Wrapper shell script and batch file reside in the root directory of a single or multi-project Gradle build. You will need to reference the correct path to those files in case you want to execute the build from a subproject directory e.g. ../../gradlew tasks .

How do I start gradlew?

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.

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.


1 Answers

Simply run this via command line:

gradle wrapper

Also, Gradle 2.4 is the latest release and 2.5 should be out soon. So you might want to do:

task wrapper(type: Wrapper) {
    gradleVersion = '2.4'
}

or

gradle wrapper --gradle-version 2.4

Please read the docs here: https://docs.gradle.org/current/userguide/gradle_wrapper.html

like image 175
Jared Burrows Avatar answered Oct 13 '22 23:10

Jared Burrows