summaryrefslogtreecommitdiffstats
path: root/src/android/templates/build.gradle
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2014-08-07 13:04:35 +0300
committerBogDan Vatra <bogdan@kde.org>2014-08-07 12:27:51 +0200
commit8b7a2d582c4c3030c48c799a4384a62be8f605b0 (patch)
tree30e487dbcdea0a3dbbb5c53796fdaadc05944fa5 /src/android/templates/build.gradle
parente26404e43ffbb0f8f00f017c3c0fa02e44a2d116 (diff)
Android: Say hello to gradle!
Add build.gradle script, move Android template files to another folder. These files are specific to every project, and they should be copied to then project android folder. Switching from Ant to Gradle brings lots of advantages: - it is way faster when rebuilding (25-50% faster than ant). - it enables first class Android Studio integration. - adding Android Extras libs (e.g. Google Play services, OBB, etc.) to your project is now painless. [ChangeLog][Android] Added Gradle support to build the APK. Change-Id: I9c8cb355118c9ac1997270c8b80916eca43fce4d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/android/templates/build.gradle')
-rw-r--r--src/android/templates/build.gradle51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle
new file mode 100644
index 0000000000..d1ff362269
--- /dev/null
+++ b/src/android/templates/build.gradle
@@ -0,0 +1,51 @@
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.12.1'
+ }
+}
+
+apply plugin: 'android'
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+}
+
+android {
+ /*******************************************************
+ * The following variables:
+ * - androidBuildToolsVersion,
+ * - androidCompileSdkVersion
+ * - qt5AndroidDir - holds the path to qt android files
+ * needed to build any Qt application
+ * on Android.
+ *
+ * are defined in gradle.properties file. This file is
+ * updated by QtCreator and androiddeployqt tools.
+ * Changing them manually might break the compilation!
+ *******************************************************/
+
+ compileSdkVersion androidCompileSdkVersion.toInteger()
+
+ buildToolsVersion androidBuildToolsVersion
+
+ sourceSets {
+ main {
+ manifest.srcFile 'AndroidManifest.xml'
+ java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
+ aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
+ res.srcDirs = [qt5AndroidDir + '/res', 'res']
+ resources.srcDirs = ['src']
+ renderscript.srcDirs = ['src']
+ assets.srcDirs = ['assets']
+ jniLibs.srcDirs = ['libs']
+ }
+ }
+
+ lintOptions {
+ abortOnError false
+ }
+}