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