Skip to content

Commit 9152271

Browse files
committed
java 17/21 switch in tp
Signed-off-by: Christian Dietrich <christian.dietrich.opensource@gmail.com>
1 parent d4c5a97 commit 9152271

File tree

9 files changed

+49
-10
lines changed

9 files changed

+49
-10
lines changed

org.eclipse.xtext.tests/testdata/wizard-expectations/full/full.parent/full.target/full.target.target

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde version="3.8"?>
33
<target name="full.target" sequenceNumber="1">
4+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
45
<locations>
56
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
67
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
78
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
89
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
910
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
1011
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
11-
<repository location="https://download.eclipse.org/releases/2025-03"/>
12+
<repository location="https://download.eclipse.org/releases/2024-12"/>
1213
</location>
1314
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
1415
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>

org.eclipse.xtext.tests/testdata/wizard-expectations/lsMavenTychoApp/lsMavenTychoApp.parent/lsMavenTychoApp.target/lsMavenTychoApp.target.target

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde version="3.8"?>
33
<target name="lsMavenTychoApp.target" sequenceNumber="1">
4+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
45
<locations>
56
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
67
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
78
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
89
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
910
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
1011
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
11-
<repository location="https://download.eclipse.org/releases/2025-03"/>
12+
<repository location="https://download.eclipse.org/releases/2024-12"/>
1213
</location>
1314
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
1415
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>

org.eclipse.xtext.tests/testdata/wizard-expectations/lsMavenTychoFatjar/lsMavenTychoFatjar.parent/lsMavenTychoFatjar.target/lsMavenTychoFatjar.target.target

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde version="3.8"?>
33
<target name="lsMavenTychoFatjar.target" sequenceNumber="1">
4+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
45
<locations>
56
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
67
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
78
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
89
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
910
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
1011
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
11-
<repository location="https://download.eclipse.org/releases/2025-03"/>
12+
<repository location="https://download.eclipse.org/releases/2024-12"/>
1213
</location>
1314
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
1415
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>

org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTycho/mavenTycho.parent/mavenTycho.target/mavenTycho.target.target

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde version="3.8"?>
33
<target name="mavenTycho.target" sequenceNumber="1">
4+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
45
<locations>
56
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
67
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
78
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
89
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
910
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
1011
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
11-
<repository location="https://download.eclipse.org/releases/2025-03"/>
12+
<repository location="https://download.eclipse.org/releases/2024-12"/>
1213
</location>
1314
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
1415
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>

org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit5/mavenTychoJUnit5.parent/mavenTychoJUnit5.target/mavenTychoJUnit5.target.target

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde version="3.8"?>
33
<target name="mavenTychoJUnit5.target" sequenceNumber="1">
4+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
45
<locations>
56
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
67
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
78
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
89
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
910
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
1011
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
11-
<repository location="https://download.eclipse.org/releases/2025-03"/>
12+
<repository location="https://download.eclipse.org/releases/2024-12"/>
1213
</location>
1314
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
1415
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>

org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoP2/mavenTychoP2.parent/mavenTychoP2.target/mavenTychoP2.target.target

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde version="3.8"?>
33
<target name="mavenTychoP2.target" sequenceNumber="1">
4+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
45
<locations>
56
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
67
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
78
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
89
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
910
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
1011
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
11-
<repository location="https://download.eclipse.org/releases/2025-03"/>
12+
<repository location="https://download.eclipse.org/releases/2024-12"/>
1213
</location>
1314
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
1415
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>

org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoP2J21/mavenTychoP2J21.parent/mavenTychoP2J21.target/mavenTychoP2J21.target.target

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde version="3.8"?>
33
<target name="mavenTychoP2J21.target" sequenceNumber="1">
4+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
45
<locations>
56
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
67
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>

org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/TargetPlatformProject.xtend

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package org.eclipse.xtext.xtext.wizard
1010

1111
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor
1212
import org.eclipse.xtext.util.JUnitVersion
13+
import org.eclipse.xtext.util.JavaVersion
1314

1415
@FinalFieldsConstructor
1516
class TargetPlatformProject extends ProjectDescriptor {
@@ -53,14 +54,23 @@ class TargetPlatformProject extends ProjectDescriptor {
5354
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5455
<?pde version="3.8"?>
5556
<target name="«name»" sequenceNumber="1">
57+
«IF config.javaVersion.isAtLeast(JavaVersion.JAVA21
58+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
59+
«ELSE»
60+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
61+
«ENDIF»
5662
<locations>
5763
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
5864
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
5965
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
6066
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
6167
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
6268
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
63-
<repository location="https://download.eclipse.org/releases/2025-03"/>
69+
«IF config.javaVersion.isAtLeast(JavaVersion.JAVA21
70+
<repository location="https://download.eclipse.org/releases/2025-03"/>
71+
«ELSE»
72+
<repository location="https://download.eclipse.org/releases/2024-12"/>
73+
«ENDIF»
6474
</location>
6575
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
6676
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>

org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/TargetPlatformProject.java

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor;
1717
import org.eclipse.xtend2.lib.StringConcatenation;
1818
import org.eclipse.xtext.util.JUnitVersion;
19+
import org.eclipse.xtext.util.JavaVersion;
1920
import org.eclipse.xtext.util.XtextVersion;
2021
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
2122
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
@@ -86,6 +87,18 @@ public CharSequence target() {
8687
_builder.append(_name);
8788
_builder.append("\" sequenceNumber=\"1\">");
8889
_builder.newLineIfNotEmpty();
90+
{
91+
boolean _isAtLeast = this.getConfig().getJavaVersion().isAtLeast(JavaVersion.JAVA21);
92+
if (_isAtLeast) {
93+
_builder.append("\t");
94+
_builder.append("<targetJRE path=\"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21\"/>");
95+
_builder.newLine();
96+
} else {
97+
_builder.append("\t");
98+
_builder.append("<targetJRE path=\"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17\"/>");
99+
_builder.newLine();
100+
}
101+
}
89102
_builder.append("\t");
90103
_builder.append("<locations>");
91104
_builder.newLine();
@@ -107,9 +120,18 @@ public CharSequence target() {
107120
_builder.append("\t\t\t");
108121
_builder.append("<unit id=\"org.eclipse.emf.sdk.feature.group\" version=\"0.0.0\"/>");
109122
_builder.newLine();
110-
_builder.append("\t\t\t");
111-
_builder.append("<repository location=\"https://download.eclipse.org/releases/2025-03\"/>");
112-
_builder.newLine();
123+
{
124+
boolean _isAtLeast_1 = this.getConfig().getJavaVersion().isAtLeast(JavaVersion.JAVA21);
125+
if (_isAtLeast_1) {
126+
_builder.append("\t\t\t");
127+
_builder.append("<repository location=\"https://download.eclipse.org/releases/2025-03\"/>");
128+
_builder.newLine();
129+
} else {
130+
_builder.append("\t\t\t");
131+
_builder.append("<repository location=\"https://download.eclipse.org/releases/2024-12\"/>");
132+
_builder.newLine();
133+
}
134+
}
113135
_builder.append("\t\t");
114136
_builder.append("</location>");
115137
_builder.newLine();

0 commit comments

Comments
 (0)