Skip to content

Commit 1c25eda

Browse files
andxuAndy Xu(devdiv)
andauthored
Add some maven args to boost build perf (#4387)
Co-authored-by: Andy Xu(devdiv) <andxu@microsoft>
1 parent 5dc498d commit 1c25eda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def IJ_VERSION_LATEST = IJ_VERSION_MINOR?.trim()?.isEmpty() ? IJ_VERSION_MAJOR :
77
def mavenArgs = { conf ->
88
List<String> mvnArgs = (forceClean.toBoolean() ? [ 'clean' ] : []) + conf.goals + [
99
'-B',
10+
'-T 1C',
1011
'-Didea.io.use.fallback=true' // A workaround to remove Maven Kotlin script exec warnings on Windows
1112
]
1213

@@ -34,10 +35,13 @@ def mavenArgs = { conf ->
3435
}
3536

3637
ext.maven = { Closure mavenClosure ->
38+
def envVars = [:]
39+
envVars['JAVA_OPTS'] = "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m"
3740
exec {
3841
executable mavenExec
3942
args mavenArgs(configure([:], mavenClosure))
4043
}
44+
tasks.withType(Exec) { environment << envVars }
4145
}
4246

4347
task buildUtils {

0 commit comments

Comments
 (0)