/
TargetPlatformProject.xtend
129 lines (115 loc) · 5.18 KB
/
TargetPlatformProject.xtend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*******************************************************************************
* Copyright (c) 2015, 2024 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.xtext.xtext.wizard
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor
import org.eclipse.xtext.util.JUnitVersion
import org.eclipse.xtext.util.JavaVersion
@FinalFieldsConstructor
class TargetPlatformProject extends ProjectDescriptor {
override getNameQualifier() {
".target"
}
override isEclipsePluginProject() {
false
}
override isPartOfGradleBuild() {
false
}
override isPartOfMavenBuild() {
true
}
override isEnabled() {
config.needsTychoBuild
}
override setEnabled(boolean enabled) {
throw new UnsupportedOperationException("The target platform project is activated automatically for Tycho builds")
}
override getFiles() {
val files = newArrayList
files += super.files
files += file(Outlet.ROOT, name + ".target", target)
files
}
override getSourceFolders() {
#{}
}
def target() '''
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="«name»" sequenceNumber="1">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
«IF config.javaVersion.isAtLeast(JavaVersion.JAVA17)»
<repository location="https://download.eclipse.org/releases/2024-06"/>
«ELSE»
<repository location="https://download.eclipse.org/releases/2023-03"/>
«ENDIF»
</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"/>
«IF config.xtextVersion.mweVersion.matches("\\d+\\.\\d+(\\.\\d+)+")»
<repository location="https://download.eclipse.org/modeling/emft/mwe/updates/releases/«config.xtextVersion.mweVersion»/"/>
«ELSE»
<repository location="https://download.eclipse.org/modeling/emft/mwe/updates/milestones/«config.xtextVersion.mweBuildNumber»/"/>
«ENDIF»
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
«IF config.xtextVersion.isSnapshot»
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/nightly/"/>
«ELSEIF config.xtextVersion.isStable»
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/milestones/"/>
«ELSE»
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/«config.xtextVersion»/"/>
«ENDIF»
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.google.gson" version="2.10.1"/>
<unit id="com.google.inject" version="7.0.0"/>
<unit id="jakarta.inject.jakarta.inject-api" version="2.0.1"/>
<unit id="org.antlr.runtime" version="3.2.0.v20230929-1400"/>
<unit id="org.junit" version="4.13.2.v20230809-1000"/>
<unit id="org.hamcrest" version="2.2.0"/>
<unit id="org.hamcrest.core" version="2.2.0.v20230809-1000"/>
<unit id="org.apache.commons.logging" version="1.2.0"/>
«IF config.junitVersion == JUnitVersion.JUNIT_5»
<unit id="org.apiguardian.api" version="0.0.0"/>
<unit id="junit-jupiter-api" version="0.0.0"/>
<unit id="junit-jupiter-engine" version="0.0.0"/>
<unit id="junit-jupiter-migrationsupport" version="0.0.0"/>
<unit id="junit-jupiter-params" version="0.0.0"/>
<unit id="junit-platform-commons" version="0.0.0"/>
<unit id="junit-platform-engine" version="0.0.0"/>
<unit id="junit-platform-launcher" version="0.0.0"/>
<unit id="junit-platform-runner" version="0.0.0"/>
<unit id="junit-platform-suite-commons" version="0.0.0"/>
<unit id="junit-vintage-engine" version="0.0.0"/>
<unit id="org.opentest4j" version="0.0.0"/>
«ENDIF»
<unit id="org.objectweb.asm" version="9.6.0"/>
<unit id="io.github.classgraph.classgraph" version="4.8.165"/>
<repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-03"/>
</location>
</locations>
</target>
'''
override buildGradle() {
throw new UnsupportedOperationException("Eclipse target platforms are not yet supported in Gradle")
}
override pom() {
super.pom => [
packaging = "eclipse-target-definition"
]
}
}