Skip to content

Make the project multi-modules #725

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

Merged
merged 9 commits into from
Nov 13, 2024
Merged

Make the project multi-modules #725

merged 9 commits into from
Nov 13, 2024

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Oct 28, 2024

Instead of using a root project, using https://github.com/Kotlin/kotlinx-io project as reference.

Using modules allows a finer control of classes visibility and will be especially useful for a future db module containing a default sqldelight implementation (see sqldelight/sqldelight#1333 (comment)).

⚠️ Merging this PR will create conflicts in all other PRs due to moving the src directory.

@pm47 pm47 marked this pull request as ready for review October 28, 2024 13:18
@pm47 pm47 force-pushed the modules branch 4 times, most recently from 8c712dc to 1b46ff1 Compare October 28, 2024 14:14
Copy link
Member

@dpad85 dpad85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project now publishes a Maven artifact under artifact id lightning-kmp-core instead of lightning-kmp, which affects dependant projects.

We could copy eclair, with publishes a top-level eclair module and also several artifacts like eclair-core or eclair-node. So we'd have:

  • lightning-kmp root project
  • lightning-kmp-core module
  • lightning-kmp-db module

If you only need the core dependency, you would run ./gradlew :lightning-kmp-core:publishToMavenLocal. If you need core+db, you run ./gradlew publishToMavenLocal. Not quite sure how to do make this happen in gradle though.

Another option could be to modify the MavenPublication task and rename the lightning-kmp-core Maven artifact to lightning-kmp, so that we keep the same id as before.

@sstone
Copy link
Member

sstone commented Nov 13, 2024

modules branch should be renamed to snapshot/modules. This will trigger our publishing workflow on github Actions and will let us publish snapshot versions to https://oss.sonatype.org/content/repositories/snapshots/ (our publishing scripts will probably need to be updated too) so we can also test that downstream projects (phoenix, phoenixd) can still be built properly.

pm47 added 4 commits November 13, 2024 15:35
Inspired from `kotlinx-datetime`.

Saves us from messing `artifactId`, which doesn't work.
@pm47
Copy link
Member Author

pm47 commented Nov 13, 2024

modules branch should be renamed to snapshot/modules. This will trigger our publishing workflow on github Actions and will let us publish snapshot versions to https://oss.sonatype.org/content/repositories/snapshots/ (our publishing scripts will probably need to be updated too) so we can also test that downstream projects (phoenix, phoenixd) can still be built properly.

True but CI takes a long time to build...

@pm47
Copy link
Member Author

pm47 commented Nov 13, 2024

We could copy eclair, with publishes a top-level eclair module and also several artifacts like eclair-core or eclair-node.

Actually, linking the root eclair project will not pull all child dependencies. We could try to do that on lightning-kmp, but I'm not sure it's worth it.

@pm47 pm47 requested a review from dpad85 November 13, 2024 15:11
@pm47 pm47 merged commit 451f9df into master Nov 13, 2024
2 checks passed
@pm47 pm47 deleted the modules branch November 13, 2024 15:50
@sstone sstone mentioned this pull request Nov 14, 2024
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

Successfully merging this pull request may close these issues.

3 participants