Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion around the Gradle setup #3423

Open
CLOVIS-AI opened this issue May 15, 2024 · 4 comments
Open

Discussion around the Gradle setup #3423

CLOVIS-AI opened this issue May 15, 2024 · 4 comments

Comments

@CLOVIS-AI
Copy link
Contributor

Hi! @nomisRev asked for help with the Gradle setup of Arrow, and I'm interested in helping. However, I'm not too familiar with the existing setup nor what you expect, so I'd like to discuss it a bit first.

My understanding is the main problems at the moment are centered around Maven Central and duplication in build.gradle.kts files? For Maven Central publication, I'm not an expert, but I have migrated all my projects to this plugin and haven't had any issues since. In particular, this plugin allows publishing an artifact in multiple steps (e.g. to build the JVM/JS platforms on one machine, the iOS platforms on another machine, and then combine everything into Nexus).

Now, for the config duplication;


The first and most important question is whether you want to share configuration between multiple Arrow repositories. I see there is https://github.com/arrow-kt/arrow-gradle-config, but I haven't looked much into it yet. Sharing config between repositories by publishing convention plugins is the most effective solution, but comes at the cost of quite a lot of flexibility (on each change, you have to edit the conventions, publish them, bump the version in the downstream repository).

If each repository is different enough, then they may each have their own convention plugins to share internally. However, this is a bit slower because Gradle isn't that performant on up-to-date checks. It also increases the time-to-index when opening the project for the first time, but I don't know how much you care about this.

Looking at the current state, I guess you're aiming for a hybrid approach; how do you decide what goes into arrow-gradle-config or not?

@nomisRev
Copy link
Member

Hey @CLOVIS-AI,

The Arrow project is very old, and it has gone through a lot... Over the years we've moved more, and more to "vanilla" configuration, and were able to get rid of our custom tooling in favor of new 1st party tooling (like KotlinX Knit).

The Arrow Gradle Config came to live only because we were stuck with publishing KMP with 1.0. Since we didn't know what to do we turned to the community, and Arrow Gradle Config was born but was quickly abandoned. So personally I am in favor of getting rid of Arrow Gradle Config, because the maintenance costs are way too high, and it's constantly been behind since its inception.

Requirements:

  • Publishing: fully replaced by Gradle Maven Publish Plugin.
  • Dokka: moved into Arrow config during 1.x
  • Kotlin Configuration: Targets & explicitApi (&?) Arrow Gradle Config Kotlin
  • Formatter Arrow Gradle Config Formatter. Spotless is a single line configuration, so I would just inline the necessary code. (I think Arrow Gradle Config is over-configured here??).
  • Versioning: This is currently disabled, due to versioning plugin not respecting previously released alpha, beta, and RC releases. Not blocking, we can figure out something down the road.

@CLOVIS-AI, to be completely honest I don't think a lot of us have a strong opinion about this. My goal is to move towards what is recommended, and/or most used, in Kotlin. This will improve ease of contributions, readability, and maintenance. So feel free to make a counter proposal, or suggest any other changes to our Gradle configuration.

Thank you @CLOVIS-AI 🙌

@CLOVIS-AI
Copy link
Contributor Author

From what I gather, the final objective is to have as much as possible in this repository, and avoid using the Arrow Gradle Config repo altogether?

If so, what's your plan when you want to create spin-off repositories?

Sorry for the long time to answer, KotlinConf was wild!

@nomisRev
Copy link
Member

nomisRev commented Jun 3, 2024

Sorry for the long time to answer, KotlinConf was wild!

No worries, no time pressure for OSS but KotlinConf really was wild 😂

If so, what's your plan when you want to create spin-off repositories?

To be honest I was thinking we'd just have a little bit of duplication. The formatter is a non-issue, it's a 1 liner in 99% of the cases. So that only leaves configuring the targets, is it worth it keeping that in a separate repo? All spin-off repositories seem to have slightly different target requirements since they build on top of specific stuff.

  • SuspendApp, posix APIs so this excludes mobile devices and non-NodeJS.
  • Ktor, follows targets from Ktor, which are not the same as Kotlin Std, or KotlinX
  • ?

@CLOVIS-AI
Copy link
Contributor Author

CLOVIS-AI commented Aug 25, 2024

Would it be accurate to say that you wish to stop using https://github.com/arrow-kt/arrow-gradle-config and have everything needed be in this repository instead?

It would make working on this repository much more flexible, but it may slow down the builds a little. Though as far as I can see, you're not using the build cache nor the configuration cache, which will both noticeably speed up builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants