-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra: convert nested libs to wrapped OSGi bundles
EclipseCS uses several external libraries, which are copied manually into the libs folder. Since everything else comes from the Eclipse target platform, those 3 libraries are easier to maintain by fetching them directly from maven and letting Eclipse PDE automatically wrap them into OSGi bundles. With that change in place, updating the external libraries is as easy as changing the version number in the .target file. Also improve the documentation how to maintain the target platform, required plugins etc.
- Loading branch information
1 parent
538e4a7
commit 99874c2
Showing
10 changed files
with
103 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<?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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"> | ||
<accessrules> | ||
<accessrule kind="accessible" pattern="com/puppycrawl/tools/checkstyle/meta/**"/> | ||
</accessrules> | ||
</classpathentry> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry exported="true" kind="lib" path="lib/dom4j-2.1.3.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/snakeyaml-1.33.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/javassist-3.28.0-GA.jar"/> | ||
<classpathentry kind="lib" path="lib/checkstyle-10.4-all.jar"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?pde?> | ||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> | ||
<target name="Eclipse Checkstyle (Eclipse Plugins)" sequenceNumber="1668583180"> | ||
<locations> | ||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> | ||
<unit id="org.eclipse.jdt.feature.group" version="3.18.500.v20200902-1800"/> | ||
<unit id="org.eclipse.sdk.ide" version="4.17.0.I20200902-1800"/> | ||
<unit id="org.eclipse.emf.feature.group" version="2.23.0.v20200822-0801"/> | ||
<repository location="https://download.eclipse.org/releases/2020-09/202009161000/"/> | ||
</location> | ||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> | ||
<unit id="org.junit.jupiter.api" version="5.6.0.v20200203-2009"/> | ||
<unit id="org.junit.jupiter.engine" version="5.6.0.v20200203-2009"/> | ||
<unit id="org.junit.jupiter.params" version="5.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.commons" version="1.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.engine" version="1.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.launcher" version="1.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.runner" version="1.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.suite.api" version="1.6.0.v20200203-2009"/> | ||
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20200831200620/repository"/> | ||
</location> | ||
</locations> | ||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> | ||
</target> |
2 changes: 1 addition & 1 deletion
2
...ipsecs.target/net.sf.eclipsecs.target.tpd → ...psecs.target/net.sf.eclipsecs.partial.tpd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?pde?> | ||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> | ||
<target name="Eclipse Checkstyle" sequenceNumber="1653761205"> | ||
<locations> | ||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> | ||
<unit id="org.eclipse.jdt.feature.group" version="3.18.500.v20200902-1800"/> | ||
<unit id="org.eclipse.sdk.ide" version="4.17.0.I20200902-1800"/> | ||
<unit id="org.eclipse.emf.feature.group" version="2.23.0.v20200822-0801"/> | ||
<repository location="https://download.eclipse.org/releases/2020-09/202009161000/"/> | ||
</location> | ||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> | ||
<unit id="org.junit.jupiter.api" version="5.6.0.v20200203-2009"/> | ||
<unit id="org.junit.jupiter.engine" version="5.6.0.v20200203-2009"/> | ||
<unit id="org.junit.jupiter.params" version="5.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.commons" version="1.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.engine" version="1.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.launcher" version="1.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.runner" version="1.6.0.v20200203-2009"/> | ||
<unit id="org.junit.platform.suite.api" version="1.6.0.v20200203-2009"/> | ||
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20200831200620/repository"/> | ||
</location> | ||
</locations> | ||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> | ||
</target> | ||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> | ||
<locations> | ||
<location type="Target" uri="file:${project_loc:/net.sf.eclipsecs.core}/../net.sf.eclipsecs.target/net.sf.eclipsecs.partial.target"/> | ||
<location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="generate" type="Maven"> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.dom4j</groupId> | ||
<artifactId>dom4j</artifactId> | ||
<version>2.1.3</version> | ||
<type>jar</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.javassist</groupId> | ||
<artifactId>javassist</artifactId> | ||
<version>3.29.2-GA</version> | ||
<type>jar</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.yaml</groupId> | ||
<artifactId>snakeyaml</artifactId> | ||
<version>1.33</version> | ||
<type>jar</type> | ||
</dependency> | ||
</dependencies> | ||
</location> | ||
</locations> | ||
</target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,54 @@ | ||
## What's this? | ||
|
||
The .target file describes the minimum eclipse environment that eclipse-cs runs in. | ||
The `.target` file describes the minimum Eclipse environment that eclipse-cs runs in. | ||
Right now that is 2020-09 (since that is the first version officially running on Java 11). | ||
|
||
|
||
## Preconditions for development | ||
|
||
To use the target platform, these plugins must be installed in your Eclipse IDE: | ||
* [Eclipse M2E](https://marketplace.eclipse.org/content/eclipse-m2e-maven-support-eclipse-ide) | ||
* [Target Platform DSL](https://github.com/eclipse-cbi/targetplatform-dsl) | ||
|
||
|
||
## How to use the target platform | ||
|
||
In the Maven build it is used automatically for compilation | ||
(see target-platform-configuration section in the parent POM). | ||
|
||
For development in Eclipse you have to load it manually, but only one time: | ||
Open the .target file and use the "Set As Active Target" hyperlink. This may take | ||
a while the first time, since plugins are loaded from the Internet. | ||
For development in Eclipse you have to load it manually, but only after it has been modified. | ||
Open the `net.sf.eclipsecs.target.target` file and use the "Set As Active Target" hyperlink. | ||
This may take a while the first time, since plugins are loaded from the Internet. | ||
|
||
If you don't do that, the compilation happens against the Eclipse plugins of your IDE | ||
and you may call methods that don't exist in earlier versions, | ||
which will lead to runtime errors for end users that are still on an old Eclipse version. | ||
|
||
If you don't do that, the compilation happens against the eclipse plugins of | ||
your IDE and you may call methods that don't exist in earlier versions, which | ||
will lead to runtime errors for end users. | ||
|
||
## How to update the target platform | ||
|
||
Target files are hard to maintain manually. Therefore we use a custom DSL to | ||
maintain the target platform, and to derive the .target file. | ||
Target files are hard to maintain manually. | ||
Therefore we use a custom DSL to maintain most of the target platform, and to derive the `.target` file. | ||
However, that DSL based generation is not possible for the part of the target platform that shall include Maven coordinates. | ||
That's why the target platform is split over 2 files. | ||
The root target platform contains only the Maven coordinates and can be edited manually. | ||
It also includes a nested target file, which is generated from the target platform DSL. | ||
While that structure may look confusing at first glance, it simplifies the actual editing a lot, | ||
because you either only edit Maven coordinates or entries in the `.tpd`file. | ||
|
||
### Eclipse plugins | ||
|
||
Edit the `net.sf.eclipsecs.partial.tpd` file (note the _partial_ in the name). | ||
After saving use the context menu of the .tpd file to create a new version of the `net.sf.eclipsecs.partial.target` file. | ||
|
||
### Maven libraries | ||
|
||
Meanwhile Eclipse PDE and Tycho can also use Maven libraries directly in the target platform | ||
(by automatically wrapping them into a generated OSGi bundle). | ||
Those libraries are contained in `net.sf.eclipsecs.target.target`. | ||
You can open that with a text editor and edit the Maven coordinates like in a `pom.xml`. | ||
|
||
|
||
Install https://github.com/eclipse-cbi/targetplatform-dsl to edit the .tpd | ||
file. After saving use the context menu of the .tpd file to create a new | ||
version of the .target file. | ||
## Committing changes | ||
|
||
Both the .target and .tpd files must be checked in after changes. | ||
Both the `.target` and `.tpd` files must be checked in after changes. |