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

Restore common types and Xbase generators #2882

Merged
merged 15 commits into from
Dec 31, 2023
Merged

Restore common types and Xbase generators #2882

merged 15 commits into from
Dec 31, 2023

Conversation

LorenzoBettini
Copy link
Contributor

Closes #2881

WARNING: to have something buildable in the CI, I based my branch on top of the update to the new Guava. Before merging, I can rebase on master once #2878 is merged.

For common types, I created a new MWE2 since there's no need to run it as a Java application as it was done before in GenerateEMF.java.

For Xbase, I simply restored generator as a source folder, and I kept the Java generator (that's too big and I didn't dare to port it as a MWE2), though there was an old reference to xtext-eclipse folder (a remainder of the split repo), which I fixed.

I also regenerated the Java classes: there are only a few white spaces in a few classes. I thought it was worthwhile to commit them.

@LorenzoBettini
Copy link
Contributor Author

@cdietrich I rebased the PR, which is now ready to review

@@ -0,0 +1,36 @@
/*******************************************************************************
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if we wouldn't ship this workflow file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since MWE2 uses common.types, I'd prefer if we could regenerate without an MWE dependency. Otherwise changes to the types model would require MWE to run successfully before other changes to the types model can be applied.

@LorenzoBettini
Copy link
Contributor Author

@szarnekow so you would suggest going back to the Java file generator for common types?

Moreover, looking at your other comment on GenerateXbase, if that generator folder is set as a source folder then it will be part of the binary JAR; the same for Generate common types if we go back to the Java version.

If we don't want to put the Java generator file in the binary JAR, I can restore the previous situation where the generator Java files were not in a source folder. To run those files, we should temporarily set the "generator" folder as a source folder, run the generator, and then restore the "generator" folder as a NON-source folder. In such a case, maybe we could leave a README in those projects.

@szarnekow
Copy link
Contributor

Would a separate output folder for the src/generator as well as a bin.exclude (? is there such a thing?) help?

@LorenzoBettini
Copy link
Contributor Author

Let's see: the build.properties editor does not complain about bin.excludes. I'll update the PR and see whether the produced JAR are as expected.

In any case, I go back to the Java code for generating common types, right?

Note however that the additional.bundles do require MWE

@LorenzoBettini
Copy link
Contributor Author

@szarnekow I restored the Java file for common types (I renamed it to GenerateCommonTypes.java) and I excluded the generator folder with bin.excludes both in common.types and in xbase.

The Jenkins build is https://ci.eclipse.org/xtext/job/xtext/job/lb_2881/lastSuccessfulBuild/artifact/build/p2-repository/plugins/. I downloaded the JARs of xbase and common types and the GenerateCommonTypes and GenerateXbase are NOT there:

❯ jar -tf org.eclipse.xtext.xbase_2.34.0.v20231230-2015.jar | grep Generate
org/eclipse/xtext/xbase/annotations/XbaseWithAnnotationsStandaloneSetupGenerated.class
org/eclipse/xtext/xbase/XbaseStandaloneSetupGenerated.class
org/eclipse/xtext/xbase/XtypeStandaloneSetupGenerated.class
❯ jar -tf org.eclipse.xtext.common.types_2.34.0.v20231230-2015.jar | grep Generate

So, it worked! :)

Copy link
Contributor

@szarnekow szarnekow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@LorenzoBettini LorenzoBettini merged commit cc49ec9 into main Dec 31, 2023
9 checks passed
@LorenzoBettini LorenzoBettini deleted the lb_2881 branch December 31, 2023 08:04
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.

Restore common types and Xbase generators
2 participants