The app uses Gradle as build system with the Android Plugin. It can either be built using Android Studio or Gradle on the command line.
- Java 8 JDK (either Oracle or OpenJDK)
- Android SDK
Import the project as a Gradle Project into Android Studio. Building and debugging on a device or emulator should work out of the box.
To create a clean release build execute ./gradlew clean build
.
The APKs can be found in worldclockwidget/build/outputs/apk
.
Other useful commands are:
./gradlew tasks
- shows all available tasks./gradlew assembleDebug
- builds the debug APK./gradlew installDebug
- builds and installs the debug APK on a device or emulator./gradlew check
- runs all tests and code quality checks like Android lint etc. The output of the tools can be found inworldclockwidget/build/output
andworldclockwidget/build/reports
.
The build signs the release APK if the following Gradle properties are set:
signingKeyStoreFile
- The path to the keystore with the signing key (either absolute or relative to the worldclockwidget subfolder)signingKeyStorePassword
- The password for the keystoresigningKeyAlias
- The name of the signing key in the keystoresigningKeyPassword
- The password for the signing key
Gradle properties can either be set on
- the command line with the
-P
option, for example-Pmyprop=myvalue
. - as an environment variable, for example:
export ORG_GRADLE_PROJECT_myprop=myvalue
- in a
gradle.properties
file next to thebuild.gradle
file.