From 184a5adc4774ae636f6dab4859490753d3d2ae0a Mon Sep 17 00:00:00 2001 From: Amit Mendapara Date: Fri, 30 Jul 2021 09:15:45 -0700 Subject: [PATCH] Improve version handling for eclipse plugin Use same versions for plugin as google-java-format and strip versions from copied jar to avoid updating build.properties and MANIFEST.MF. Fixes #635 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/google-java-format/pull/635 from cristatus:eclipse-plugin b4f56be226c67375491bf40fb032e139923fe56f PiperOrigin-RevId: 387819617 --- eclipse_plugin/META-INF/MANIFEST.MF | 6 +++--- eclipse_plugin/README.md | 16 +++++---------- eclipse_plugin/build.properties | 4 ++-- eclipse_plugin/pom.xml | 30 ++++++++++++++--------------- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/eclipse_plugin/META-INF/MANIFEST.MF b/eclipse_plugin/META-INF/MANIFEST.MF index b5583d602..34b1e8c88 100644 --- a/eclipse_plugin/META-INF/MANIFEST.MF +++ b/eclipse_plugin/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: google-java-format Bundle-SymbolicName: google-java-format-eclipse-plugin;singleton:=true Bundle-Vendor: Google -Bundle-Version: 1.9.0 +Bundle-Version: 1.11.0 Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.jdt.core;bundle-version="3.10.0", org.eclipse.jface, @@ -11,5 +11,5 @@ Require-Bundle: org.eclipse.jdt.core;bundle-version="3.10.0", org.eclipse.ui, org.eclipse.equinox.common Bundle-ClassPath: ., - lib/guava-30.1.1-jre.jar, - lib/google-java-format-1.9.jar + lib/guava.jar, + lib/google-java-format.jar diff --git a/eclipse_plugin/README.md b/eclipse_plugin/README.md index a45b46538..395a368dc 100644 --- a/eclipse_plugin/README.md +++ b/eclipse_plugin/README.md @@ -8,14 +8,9 @@ See https://github.com/google/google-java-format#eclipse ### 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'. +Before building the plugin, make sure to run `mvn +tycho-versions:update-eclipse-metadata` to update the bundle version in +`META-INF/MANIFEST.MF`. ### Building the Plugin @@ -39,9 +34,8 @@ information on this issue is given #### 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. +artifacts of the google java format core from the maven repository 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 diff --git a/eclipse_plugin/build.properties b/eclipse_plugin/build.properties index de8466a3f..dd1d835c5 100644 --- a/eclipse_plugin/build.properties +++ b/eclipse_plugin/build.properties @@ -3,5 +3,5 @@ output.. = target/classes bin.includes = META-INF/,\ .,\ plugin.xml,\ - lib/guava-30.1.1-jre.jar,\ - lib/google-java-format-1.9.jar + lib/guava.jar,\ + lib/google-java-format.jar diff --git a/eclipse_plugin/pom.xml b/eclipse_plugin/pom.xml index 600810687..6b49c901a 100644 --- a/eclipse_plugin/pom.xml +++ b/eclipse_plugin/pom.xml @@ -22,7 +22,7 @@ com.google.googlejavaformat google-java-format-eclipse-plugin eclipse-plugin - 1.9.0 + 1.11.0 Google Java Format Plugin for Eclipse 4.5+ @@ -32,26 +32,14 @@ UTF-8 - 1.7.0 - - - 1.9 - 30.1.1-jre com.google.googlejavaformat google-java-format - ${google-java-format.version} - jar - - - com.google.guava - guava - ${guava.version} - jar + ${project.version} @@ -81,8 +69,10 @@ lib runtime - true + true + true true + guava,google-java-format @@ -92,6 +82,16 @@ ${tycho-version} true + + + org.eclipse.tycho + tycho-versions-plugin + ${tycho-version} + + ${project.version} + + + org.eclipse.tycho target-platform-configuration