Skip to content

Commit 0a7e458

Browse files
Merge pull request #2727 from nextcloud/gradle-optimizations
Gradle Optimizations
2 parents 15a7137 + 1464296 commit 0a7e458

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

app/build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ android {
8383
}
8484

8585
androidResources {
86-
generateLocaleConfig true
86+
generateLocaleConfig true
8787
}
8888

8989
packagingOptions {
@@ -162,3 +162,16 @@ dependencies {
162162
testImplementation 'org.mockito:mockito-core:5.18.0'
163163
testImplementation 'org.robolectric:robolectric:4.15.1'
164164
}
165+
166+
// Run the compiler as a separate process
167+
tasks.withType(JavaCompile).configureEach {
168+
options.fork = true
169+
170+
// Enable Incremental Compilation
171+
options.incremental = true
172+
}
173+
174+
tasks.withType(Test).configureEach {
175+
// Run tests in parallel
176+
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
177+
}

gradle.properties

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
# SPDX-FileCopyrightText: 2015-2024 Stefan Niedermann <[email protected]>
33
# SPDX-FileCopyrightText: 2024 Andy Scherzinger <[email protected]>
44
# SPDX-License-Identifier: GPL-3.0-or-later
5-
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
6-
org.gradle.dependency.verification.console=verbose
7-
org.gradle.configuration-cache=true
85
android.useAndroidX=true
6+
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g
7+
org.gradle.dependency.verification.console=verbose
8+
kotlin.daemon.jvmargs=-Xmx6144m -XX:+UseParallelGC
9+
org.gradle.caching=true
10+
org.gradle.parallel=true
11+
org.gradle.configureondemand=true
12+
kapt.incremental.apt=true
13+
org.gradle.daemon=true
14+
org.gradle.configuration-cache=true

gradle/verification-metadata.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<configuration>
44
<verify-metadata>true</verify-metadata>
55
<verify-signatures>true</verify-signatures>
6+
<keyring-format>armored</keyring-format>
67
<trusted-artifacts>
78
<trust group="com.android.tools.build" name="aapt2" version="8.4.1-11315950" reason="ships OS specific artifacts (win/linux) - temp global trust"/>
89
<trust file=".*-javadoc[.]jar" regex="true" reason="Android Studio downloads javadoc jars but doesn't add checksums - fixes building in AS"/>

0 commit comments

Comments
 (0)