You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jon Haddad (Jira)" <ji...@apache.org> on 2022/10/31 21:38:00 UTC

[jira] [Commented] (CASSANDRA-17015) Migrate build from Ant to Maven/Gradle

    [ https://issues.apache.org/jira/browse/CASSANDRA-17015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17626861#comment-17626861 ] 

Jon Haddad commented on CASSANDRA-17015:
----------------------------------------

I just want to drop a couple ideas on some benefits by moving to Gradle that I haven't seen mentioned yet.  

*Gradle makes it really easy to use subprojects*

Subprojects are fantastic because they enforce a code boundary at build time as well as allowing us the ability to publish smaller artifacts with fewer dependencies. For example, it would be nice to see the CQL parser as a subproject with as few dependencies as possible, as well as the commit log reader and sstable reader and writer. Having those libraries available to use in external tools (think Spark, Presto, C* Sidecar) would be incredibly valuable and being able to pull them in without the full dependency list that comes along with C*-all would be nice. I believe this can be done with maven as well, I just know it's really easy with Gradle. I understand this isn't something we'd get for free overnight, there would have to be a bit of refactoring to the C* codebase, but this could provide a starting point.
 
*Docker builds via jib plugin*

Jib is a great plugin that makes it easy to create Docker images from a Java project. Jib is available for Maven as well, and I think it's probably easy to set up either way, I'm just more familiar w/ Gradle. Here's an example configuration from [tlp-stress|https://github.com/rustyrazorblade/tlp-stress/blob/main/build.gradle#L126-L131]. It takes less than an hour to add Docker support this way and we could even publish to custom internal repos for teams that run their own fork.
 
*Deb and RPM builds via ospackage plugin*

I think this is one of the most painful aspects of our current build system - requiring external scripts and repos when it could all be built from the build tool itself. The ospackage plugin is great for this - here's an example of it in [tlp-stress|https://github.com/rustyrazorblade/tlp-stress/blob/main/build.gradle#L126-L131]. Generating a deb package could be as easy as {{{}./gradlew buildDeb{}}}, and work on any machine, not just Linux environments.

> Migrate build from Ant to Maven/Gradle
> --------------------------------------
>
>                 Key: CASSANDRA-17015
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17015
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Build
>            Reporter: Aleksei Zotov
>            Assignee: Aleksei Zotov
>            Priority: Low
>
> h2. Overview
> Cassandra relies onto {{ant}} build tool which is used there for a long time. Even though it is pretty stable, reliable and well-document, {{ant}} is not being actively developed. Releases are rare and new features/fixes appear rarely. For example, JUnit 5 support was implemented in Sep 2019 whereas the JUnit 5 itself was released in 2017.
> Moreover, ant seems to be morally obsolete:
>  * no-one (?) starts new projects with {{ant}}
>  * less and less people have hands-on experience with the tool
> h2. Goals
> The aim of this ticket is to explore two alternatives for the project: Maven, Gradle. Most of the community seem to prefer Maven at this stage, but I'd like us to be unbiased and make a fair comparison. The points to pay attention to:
>  * build speed
>  * support of necessary plugins (without ugly workarounds)
>  * IDE integration (will need to get feedback from the community)
>  * ability to improve tests speed (including both multi-threading and parallelization on multiple servers)
> h2. Steps
>  # mimic the existing build via Gradle
>  # mimic the existing build via Maven
>  # make speed comparison
>  # ask community to test IDE integration and try to address existing concerns
>  # check ability to parallelize tests
>  # make a conclusion / vote
>  # update necessary project documentation
>  # migrate trunk (not yet sure regarding older branches, but probably them too) to the new build tool 
>  
> The description is preliminary. We may update it in the future once we have more details.
>  



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