eclipse / xtext-lib

Eclipse Xtext™ Libraries
https://www.eclipse.org/Xtext/
Eclipse Public License 2.0
19 stars 33 forks source link

Move to Maven/Tycho for projects and build infrastructure #499

Closed LorenzoBettini closed 1 year ago

LorenzoBettini commented 1 year ago

Similar to https://github.com/eclipse/xtext-core/issues/2052

LorenzoBettini commented 1 year ago

I started working on that in my fork, this branch https://github.com/LorenzoBettini/xtext-lib/tree/lb_499_maven_tycho

LorenzoBettini commented 1 year ago

@cdietrich do you know if com.google.guava:guava-testlib is available somewhere as a p2 bundle?

cdietrich commented 1 year ago

no, i have zero clue. can you check what it is used for?

LorenzoBettini commented 1 year ago

It's used in org.eclipse.xtext.xbase.lib.tests which is not even an Eclipse plug-in project (no MANIFEST). However, by using the new mechanism of adding Maven deps in the .target file I solved the problem and the code compiles (tests are also green):

        <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="generate" type="Maven">
            <dependencies>
                <dependency>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava-testlib</artifactId>
                    <version>30.1-jre</version>
                    <type>jar</type>
                </dependency>
            </dependencies>
            <instructions><![CDATA[
Bundle-Name:           Bundle derived from maven artifact ${mvnGroupId}:${mvnArtifactId}:${mvnVersion}
version:               ${version_cleanup;${mvnVersion}}
Bundle-SymbolicName:   ${mvnGroupId}.${mvnArtifactId}
Bundle-Version:        ${version}
Import-Package:        *;resolution:=optional
Export-Package:        *;version="${version}";-noimport:=true
DynamicImport-Package: *
]]></instructions>
        </location>
cdietrich commented 1 year ago

i assume which of the collections asserts therein are actually used and if we can replace it with something else

LorenzoBettini commented 1 year ago
import com.google.common.collect.testing.MapTestSuiteBuilder;
import com.google.common.collect.testing.TestStringMapGenerator;
import com.google.common.collect.testing.features.CollectionFeature;
import com.google.common.collect.testing.features.CollectionSize;
import com.google.common.collect.testing.features.MapFeature;

in org.eclipse.xtext.xbase.tests.lib.MapExtensionsTest

cdietrich commented 1 year ago

ok, then i guess we can try if maven dep works

LorenzoBettini commented 1 year ago

It's also used extensively in the test suites (I seem to understand that it executes tests in that very dependency).

LorenzoBettini commented 1 year ago

@cdietrich some updates: I still have to deal with gwt. Everything else builds and tests are green!

LorenzoBettini commented 1 year ago

@cdietrich concerning GWT: I have no idea of what to do with those projects (I seem to recall what GWT is but I have only a very primordial idea)...

cdietrich commented 1 year ago

am not sure if we want to keep it or not unfortunately nobody has knowledge see https://github.com/eclipse/xtext/issues/2241 @mbudnick are you still using xtend+gwt and do you have experience with gwt and maven?

LorenzoBettini commented 1 year ago

I mean: I can try to create the packages but I have no idea of how they should look like (of course there are tests and I can run them).

Moreover, there's dependency in the gradle file api "com.google.guava:guava-gwt" while in the MANIFEST we simply have com.google.guava... are they the same?

cdietrich commented 1 year ago

you need to check the binary files i guess

cdietrich commented 1 year ago

maybe https://github.com/eclipse/xtext/tree/v2.10.0/plugins/org.eclipse.xtend.lib.gwt can also help to archeologize

LorenzoBettini commented 1 year ago

yes, that put me on the right track. All projects compile, and all tests are green (including the xtend.lib.gwt.test)!!! :)

LorenzoBettini commented 1 year ago

@cdietrich as I said in my previous comment, everything compiles, builds and tests are green (including gwt).

I seem to understand that gwt stuff must NOT be in the update site, am I right? Currently, there are still two features for gwt to be included in the p2 repository.

cdietrich commented 1 year ago

yes it looks like they are published to maven only

mbudnick commented 1 year ago

@mbudnick are you still using xtend+gwt and do you have experience with gwt and maven?

@cdietrich yes, we use org.eclipse.xtext:org.eclipse.xtext.xbase.lib.gwt from Maven Central Repository. If there is a milestone-version or a snapshot-version in an other respository I can test it.

cdietrich commented 1 year ago

ok, so as soon as @LorenzoBettini moves this to our jenkins we will have a maven repo to test

LorenzoBettini commented 1 year ago

@cdietrich @mbudnick I've just pushed my branch and Jenkins built it successfully (I'll create a PR in a minute).

That's the generated Maven repository generated from my branch: https://ci.eclipse.org/xtext/job/xtext-lib/job/lb_499_maven_tycho/lastSuccessfulBuild/artifact/build/maven-repository/

mbudnick commented 1 year ago

My gwt-app has no problem with 2.30.0-SNAPSHOT.

cdietrich commented 1 year ago

done