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
Pick-to: 5.15
Change-Id: Icc4267223802e4c9350b48099236650c023f868d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Assam Boudjelthia 2020-09-15 19:55:35 +03:00
parent 8d8b271fe9
commit 615b92008a
5 changed files with 17 additions and 2 deletions

View File

@ -6,6 +6,7 @@ qt_copy_or_install(
FILES
gradlew
gradlew.bat
gradle.properties
DESTINATION
"${destination}"
)

View File

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

9
src/3rdparty/gradle/gradle.properties vendored Normal file
View File

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

View File

@ -51,6 +51,10 @@ android {
}
}
tasks.withType(JavaCompile) {
options.incremental = true
}
lintOptions {
abortOnError false
}

View File

@ -2445,7 +2445,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");