You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "David Capwell (Jira)" <ji...@apache.org> on 2026/04/28 00:02:00 UTC
[jira] [Created] (CASSANDRA-21344) Add gradle build support
David Capwell created CASSANDRA-21344:
-----------------------------------------
Summary: Add gradle build support
Key: CASSANDRA-21344
URL: https://issues.apache.org/jira/browse/CASSANDRA-21344
Project: Apache Cassandra
Issue Type: Improvement
Components: Build
Reporter: David Capwell
Assignee: David Capwell
We have talked about adding gradle support for ages, so figured time to actually send a patch that is able to build/test the project using it!
Gradle is far superior to ant as it has one thing we deeply lack: contextual cache that only runs the work needed
{code}
$ ./gradlew test --tests org.apache.cassandra.utils.UUIDTest --rerun
Configure project :
Cassandra Gradle build – convention plugin loaded (buildDir=/Users/dcapwell/src/github/apache/cassandra/trunk.feature-gradle/build-gradle)
Cassandra 7.0-SNAPSHOT
Cassandra Gradle build – 83 compile deps, 34 test/build deps wired
Building with JDK 21
BUILD SUCCESSFUL in 2s
27 actionable tasks: 1 executed, 26 up-to-date
{code}
The above can be done in ant but requires a human flag off tasks as ant isn’t aware to not redo work
{code}
$ ant -Dant.gen-doc.skip=true \
-Dno-checkstyle=true \
-Dant.gen-doc.skip=true \
-Drat.skip=true \
-Dno-build-test=true \
testclasslist \
-Dtest.timeout=480000 \
-Dtest.classlistprefix=unit \
-Dtest.classlistfile=<(echo org/apache/cassandra/utils/UUIDTest.java)
Buildfile: /Users/dcapwell/src/github/apache/cassandra/trunk.feature-gradle/build.xml
maybe-build-test:
testclasslist:
[junit-timeout] OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[junit-timeout] Testsuite: org.apache.cassandra.utils.UUIDTest-_jdk11
[junit-timeout] Testsuite: org.apache.cassandra.utils.UUIDTest-_jdk11 Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.933 sec
[junit-timeout]
BUILD SUCCESSFUL
Total time: 1 second
{code}
One thing to point out is that test-some and testclasslist use different JVM arguments and ci uses testclasslist which leads to issues reproducing test failures locally (many people prefer test-some; but it runs the test incorrectly) when CI flags them; this is why the command above was selected. With gradle all that is fixed and CI and local do the same thing, there isn’t any confusion on what to run or how.
Another aspect about using gradle rather than something like maven is that Accord is gradle, so the work to support Accord is just
{code}
$ cat settings.gradle
rootProject.name = 'apache-cassandra'
// Accord module uses Gradle natively — include as composite build.
// The substitution maps the POM coordinate to Accord's actual project.
includeBuild('modules/accord') {
dependencySubstitution {
substitute module('org.apache.cassandra:cassandra-accord') using project(':accord-core')
}
}
{code}
To get accord to work with maven would require the same hacks we did for ant; with gradle there isn’t anything to hack around.
Lastly, the patch doesn’t take the stance that ant should go away and doesn’t want to add a burden of having 2 build systems, so gradle sources ant and migrates its logic to the normal gradle world; this means we get the best of gradle but only need to maintain ant!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org