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

Depend on library projects rather than published artifacts #290

Conversation

PaulKlauser
Copy link
Contributor

This allows the sample apps to be used to test changes to the libraries without needing to publish

This allows the sample apps to be used to test changes to the libraries without needing to publish
@PaulKlauser
Copy link
Contributor Author

I found this to make contributing to this repo easier 😃 Let me know if there's an unintended side-effect to this that I'm not considering.

@DanielMartinus
Copy link
Owner

Hey @PaulKlauser, thanks for your contribution. Unfortunately this won't work since the api included library won't be included when building the konfetti-xml or konfetti-compose. Still have to work on a solution for that

@@ -52,7 +52,7 @@ android {
}

dependencies {
api 'nl.dionsegijn:konfetti-core:2.0.1'
api project(':konfetti:core')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DanielMartinus per your comment about the api project not being included: makes sense, if we make this api project(':konfetti:core'), that would solve it right?

Copy link
Owner

@DanielMartinus DanielMartinus Feb 12, 2022

Choose a reason for hiding this comment

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

Unfortunately transitive dependencies don't work great when building an aar. Aar only includes the files of that particular module. It's able to use other modules to compile but unfortunately not able to expose files from other transitive modules. Either you'll have to use fat aar to create an aar or pull in the transitive dependency externally like I do now. I agree that the current setup is suboptimal. I'm going to dive into merging all the modules again and separate the internal code by package which seems to me a bit of an improvement. It'll make it easier for external contributions and publishing new releases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah right. Will bringing Compose into the library have any unintended side-effects for devs that aren't using Compose?

@PaulKlauser
Copy link
Contributor Author

Closing, since this won't actually work when publishing the library's aar

@PaulKlauser
Copy link
Contributor Author

@DanielMartinus it actually looks like maven-publish will generate the POM to point at the published dependency, even if the gradle file is pointed at the local project dependency. I can see this behavior by running ./gradlew konfetti:xml:generatePomFileForReleasePublication and looking at the output POM file.

Looks like the issue is just that the artifactId is named core instead of konfetti-core, which is what the core module is being published to so it ends up not matching.

The solution would be to set the project name explicitly to konfetti-core which can be done by changing the directory name, or adding a line to the settings.gradle, which I'll add to this PR in a second

@PaulKlauser PaulKlauser reopened this Feb 15, 2022
@DanielMartinus
Copy link
Owner

See #295 with a setup that works using the local core library and where publishing used the remote core dependency

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.

2 participants