-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix(regression): add created source files to spoon input #70
Conversation
Looks fixed, but
Everything expect the last bulletpoint needs to be done before a merge. |
src/main/java/fr/inria/gforge/spoon/configuration/AbstractSpoonConfigurationBuilder.java
Outdated
Show resolved
Hide resolved
@MartinWitt what I don't understand is that
No it's ok, no urgency, we'll release XWiki 12.4 without this and it'll go in 12.5 (next month release). Thanks a lot. |
My first thought was, that it should return it too. But looking https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html and https://stackoverflow.com/questions/30039613/maven-plugin-get-generated-sources-directory it seems like maven has no standard defined for this and cant resolve generated-source for you. And I found no method to get generated-sources. |
Normally when you code a plugin that generates sources you add the target source directory to the source roots. Maybe the javacc plugin is not compliant and doesn't do it? |
ok I think that's the reason, the old codehaus javacc mojo is not respecting the rules from what I see: https://github.com/mojohaus/javacc-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/javacc/JavaCCMojo.java#L170 |
I see there's a new plugin version at https://github.com/phax/ph-javacc-maven-plugin However, I don't see much changes: |
Oh thank you for your research i have only searched the bug on our side. Now we change from a bug to supporting maven plugins that work "incorrectly", but we could fix this on our side. Javacc looks like a often used code generator, so dropping support is huge step. |
So I've upgraded to this new plugin and I have the same error on the spoon side. |
This is an example of a well-written plugin: https://github.com/antlr/antlr4/blob/master/antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4Mojo.java#L307 As you can see it calls addCompileSourceRoot() at https://github.com/antlr/antlr4/blob/master/antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4Mojo.java#L201 |
Issue opened on the javacc plugin side at tulipcc/tulipcc-maven-plugin#17 |
You are really fast, thank you for your effort. Lets see what javacc developers say to your issue. |
Yes I don't think we should wait on them. |
@MartinWitt they have answered and it seems they call the addCompileSourceRoot() so normally you should get it. See tulipcc/tulipcc-maven-plugin#17 (comment) It's also called with the older codehaus javacc maven plugin, see https://github.com/mojohaus/javacc-maven-plugin/blob/739194d58700260c4b600cd1bbc40979dfd8f851/src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java#L657 |
hmm looks like my bad. You are 100% correct, it works without adding the lines. |
I changed the pom xwiki-rendering-wikimodel to force spoon 3.5-SNAPSHOT (version with fix) and rann mvn install -DskipTests > spoon.log. As you see in the log it works now? <plugin>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-maven-plugin</artifactId>
<version>3.5-SNAPSHOT</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<includeTest>true</includeTest>
<includeSource>true</includeSource>
<noClasspath>false</noClasspath>
</configuration>
</plugin>```
[spoon.log](https://github.com/SpoonLabs/spoon-maven-plugin/files/4645876/spoon.log) |
It does! Cool, thanks a lot :) |
The hardcoded versions can only be removed after release, because maven does not support use newest version like gradle. Only point left is create a real regression testcase for this. I hope I can get this done tomorrow/tonight. |
@MartinWitt what hardcoded versions? |
https://github.com/SpoonLabs/spoon-maven-plugin/pull/70/files#diff-403631b4cad466f44faaca502d672427R38 like this. |
<plugin> | ||
<groupId>fr.inria.gforge.spoon</groupId> | ||
<artifactId>spoon-maven-plugin</artifactId> | ||
<version>3.5-SNAPSHOT</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use a filtered resource for example?
See:
- https://github.com/xwiki/xwiki-commons/blob/46e0ef7112577803a00e0c7f1abc035be38a8bf2/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-integration-tests/pom.xml#L55
- https://github.com/xwiki/xwiki-commons/blob/0a56fb5fb8c59ea93bc09a5897c929322b64265a/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-integration-tests/src/test/resources/wrongVersion/pom.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because i normally use gradle and didn't knew it. Going to have a look thx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about simply removing <version>3.5-SNAPSHOT</version>
as you did above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you remove the version the build won't be reproducible and maven will use the latest version available. You need a version (and you should actually use the maven enforcer to always make sure all versions are set).
To finish this bugfix/issue, the task were:
Looks like all is done and @monperrus time for a review? INRIA/spoon#3345 is still open, but i believe a version like 3.4.1 shouldn't contain new features. This issue is part of patch 3.5? |
Thanks a lot for the progress. LGTM, see last comment. Do we already have a fix for INRIA/spoon#3345? If yes, let's merge it now and release 3.5 directly and save one release. |
Looking here we use fullclasspathmode by default. The issue is only changing a parameter? |
So INRIA/spoon#3345 is already fixed, and we can add it in the Changelog. I think we can proceed, merge this PR and release 3.4.1. WDYT? |
just did a small readme update and yes i believe you can merge it. |
Definitely, with pleasure :) FYI, on the xwiki.org site we documented our spoon usages at https://dev.xwiki.org/xwiki/bin/view/Community/Building/#HAutomaticChecks |
Merged, thanks a lot @MartinWitt Now releasing 3.4.1 |
FYI, 3.4.1 is in Maven Central |
Thanks @MartinWitt and @monperrus I've now tested v3.4.1 and I've found a regression: INRIA/spoon#3376 I've rolled-back to v3.3 for now. Thanks! (and sorry ;)) |
See (INRIA/spoon#3366) for details. Currently there is only a test project with a simple javacc case and a addition to the CI as starting point for the bug.
Edit: this should now fully showcase the bug, with a minimal working example