summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2020-09-15 19:55:35 +0300
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2020-09-18 00:00:47 +0300
commit2bcfa990d5a28fb0430929cb2941c906099a6b5f (patch)
tree4cce7af1da2494948a6870bfb28f2660a06029e0
parentdf8f1b86f8621ddbf21090b72c09c38ecb48709a (diff)
Android: remove --no-daemon arg for Gradle
Allow Gradle builds to run using JVM daemon, this will improve the current build time noticeably for clean builds and hugely for incremental builds. This will bring the Gradle build to comparable speed with a normal Gradle build in Android Studio. Task-number: QTBUG-86674 Change-Id: Icc4267223802e4c9350b48099236650c023f868d Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 615b92008a7e6673bc74ec6e971a6bca5f5c81f6)
-rw-r--r--src/3rdparty/gradle/gradle.pro3
-rw-r--r--src/3rdparty/gradle/gradle.properties9
-rw-r--r--src/android/templates/build.gradle4
-rw-r--r--src/tools/androiddeployqt/main.cpp2
4 files changed, 16 insertions, 2 deletions
diff --git a/src/3rdparty/gradle/gradle.pro b/src/3rdparty/gradle/gradle.pro
index 1ff0db2017..5d8efdcfd3 100644
--- a/src/3rdparty/gradle/gradle.pro
+++ b/src/3rdparty/gradle/gradle.pro
@@ -4,7 +4,8 @@ CONFIG -= qt android_install
gradle_files.files = \
$$PWD/gradlew \
- $$PWD/gradlew.bat
+ $$PWD/gradlew.bat \
+ $$PWD/gradle.properties
gradle_dirs.files = \
$$PWD/gradle
diff --git a/src/3rdparty/gradle/gradle.properties b/src/3rdparty/gradle/gradle.properties
new file mode 100644
index 0000000000..554f6aeba1
--- /dev/null
+++ b/src/3rdparty/gradle/gradle.properties
@@ -0,0 +1,9 @@
+# Project-wide Gradle settings.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m
+
+# Enable Gradle caching
+org.gradle.caching=true
diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle
index d5b3b93499..c22cd80781 100644
--- a/src/android/templates/build.gradle
+++ b/src/android/templates/build.gradle
@@ -51,6 +51,10 @@ android {
}
}
+ tasks.withType(JavaCompile) {
+ options.incremental = true
+ }
+
lintOptions {
abortOnError false
}
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index b2c396b9fc..0504432eea 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -2364,7 +2364,7 @@ bool buildAndroidProject(const Options &options)
return false;
}
- QString commandLine = QLatin1String("%1 --no-daemon %2").arg(shellQuote(gradlePath), options.releasePackage ? QLatin1String(" assembleRelease") : QLatin1String(" assembleDebug"));
+ QString commandLine = QLatin1String("%1 %2").arg(shellQuote(gradlePath), options.releasePackage ? QLatin1String(" assembleRelease") : QLatin1String(" assembleDebug"));
if (options.buildAAB)
commandLine += QLatin1String(" bundle");