Skip to content

Commit

Permalink
Xtext 2.25 / Eclipse 2021-12 upgrade (finos#348)
Browse files Browse the repository at this point in the history
* Xtext 2.25 / Eclipse 2021-12 upgrade

* Fix dependencies

* Add tycho env

* Java target 8, resolve/ignore errors

* Tidy up

* Random attempts to fix things

* Add org.eclipse.xtext.xbase.feature.group

* More random stuff to make it stable

* Tidy up

* Uncomment inject

* Remove unused file

* classpath

* Update .classpath

* Update .classpath

* Update .classpath

* Update .classpath

* Update .classpath

* Fix test
  • Loading branch information
hugohills-regnosys authored Feb 4, 2022
1 parent ceab1fb commit 37f7149
Show file tree
Hide file tree
Showing 21 changed files with 190 additions and 183 deletions.
4 changes: 2 additions & 2 deletions com.regnosys.rosetta.blueprint-lib/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
8 changes: 4 additions & 4 deletions com.regnosys.rosetta.ide/.classpath
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="src" path="src-gen">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="xtend-gen/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
10 changes: 1 addition & 9 deletions com.regnosys.rosetta.lib/.classpath
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="xtend-gen">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Expand Down
8 changes: 4 additions & 4 deletions com.regnosys.rosetta.lib/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Bundle-Version: 0.0.0.master
Bundle-Vendor: REGnosys
Require-Bundle: org.eclipse.xtext,
org.eclipse.xtext.xbase,
org.junit.jupiter.api;bundle-version="5.7.0",
org.junit.jupiter.params;bundle-version="5.7.0",
org.junit.platform.commons;bundle-version="1.7.0",
org.opentest4j;bundle-version="1.0.0",
org.junit.jupiter.api;bundle-version="5.8.1",
org.junit.jupiter.params;bundle-version="5.8.1",
org.junit.platform.commons;bundle-version="1.8.1",
org.opentest4j;bundle-version="1.2.0",
org.hamcrest.core,
org.mockito,
net.bytebuddy.byte-buddy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public MapperC<Object> unionDifferent(MapperBuilder<?> other) {
return new MapperC<>(unionItems);
}
else if(other instanceof MapperS) {
return ((MapperC<?>) other).unionDifferent(this);
return ((MapperS<?>) other).unionDifferent(this);
}
else {
throw new IllegalArgumentException("Unsupported Mapper type: " + other.getClass().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.rosetta.model.lib.mapper.Mapper;
import com.rosetta.model.lib.mapper.MapperS;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand All @@ -16,6 +14,9 @@

import org.junit.jupiter.api.Test;

import com.rosetta.model.lib.mapper.Mapper;
import com.rosetta.model.lib.mapper.MapperS;

public class MapperTest {

private final static ObjectBranchNode OBJECT_BRANCH_NODE = new ObjectBranchNode("A", 4);
Expand Down Expand Up @@ -311,39 +312,39 @@ public void testListBranchNodeMappingSuccessWithUnionSame() {
@Test
public void testListBranchNodeMappingSuccessWithUnionDifferent() {
Foo foo = new Foo(Arrays.asList(LIST_BRANCH_NODE_1, LIST_BRANCH_NODE_2, LIST_BRANCH_NODE_3), OBJECT_BRANCH_NODE);

Mapper<Object> mapper = MapperS.of(foo).mapC("getListBranchNodes", Foo::getListBranchNodes).map("getIntLeafNode", ListBranchNode::getIntLeafNode)
.unionDifferent(MapperS.of(foo).map("getObjectBranchNode", Foo::getObjectBranchNode).map("getIntLeafNode", ObjectBranchNode::getIntLeafNode));

List<String> paths = mapper.getPaths().stream().map(Mapper.Path::toString).collect(Collectors.toList());
assertThat("Unexpected number of paths", paths.size(), is(4));
assertTrue(paths.contains("Foo->getListBranchNodes[0]->getIntLeafNode"), "Expected mapper paths not found");
assertTrue(paths.contains("Foo->getListBranchNodes[1]->getIntLeafNode"), "Expected mapper paths not found");
assertTrue(paths.contains("Foo->getListBranchNodes[2]->getIntLeafNode"), "Expected mapper paths not found");
assertTrue(paths.contains("Foo->getObjectBranchNode->getIntLeafNode"), "Expected mapper paths not found");

assertThat("Unexpected number of error paths", mapper.getErrorPaths().size(), is(0));

Object leafNodeObject = mapper.get();
assertNull(leafNodeObject, "Expected null leafNode object because more than 1 element");

List<Object> multi = mapper.getMulti();
assertThat("Unexpected number of multi", multi.size(), is(4));
assertTrue(multi.contains(1), "Expected mapper multi values not found");
assertTrue(multi.contains(2), "Expected mapper multi values not found");
assertTrue(multi.contains(3), "Expected mapper multi values not found");
assertTrue(multi.contains(4), "Expected mapper multi values not found");

Optional<?> parentLeafNodeObject = mapper.getParent();
assertFalse(parentLeafNodeObject.isPresent(), "Expected absent parent object because more than 1 element");

List<?> parentMulti = mapper.getParentMulti();
assertThat("Unexpected number of multiParent", parentMulti.size(), is(4));
assertTrue(parentMulti.contains(LIST_BRANCH_NODE_1), "Expected mapper multi parent object not found");
assertTrue(parentMulti.contains(LIST_BRANCH_NODE_2), "Expected mapper multi parent object not found");
assertTrue(parentMulti.contains(LIST_BRANCH_NODE_3), "Expected mapper multi parent object not found");
assertTrue(parentMulti.contains(OBJECT_BRANCH_NODE), "Expected mapper multi parent object not found");

assertTrue(mapper.getErrors().isEmpty(), "Expected errors to be empty");
}

Expand Down
51 changes: 25 additions & 26 deletions com.regnosys.rosetta.target/com.regnosys.rosetta.target.target
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,40 @@
<target name="com.regnosys.rosetta.target" sequenceNumber="1">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2020-12"/>
<unit id="org.eclipse.emf.ecore.xcore.sdk.feature.group" version="1.16.0.v20201105-0712"/>
<unit id="org.eclipse.jdt.feature.group" version="3.18.600.v20201202-1800"/>
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2021-12"/>
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.codegen.ecore.feature.group" version="2.28.0.v20210925-0555"/>
<unit id="org.eclipse.emf.codegen.feature.group" version="2.23.0.v20210924-1718"/>
<unit id="org.eclipse.emf.common.feature.group" version="2.24.0.v20210924-1718"/>
<unit id="org.eclipse.emf.ecore.feature.group" version="2.26.0.v20210924-1718"/>
<unit id="org.eclipse.emf.ecore.xcore.feature.group" version="1.19.0.v20210925-0555"/>
<unit id="org.eclipse.emf.ecore.xcore.lib.feature.group" version="1.8.0.v20210924-1718"/>
<unit id="org.eclipse.emf.mwe.core.feature.feature.group" version="1.6.1.v20210218-2134"/>
<unit id="org.eclipse.emf.mwe2.language.sdk.feature.group" version="2.12.1.v20210218-2134"/>
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="2.12.1.v20210218-2134"/>
<unit id="org.eclipse.emf.mwe2.runtime.sdk.feature.group" version="2.12.1.v20210218-2134"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="1.17.1.20201207-1112"/>
<unit id="org.eclipse.pde.feature.group" version="3.14.600.v20201202-1800"/>
<unit id="org.eclipse.egit.feature.group" version="5.10.0.202012080955-r"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.12.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.23.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/orbit/downloads/2020-12"/>
<unit id="org.slf4j.api" version="1.7.2.v20121108-1250"/>
<unit id="org.slf4j.binding.simple" version="1.7.30.v20200204-2150"/>
<unit id="net.bytebuddy.byte-buddy.source" version="1.9.0.v20181107-1410"/>
<unit id="org.mockito" version="2.23.0.v20200310-1642"/>
<unit id="org.apache.commons.lang3" version="3.1.0.v201403281430"/>
<unit id="org.junit.jupiter.api" version="5.7.0.v20201026-1537"/>
<unit id="org.junit.jupiter.engine" version="5.7.0.v20201026-1537"/>
<unit id="org.eclipse.jdt.feature.group" version="3.18.1000.v20211124-1800"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="1.19.0.20211116-0804"/>
<unit id="org.eclipse.pde.feature.group" version="3.14.1000.v20211124-1800"/>
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<unit id="org.eclipse.xtext.sdk.feature.group" version="2.25.0.v20210301-1429"/>
<unit id="org.eclipse.xtext.xbase.feature.group" version="2.25.0.v20210301-1429"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="http://boothen.github.io/Json-Eclipse-Plugin/"/>
<unit id="jsonedit-feature.feature.group" version="1.1.3"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/orbit/downloads/2021-12"/>
<unit id="org.apache.logging.log4j" version="2.15.0.v20211211-1928"/>
<unit id="org.apache.logging.log4j.source" version="2.15.0.v20211211-1928"/>
<unit id="net.bytebuddy.byte-buddy" version="1.9.0.v20181107-1410"/>
<unit id="org.apache.commons.lang3" version="3.1.0.v201403281430"/>
<unit id="org.junit.jupiter.api" version="5.8.1.v20211018-1956"/>
<unit id="org.junit.jupiter.engine" version="5.8.1.v20211018-1956"/>
<unit id="org.mockito" version="2.23.0.v20200310-1642"/>
<unit id="org.slf4j.api" version="1.7.2.v20121108-1250"/>
<unit id="org.slf4j.binding.simple.source" version="1.7.30.v20200204-2150"/>
</location>
</locations>
</target>
24 changes: 14 additions & 10 deletions com.regnosys.rosetta.tests/.classpath
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="src" path="src">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src-gen">
<classpathentry kind="src" path="src-gen/">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="xtend-gen">
<classpathentry kind="src" path="xtend-gen/">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
<classpathentry kind="src" path="src-test/java/">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<classpathentry kind="src" path="test-resources/">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
6 changes: 3 additions & 3 deletions com.regnosys.rosetta.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bundle-SymbolicName: com.regnosys.rosetta.tests;singleton:=true
Bundle-Version: 0.0.0.master
Bundle-Vendor: REGnosys
Require-Bundle: org.junit.jupiter.api;bundle-version="[5.1.0,6.0.0)",
org.eclipse.xtext.xbase.lib;bundle-version="2.20.0",
org.eclipse.xtext.xbase.lib;bundle-version="2.25.0",
org.eclipse.xtext.util,
org.eclipse.xtext.testing,
org.eclipse.xtext.xbase.testing,
Expand All @@ -20,8 +20,8 @@ Require-Bundle: org.junit.jupiter.api;bundle-version="[5.1.0,6.0.0)",
org.mockito,
org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-11
Import-Package: org.junit.jupiter.api;bundle-version="5.7.0",
org.junit.jupiter.params;bundle-version="5.7.0",
Import-Package: org.junit.jupiter.api;bundle-version="5.8.1",
org.junit.jupiter.params;bundle-version="5.8.1",
com.regnosys.rosetta.rosetta,
model
Bundle-ActivationPolicy: lazy
Expand Down
9 changes: 8 additions & 1 deletion com.regnosys.rosetta.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<artifactId>com.regnosys.rosetta.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>

<dependencies>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -63,7 +71,6 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>default-test</id>
Expand Down
15 changes: 5 additions & 10 deletions com.regnosys.rosetta.ui.tests/.classpath
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src-gen">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="xtend-gen">
<classpathentry kind="src" path="src-gen/">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
<classpathentry kind="src" path="xtend-gen/">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 0 additions & 1 deletion com.regnosys.rosetta.ui.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<failIfNoTests>false</failIfNoTests>
<useUIHarness>true</useUIHarness>
Expand Down
8 changes: 4 additions & 4 deletions com.regnosys.rosetta.ui/.classpath
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="src" path="src-gen">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="xtend-gen/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
8 changes: 4 additions & 4 deletions com.regnosys.rosetta.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Require-Bundle: com.regnosys.rosetta,
org.eclipse.xtext.ui,
org.eclipse.xtext.ui.shared,
org.eclipse.xtext.ui.codetemplates.ui,
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
org.eclipse.ui.editors;bundle-version="3.14.0",
org.eclipse.ui.ide;bundle-version="3.18.0",
org.eclipse.ui,
org.eclipse.compare,
org.eclipse.xtext.builder,
org.eclipse.xtext.xbase.lib;bundle-version="2.15.0",
org.eclipse.xtend.lib;bundle-version="2.15.0";resolution:=optional,
org.eclipse.xtext.xbase.lib;bundle-version="2.25.0",
org.eclipse.xtend.lib;bundle-version="2.25.0";resolution:=optional,
org.eclipse.xtext.common.types.ui
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-11
Expand Down
Loading

0 comments on commit 37f7149

Please sign in to comment.