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

Test 3.0.0-M1 #192

Closed
oehme opened this issue Aug 31, 2021 · 15 comments
Closed

Test 3.0.0-M1 #192

oehme opened this issue Aug 31, 2021 · 15 comments

Comments

@oehme
Copy link
Member

oehme commented Aug 31, 2021

@xtext/xtext-dev, @kuniss and anyone else interested: I've just published a milestone for the 3.0.0 release of this plugin. If you have any projects you'd like to test this with, I'd appreciate your feedback and bug reports :)

@kuniss
Copy link

kuniss commented Aug 31, 2021

Thanks @oehme for the lot of work you have done! Very appreciated!
Only 2 user community issues left. Wow!👏

I will definitely try it out but will not be able to do so before end of next week.

@oehme
Copy link
Member Author

oehme commented Aug 31, 2021

There's no rush, I'm gonna be on vacation soon anyway and don't plan to publish the final release before I come back.

kuniss added a commit to JavaPOSWorkingGroup/javapos-code-generators that referenced this issue Sep 6, 2021
- bumped plugin org.xtext.xtend to 3.0.0-M1 to for testing in regard to
  xtext/xtext-gradle-plugin#192
- bumped org.eclipse.xtend:org.eclipse.xtend.lib to the latest 2.25 as
  compiling against 2.9 does not work anymore
- removed build scan logic as it does not work anymore with the latest
  Gradle version (7.0)
@kuniss
Copy link

kuniss commented Sep 6, 2021

The Gradle plugin org.xtext.xtend:3.0.0-M1 worked well with an ordinary Xtend project running Gradle build by a Java 8 VM (see commit reference JavaPOSWorkingGroup/javapos-code-generators@9f29841).

However, the minimal Xtend lib version must be org.eclipse.xtend:org.eclipse.xtend.lib:2.18.+. Versions below cause unreasonable Xtend compiler errors.
But, I guess, this intended.

kuniss added a commit to kuniss/epsilon-ide-extensions that referenced this issue Sep 6, 2021
for testing in regard to
xtext/xtext-gradle-plugin#192.
However, the plugin carries a braking change which requires to adapt
gradle/source-layout.gradle - an originally wizard generated file.
@kuniss
Copy link

kuniss commented Sep 6, 2021

A test of the org.xtext:xtext-gradle-plugin:3.0.0-M1 at a Eclipse Xtext wizard generated project run successfully after some slight adaptation of the gradle/source-layout.gradle file. See commit reference kuniss/epsilon-ide-extensions@7d1de4d.

The required adaptation of gradle/source-layout.gradle could be a challenge for all Xtext users who had applied the Xtext project creation wizard in Eclipse and are not familiar with Gradle.
So it may be worth, to mention in the release notes, not only the breaking change in the release notes but also explicitly that gradle/source-layout.gradle has to be adapted from

  java.srcDirs = ['src', 'src-gen']
  resources.srcDirs = ['src', 'src-gen']

to

  java.srcDir 'src'
  java.srcDir 'src-gen'
  resources.srcDir 'src'
  resources.srcDir 'src-gen'

accordingly.

@kuniss
Copy link

kuniss commented Sep 6, 2021

Seems the new org.xtext:xtext-gradle-plugin:3.0.0-M also resolves the issue eclipse-xtext/xtext#1976, see commit
kuniss/epsilon-ide-extensions@2100a2e for an example.

@oehme
Copy link
Member Author

oehme commented Sep 6, 2021

@kuniss does that source layout actually work? I would expect tons of duplicate resources in your JARS, since src/main/java is the default source dir and you are now adding src on top of that. What you have to do for this Eclipse-style layout is explicitly mention the xtend output dir, e.g. java.srcDirs = ['src', 'src-gen', 'xtend-gen']. And you shouldn't need to change the resource dirs at all.

However, the minimal Xtend lib version must be org.eclipse.xtend:org.eclipse.xtend.lib:2.18.+. Versions below cause unreasonable Xtend compiler errors.

No, that's unexpected. We still test for 2.9.1 in our integration tests. I'll have a look at your example.

@kuniss
Copy link

kuniss commented Sep 6, 2021

No duplicates in the JAR as far as I can assess. However, I have no sources under src/main/java. The Xtext wizard has created all sources directly under src. That's may be the reason for no duplicates.

Your recommendation java.srcDirs = ['src', 'src-gen', 'xtend-gen'] also works and is probably the better solution! But is also worth to be mentioned explicitly for non-experienced users, I guess.

kuniss added a commit to kuniss/epsilon-ide-extensions that referenced this issue Sep 6, 2021
according to @ohme's recommendation in the
xtext/xtext-gradle-plugin#192 discussion.
@kuniss
Copy link

kuniss commented Sep 9, 2021

Further test with an more sophisticated (proprietary) Xtend project which references org.eclipse.xtend:org.eclipse.xtend.lib:2.19.+ was successful.
Only the source sets has to be adapted as @oehme recomended at #192 (comment).

@kuniss
Copy link

kuniss commented Sep 9, 2021

Just another encountering, @oehme, regarding

However, the minimal Xtend lib version must be org.eclipse.xtend:org.eclipse.xtend.lib:2.18.+. Versions below cause unreasonable Xtend compiler errors.

No, that's unexpected. We still test for 2.9.1 in our integration tests. I'll have a look at your example.

In fact, I tried to recompile the https://github.com/JavaPOSWorkingGroup/javapos-code-generators project with the old plugin version 2.0.9 and with referencing org.eclipse.xtend:org.eclipse.xtend.lib:2.9.+.
For that I got also strange Xtend compiler errors , the same as for the new plugin, as far as I can see!
So, I guess, its not related to the new gradle plugin version at all.

Here is a Gitpod workspace snapshot of this error and the console output:

gitpod /workspace/javapos-code-generators $ ./gradlew build
Picked up JAVA_TOOL_OPTIONS: -Xmx1879m

> Task :generateXtext
resolution of uriFragment '|0' failed.
Error finding the elements to be processed by active annotations
resolution of uriFragment '|0' failed.
Error finding the elements to be processed by active annotations
resource is empty: java:/Objects/java.io.File
resolution of uriFragment '|0' failed.
Error finding the elements to be processed by active annotations
resolution of uriFragment '|0' failed.
Error finding the elements to be processed by active annotations
resolution of uriFragment '|0' failed.
Error finding the elements to be processed by active annotations
resource is empty: java:/Objects/java.lang.Object
resolution of uriFragment '|0' failed.
resource is empty: java:/Objects/java.io.BufferedWriter
resolution of uriFragment '|0' failed.
resolution of uriFragment '|1' failed.
resolution of uriFragment '|1' failed.
resolution of uriFragment '|2' failed.
resource is empty: java:/Objects/java.io.FileWriter
resolution of uriFragment '|2' failed.
resolution of uriFragment '|3' failed.
resource is empty: java:/Objects/java.util.ArrayList
resolution of uriFragment '|3' failed.
resolution of uriFragment '|4' failed.
resource is empty: java:/Objects/java.util.List
resolution of uriFragment '|4' failed.
resolution of uriFragment '|46' failed.
resource is empty: java:/Objects/java.lang.CharSequence
resolution of uriFragment '|46' failed.
resolution of uriFragment '|46' failed.
resolution of uriFragment '|46' failed.

> Task :generateXtext FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateXtext'.
> javax/annotation/Generated

@cdietrich
Copy link
Member

cdietrich commented Sep 13, 2021

could also be a java-version/asm-version problem
besides that you are using features that are not part of xtend 2.9 yet.

ERROR:no viable alternative at input '?' (file:/home/dietrich/tmp/javapos-code-generators/src/main/xtend/jpos/build/controls/JavaPOSBeanInfoGenerator.xtend line : 219 column : 172)

@kuniss
Copy link

kuniss commented Sep 13, 2021

could also be a java-version/asm-version problem
besides that you are using features that are not part of xtend 2.9 yet.

ERROR:no viable alternative at input '?' (file:/home/dietrich/tmp/javapos-code-generators/src/main/xtend/jpos/build/controls/JavaPOSBeanInfoGenerator.xtend line : 219 column : 172)

I'm not using Xtend 2.9 language version, only the Xtend 2.9 lib! And it was just a try to show, it is not related to the new Gradle plugin but something else.

So, I agree, could be a java-version/asm-version problem.
We should not invest too much effort in further analysis. At least not in the context of this issue...

Maybe, it's just enough that it has been documented here in case some one stumbles upon it. Having done this, we should go on with the new plugin.

@kuniss
Copy link

kuniss commented Sep 28, 2021

I'm using the milestone for more than 7 different projects, mostly to get rid of the #187 problem. All without any issue until now.
Hey, @oehme isn't it mature enough now to get it released? 😄

@oehme
Copy link
Member Author

oehme commented Oct 21, 2021

Released and updated the docs.

@cdietrich would you mind updating the xtext-wizard so it generates projects with this version? Besides changing the version, the source layout needs to be adjusted:

Plain project layout:

java.srcDirs = ['src', 'src-gen', 'xtend-gen']

Maven/Gradle project layout:

java.srcDir 'src/main/xtext-gen'

@oehme oehme closed this as completed Oct 21, 2021
@cdietrich
Copy link
Member

cdietrich commented Oct 21, 2021

@oehme
Copy link
Member Author

oehme commented Oct 21, 2021

I had missed that, thanks!

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

3 participants