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

Do not publish Gradle module metadata #127

Merged
merged 2 commits into from
Jan 4, 2020

Conversation

wolfs
Copy link
Member

@wolfs wolfs commented Jan 3, 2020

Currently, this would produce a module metadata file which can't be
consumed by downstream projects, since it doesn't contain any
dependencies and only the hpi variant and not jar variant.

Until this is fixed, Gradle module metadata shouldn't be published.

I realized this when publishing version 1.36 of the Jenkins gradle-plugin: jenkinsci/gradle-plugin#94 (comment).

Currently, this would produce a module metadata file which can't be
consumed by downstream projects, since it doesn't contain any
dependencies and only the hpi variant and not jar variant.

Until this is fixed, Gradle module metadata shouldn't be published.
@wolfs wolfs force-pushed the disable-gradle-module-metadata branch from 6bb39fd to eb8c086 Compare January 3, 2020 22:56
@sghill
Copy link

sghill commented Jan 4, 2020

This looks good @wolfs!

Would you mind getting the codenarc task back to passing and I’ll get this merged/released?

Using task abbreviation, the line length is now shorter than 120
characters. I wonder if it would be better to allow longer lines
for tests...
@wolfs
Copy link
Member Author

wolfs commented Jan 4, 2020

@sghill I fixed the line length: b4a6626

Though I am not sure if it wouldn't be better to relax the codenarc line length rule for tests...

@sghill sghill merged commit 0bf5a55 into jenkinsci:master Jan 4, 2020
@darxriggs
Copy link

I also suggest to relax this rule. The change currently implemented due to it (the abbreviated task name) just makes it worse.

@sghill
Copy link

sghill commented Jan 4, 2020

This has been released as v0.36.2 today.

Thanks for this change @wolfs, and the link to the additional context.

I am not sure if it wouldn't be better to relax the codenarc line length rule for tests...

I agree, and I'm open to that change.

So far I haven't changed any of the static analysis settings because I'd like this plugin to (eventually) be implemented in Kotlin. I think Kotlin would simplify maintenance and give contributors more confidence when submitting changes.

Currently, this would produce a module metadata file which can't be
consumed by downstream projects, since it doesn't contain any
dependencies and only the hpi variant and not jar variant.

Supporting module metadata would be good. If we also had a way to create module metadata for existing plugins, it may help simplify the way we currently resolve/add dependencies to a project.

What's the best way to fix this? This use-case doesn't seem to fit the scenarios covered in Modeling feature variants and optional dependencies. I've also seen Working with Variant Attributes, but I'm unsure how I'd implement this (a new org.gradle.usage called jpi?).

@wolfs
Copy link
Member Author

wolfs commented Jan 5, 2020

I created #129 for relaxing the code style rules.

@wolfs
Copy link
Member Author

wolfs commented Jan 5, 2020

So far I haven't changed any of the static analysis settings because I'd like this plugin to (eventually) be implemented in Kotlin. I think Kotlin would simplify maintenance and give contributors more confidence when submitting changes.

I wonder if plain Java wouldn't work good enough as well. Most of Gradle's own plugins are implemented in Java.

@wolfs
Copy link
Member Author

wolfs commented Jan 6, 2020

@jjohannes, could you describe your thoughts how to publish correct Gradle module metadata for Jenkins plugins?

@sghill
Copy link

sghill commented Jan 6, 2020

I wonder if plain Java wouldn't work good enough as well.

It's possible, but one of the things I really appreciate about Gradle are the docs with high-quality examples. Since those examples generally aren't available in Java, I think that'd be a little less friendly than Kotlin.

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