-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infra: convert nested libs to wrapped OSGi bundles #406
Merged
Bananeweizen
merged 2 commits into
checkstyle:master
from
Bananeweizen:convert_libs_to_plugins
Nov 18, 2022
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. | ||
Bananeweizen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### 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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use a "partial" target file here just for code organization / clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The Maven part of the target must be edited manually, and the remaining Eclipse part can be generated. However, you cannot have the generation and the manual editing in one target file, therefore the generated part is included as "partial". If you think there is a better name for more clarity ("generated" instead?), I'll happily accept every suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, partial sounds good to me. I'm just trying to make sure I understand.
We could take this a step further and make another partial for the maven libs, and the main target file would just be an aggregate of partials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be fine with that, too. At work, I use exactly such a 3 target files setup. I wasn't sure if I confuse people even more if I go from 1 to 3 here. :)