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

One submodule doesn't get the right version #95

Closed
bric3 opened this issue Jan 5, 2023 · 7 comments
Closed

One submodule doesn't get the right version #95

bric3 opened this issue Jan 5, 2023 · 7 comments

Comments

@bric3
Copy link

bric3 commented Jan 5, 2023

Noticed something strange in a multi-module project. One of the submodule, doesn't read the version correctly. And it's always fireplace-app

$ ./gradlew printSemver -Psemver.stage=snapshot
Type-safe project accessors is an incubating feature.

> Task :fireplace-swt-experiment-app:printSemver
semver for fireplace-swt-experiment-app: v0.0.1-SNAPSHOT

> Task :fireplace-swing:printSemver
semver for fireplace-swing: v0.0.1-SNAPSHOT

> Task :fireplace-swt-awt-bridge:printSemver
semver for fireplace-swt-awt-bridge: v0.0.1-SNAPSHOT

> Task :fireplace-app:printSemver
semver for fireplace-app: v0.1.0.0+62be628

> Task :printSemver
semver for fireplace: v0.0.1-SNAPSHOT

> Task :fireplace-swing-animation:printSemver
semver for fireplace-swing-animation: v0.0.1-SNAPSHOT

So basically the code is like that

The commit is here: bric3/fireplace@a6e24fc

build.gradle.kts gradle.properties
allprojects {
    group = "io.github.bric3.fireplace"

    apply(plugin = "com.javiersc.semver.gradle.plugin")
    semver {
        tagPrefix.set("v")
    }
}
semver.tagPrefix=v
semver.checkClean=false
@JavierSegoviaCordoba
Copy link
Owner

I haven't any test with allprojects as it is not recommended and it doesn't work with project isolation nowadays.

Additionally, apply function to apply plugins is not recommended too.

Gradle recommends convention plugins for this kind of things.

Can you try to put the plugin directly in the plugins block in the fireplace-app project?

I will try to reproduce it to investigate it later.

@JavierSegoviaCordoba
Copy link
Owner

You can try to add again that property to fix ordering issues with other plugins and so on:

semver.project.tagPrefix=v

@JavierSegoviaCordoba
Copy link
Owner

The problem is with the id("org.graalvm.plugin.compiler") plugin, looks like they are fetching the version in the configuration phase. Not sure if they have an issue recommending to avoid that as I haven't used graalvm.

The fix is using semver.project.tagPrefix=v in the fireplace-app/gradle.properties or in the root one as you are going to use v in all projects, so if in the future another module has this problem you will be safe.

@bric3
Copy link
Author

bric3 commented Jan 5, 2023

OK, note in my project the app is not published so at this time I don't quite care about versioning, but just wanted to report the discrepancy. I'm not sure why only this module was affected.

Regardless I changed the logic to avoid applying the plugin via allprojects.

On a side note I understand I should upgrade to convention plugins, but I'm not there yet. Currently I'm using the approach that was taken by spring-framework guys.


Can you try to put the plugin directly in the plugins block in the fireplace-app project?

Adding the plugin and semver block in fireplace-app didn't change anything (the parent pom still uses allprojects)

You can try to add again that property to fix ordering issues with other plugins and so on:

semver.project.tagPrefix=v

That seem to fix the issue.

@bric3
Copy link
Author

bric3 commented Jan 5, 2023

The problem is with the id("org.graalvm.plugin.compiler") plugin, looks like they are fetching the version in the configuration phase.

Ah interesting ! I remember indeed the version failures when I was trying a dev stage while the last version is an RC. And the failure happened during configuration phase of the graalvm plugin 🤔. Thanks for the insight.

Eventually I can remove this plugin, as the goal was to replace provide the JVM C2 compiler by graal. And while before I was configuring manually the dependencies and the command line, this plugin did everything automatically, that said if the plugin is an issue...

@JavierSegoviaCordoba
Copy link
Owner

I have tried to find the Graal repo to report that issue with org.graalvm.plugin.compiler but looks like they are not updating that plugin since 2020. Maybe they are using a different plugin?

@bric3
Copy link
Author

bric3 commented Jan 5, 2023

Not sure they are still working on this.

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

No branches or pull requests

2 participants