-
Notifications
You must be signed in to change notification settings - Fork 853
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the Eclipse plugin build logic. The logic is now completely separate from the main google java format build. Instead of relying on the build artifacts of the core build, the needed google-java-format and guava build artifacts used for the build are now pulled from maven. Updates google-java-format version used for the build to '1.9', the build JDK to 11, and removes old dependencies which are no longer used. Updates tycho version to 1.7.0 in order to build with JDK > 8. Updates the build guide in the README. Fixes #465 COPYBARA_INTEGRATE_REVIEW=#465 from tobous:fix-eclipse-build e80a72b PiperOrigin-RevId: 387615841
- Loading branch information
Showing
6 changed files
with
109 additions
and
93 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
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,26 +1,49 @@ | ||
# google-java-format Eclipse Plugin | ||
# Google Java Format Eclipse Plugin | ||
|
||
## Enabling | ||
|
||
See https://github.com/google/google-java-format#eclipse | ||
|
||
## Development | ||
|
||
1) Uncomment `<module>eclipse_plugin</module>` in the parent `pom.xml` | ||
|
||
2) Run `mvn install`, which will copy the dependences of the plugin to | ||
`eclipse_plugin/lib`. | ||
|
||
2) If you are using Java 9, add | ||
|
||
``` | ||
-vm | ||
/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/java | ||
``` | ||
|
||
to `/Applications/Eclipse.app/Contents/Eclipse/eclipse.ini`. | ||
|
||
3) Open the `eclipse_plugin` project in a recent Eclipse SDK build. | ||
|
||
4) From `File > Export` select `Plugin-in Development > Deployable plugin-ins | ||
and fragments` and follow the wizard to export a plugin jar. | ||
### Prerequisites | ||
|
||
Make sure that the `build.properties` and `META-INF/MANIFEST.MF` contain all | ||
necessary dependencies for the build. Furthermore, make sure that the | ||
dependencies declared in the `pom.xml` match the entries in `build.properties` | ||
and `META-INF/MANIFEST.MF`. | ||
|
||
If the used google java format core version is a 'SNAPSHOT' release, the version | ||
for the Eclipse plugin in the `pom.xml` must end in '-SNAPSHOT' as well and the | ||
bundle version specified in `META-INF/MANIFEST.MF` must end in '.qualifier'. | ||
|
||
### Building the Plugin | ||
|
||
1) Run `mvn clean package` in the `eclipse_plugin` directory. This will first copy the dependencies | ||
of the plugin to `eclipse_plugin/lib/` and then triggers the tycho build that uses these | ||
dependencies (as declared in `build.properties`) for the actual Eclipse plugin build.<br><br> | ||
If you also want to add the build artifact to the local maven repository, you can use | ||
`mvn clean install -Dtycho.localArtifacts=ignore` instead. Note, however, that you then must use | ||
this build command for every build with that specific version number until you clear the build | ||
artifact (or the | ||
[p2-local-metadata.properties](https://wiki.eclipse.org/Tycho/Target_Platform#Locally_built_artifacts)) | ||
from your local repository. Otherwise, you might run into issues caused by the build using an | ||
outdated build artifact created by a previous build instead of re-building the plugin. More | ||
information on this issue is given | ||
[in this thread](https://www.eclipse.org/lists/tycho-user/msg00952.html) and | ||
[this bug tracker entry](https://bugs.eclipse.org/bugs/show_bug.cgi?id=355367). | ||
|
||
2) You can find the built plugin in | ||
`eclipse_plugin/target/google-java-format-eclipse-plugin-<version>.jar` | ||
|
||
#### Building against a local (snapshot) release of the core | ||
|
||
With the current build setup, the Eclipse plugin build pulls the needed build | ||
artifacts of the google java format core specified in the property | ||
`google-java-format.version` and copies it into the `eclipse_plugin/lib/` | ||
directory. | ||
|
||
If you instead want to build against a local (snapshot) build of the core which | ||
is not available in a maven repository (local or otherwise), you will have to | ||
place the appropriate version into the `eclipse_plugin/lib/` directory yourself | ||
before the build. |
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
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