2019-12-05 05:14:09 -05:00
|
|
|
Local developer settings
|
|
|
|
========================
|
|
|
|
|
2021-03-19 08:11:37 -04:00
|
|
|
The first invocation of any task in Lucene's gradle build will generate
|
2019-12-05 05:14:09 -05:00
|
|
|
and save a project-local 'gradle.properties' file. This file contains
|
|
|
|
the defaults you may (but don't have to) tweak for your particular hardware
|
2022-04-10 14:35:45 -04:00
|
|
|
(or taste). Note there are certain settings in that file that may
|
|
|
|
be _required_ at runtime for certain plugins (an example is the spotless/
|
|
|
|
google java format plugin, which requires adding custom exports to JVM modules). Gradle
|
|
|
|
build only generates this file if it's not already present (it never overwrites
|
|
|
|
the defaults) -- occasionally you may have to manually delete (or move) this
|
|
|
|
file and regenerate from scratch.
|
|
|
|
|
|
|
|
This is an overview of some settings present in gradle.properties.
|
2019-12-05 05:14:09 -05:00
|
|
|
|
|
|
|
Parallelism
|
|
|
|
-----------
|
|
|
|
|
|
|
|
Gradle build can run tasks in parallel but by default it consumes all CPU cores which
|
2021-03-19 08:11:37 -04:00
|
|
|
is too optimistic a default for Lucene tests. You can disable the parallelism
|
2019-12-05 05:14:09 -05:00
|
|
|
entirely or assign it a 'low' priority with these properties:
|
|
|
|
|
|
|
|
org.gradle.parallel=[true, false]
|
|
|
|
org.gradle.priority=[normal, low]
|
|
|
|
|
|
|
|
The default level of parallelism is computed based on the number of cores on
|
|
|
|
your machine (on the first run of gradle build). By default these are fairly conservative
|
|
|
|
settings (half the number of cores for workers, for example):
|
|
|
|
|
|
|
|
org.gradle.workers.max=[X]
|
|
|
|
tests.jvms=[N <= X]
|
|
|
|
|
|
|
|
The number of test JVMs can be lower than the number of workers: this just means
|
|
|
|
that two projects can run tests in parallel to saturate all the workers. The I/O and memory
|
|
|
|
bandwidth limits will kick in quickly so even if you have a very beefy machine bumping
|
|
|
|
it too high may not help.
|
|
|
|
|
|
|
|
You can always override these settings locally using command line as well:
|
|
|
|
gradlew -Ptests.jvms=N --max-workers=X
|
|
|
|
|
2020-01-22 09:54:08 -05:00
|
|
|
Test JVMS
|
|
|
|
---------
|
|
|
|
|
|
|
|
Test JVMs have their own set of arguments which can be customized. These are configured
|
|
|
|
separately from the gradle workers, for example:
|
|
|
|
|
|
|
|
tests.jvms=3
|
|
|
|
tests.heapsize=512m
|
|
|
|
tests.minheapsize=512m
|
2022-11-15 19:28:52 -05:00
|
|
|
tests.jvmargs=-XX:+UseParallelGC -XX:TieredStopAtLevel=1 -XX:ActiveProcessorCount=1
|
2020-01-22 09:54:08 -05:00
|
|
|
|
2019-12-05 05:14:09 -05:00
|
|
|
Gradle Daemon
|
|
|
|
-------------
|
|
|
|
|
|
|
|
The gradle daemon is a background process that keeps an evaluated copy of the project
|
|
|
|
structure, some caches, etc. It speeds up repeated builds quite a bit but if you don't
|
|
|
|
like the idea of having a (sizeable) background process running in the background,
|
|
|
|
disable it.
|
|
|
|
|
|
|
|
org.gradle.daemon=[true, false]
|
|
|
|
org.gradle.jvmargs=...
|
|
|
|
|