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

Publishing to two repositories with different platform configurations #754

Open
JakeWharton opened this issue Apr 4, 2024 · 1 comment
Labels

Comments

@JakeWharton
Copy link

I want to publish to a repo-local maven repo (build/test-maven/) for testing, but also publish to Maven Central for releases. This works fine today, except that my test repo requires source and javadoc jars be generated. This means that Dokka has to run in order to test, and we have like 40+ modules so Dokka takes fooooorreeeeevveeeer.

As far as I can tell, the platform mechanism means that I can only choose to include sources/javadoc jars at the project-level once, and that configuration will be used by all publications. I believe that means there's no way to do what I want today then, right?

And if that's the case, maybe we could figure out an evolution to make this possible. Thanks!

@gabrielittner
Copy link
Collaborator

Making it dynamic based on which repository a publication is published to unfortunately won't work, since publications and repositories are independent from each other and it's not possible to modify a publication just for one repository.

When using the base plugin (or the main plugin but still calling configure(Platform)) like you mentioned you can make that decision for a project and you could make it conditional based on a property. What we could do to make this nicer for the main plugin is to have a default boolean Gradle properties for each for sources and javadoc. For programmatic configuration we can also boolean parameters to configureBasedOnAppliedPlugins (this is usually called by the main plugin in afterEvaluate and automatically configures the right platform if none was manually set).

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

No branches or pull requests

2 participants