|
1 | 1 | ## What's this? |
2 | 2 |
|
3 | | -The .target file describes the minimum eclipse environment that eclipse-cs runs in. |
| 3 | +The `.target` file describes the minimum Eclipse environment that eclipse-cs runs in. |
| 4 | +Right now that is 2020-09 (since that is the first version officially running on Java 11). |
| 5 | + |
| 6 | + |
| 7 | +## Preconditions for development |
| 8 | + |
| 9 | +To use the target platform, these plugins must be installed in your Eclipse IDE: |
| 10 | +* [Eclipse M2E](https://marketplace.eclipse.org/content/eclipse-m2e-maven-support-eclipse-ide) |
| 11 | +* [Target Platform DSL](https://github.com/eclipse-cbi/targetplatform-dsl) |
| 12 | + |
4 | 13 |
|
5 | 14 | ## How to use the target platform |
6 | 15 |
|
7 | 16 | In the Maven build it is used automatically for compilation |
8 | 17 | (see target-platform-configuration section in the parent POM). |
9 | 18 |
|
10 | | -For development in Eclipse you have to load it manually, but only one time: |
11 | | -Open the .target file and use the "Set As Active Target" hyperlink. This may take |
12 | | -a while the first time, since plugins are loaded from the Internet. |
| 19 | +For development in Eclipse you have to load it manually, but only after it has been modified. |
| 20 | +Open the `net.sf.eclipsecs.target.target` file and use the "Set As Active Target" hyperlink. |
| 21 | +This may take a while the first time, since plugins are loaded from the Internet. |
| 22 | + |
| 23 | +If you don't do that, the compilation happens against the Eclipse plugins of your IDE |
| 24 | +and you may call methods that don't exist in earlier versions, |
| 25 | +which will lead to runtime errors for end users that are still on an old Eclipse version. |
13 | 26 |
|
14 | | -If you don't do that, the compilation happens against the eclipse plugins of |
15 | | -your IDE and you may call methods that don't exist in earlier versions, which |
16 | | -will lead to runtime errors for end users. |
17 | 27 |
|
18 | 28 | ## How to update the target platform |
19 | 29 |
|
20 | | -Target files are hard to maintain manually. Therefore we use a custom DSL to |
21 | | -maintain the target platform, and to derive the .target file. |
| 30 | +Target files are hard to maintain manually. |
| 31 | +Therefore we use a custom DSL to maintain most of the target platform, and to derive the `.target` file. |
| 32 | +However, that DSL based generation is not possible for the part of the target platform that shall include Maven coordinates. |
| 33 | +That's why the target platform is split over 2 files. |
| 34 | +The root target platform contains only the Maven coordinates and can be edited manually. |
| 35 | +It also includes a nested target file, which is generated from the target platform DSL. |
| 36 | +While that structure may look confusing at first glance, it simplifies the actual editing a lot, |
| 37 | +because you either only edit Maven coordinates or entries in the `.tpd`file. |
| 38 | + |
| 39 | +### Eclipse plugins |
| 40 | + |
| 41 | +Edit the `net.sf.eclipsecs.partial.tpd` file (note the _partial_ in the name). |
| 42 | +After saving use the context menu of the .tpd file to create a new version of the `net.sf.eclipsecs.partial.target` file. |
| 43 | + |
| 44 | +### Maven libraries |
| 45 | + |
| 46 | +Meanwhile Eclipse PDE and Tycho can also use Maven libraries directly in the target platform |
| 47 | +(by automatically wrapping them into a generated OSGi bundle). |
| 48 | +Those libraries are contained in `net.sf.eclipsecs.target.target`. |
| 49 | +You can open that with a text editor and edit the Maven coordinates like in a `pom.xml`. |
| 50 | + |
22 | 51 |
|
23 | | -Install https://github.com/eclipse-cbi/targetplatform-dsl to edit the .tpd |
24 | | -file. After saving use the context menu of the .tpd file to create a new |
25 | | -version of the .target file. |
| 52 | +## Committing changes |
26 | 53 |
|
27 | | -Both the .target and .tpd files must be checked in after changes. |
| 54 | +Both the `.target` and `.tpd` files must be checked in after changes. |
0 commit comments