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

Legacy plugin application order breaks shadow detection logic updated for new id #964

Closed
jpenilla opened this issue Sep 10, 2024 · 2 comments · Fixed by #991
Closed

Legacy plugin application order breaks shadow detection logic updated for new id #964

jpenilla opened this issue Sep 10, 2024 · 2 comments · Fixed by #991
Labels

Comments

@jpenilla
Copy link
Contributor

jpenilla commented Sep 10, 2024

Expected and Results

I expect to be able to upgrade from 8.3.0 to 8.3.1 without errors.
Instead, I get this:

* What went wrong:
An exception occurred applying plugin request [id: 'com.gradleup.shadow']
> Failed to apply plugin class 'com.github.jengelman.gradle.plugins.shadow.legacy.LegacyShadowPlugin'.
   > Task with name 'shadowJar' not found in project ':minimotd-fabric'.

This is because my plugin quiet-loom is checking for all 3 shadow IDs: https://github.com/jpenilla/quiet-loom/blob/071311814f91e5b1409d5008976968da2dc60180/patches/architectury-loom/0006-Detect-shadowJar.patch

I think this could be fixed by applying the empty legacy plugin after plugins that register the shadowJar task.

Related environent and versions

No response

Reproduction steps

Have logic expecting shadowJar task to be registered inside of a plugins.withId action for the legacy plugin id.

Anything else?

No response

@jpenilla jpenilla added the bug label Sep 10, 2024
@Goooler
Copy link
Member

Goooler commented Sep 11, 2024

CC @ljacomet

@ljacomet
Copy link
Contributor

Indeed, I did not think that the empty application would trigger withPlugin before the rest of the com.gradleup.shadow plugin is applied.

I am also thinking that having the new plugin on the classpath should not be transparent if you have the old one as well.

So the solution I would propose:

  • Apply that empty plugin at the end
  • Add capabilities declaration to the plugin Gradle module metadata declaring it has the capabilities of the older plugins

I should be able to propose a PR doing that over the weekend.

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

Successfully merging a pull request may close this issue.

3 participants