Skip to content

Commit b4f56be

Browse files
committed
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.
1 parent 753930c commit b4f56be

4 files changed

Lines changed: 24 additions & 31 deletions

File tree

eclipse_plugin/META-INF/MANIFEST.MF

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ Bundle-ManifestVersion: 2
33
Bundle-Name: google-java-format
44
Bundle-SymbolicName: google-java-format-eclipse-plugin;singleton:=true
55
Bundle-Vendor: Google
6-
Bundle-Version: 1.9.0
6+
Bundle-Version: 1.11.0
77
Bundle-RequiredExecutionEnvironment: JavaSE-11
88
Require-Bundle: org.eclipse.jdt.core;bundle-version="3.10.0",
99
org.eclipse.jface,
1010
org.eclipse.text,
1111
org.eclipse.ui,
1212
org.eclipse.equinox.common
1313
Bundle-ClassPath: .,
14-
lib/guava-30.1.1-jre.jar,
15-
lib/google-java-format-1.9.jar
14+
lib/guava.jar,
15+
lib/google-java-format.jar

eclipse_plugin/README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ See https://github.com/google/google-java-format#eclipse
88

99
### Prerequisites
1010

11-
Make sure that the `build.properties` and `META-INF/MANIFEST.MF` contain all
12-
necessary dependencies for the build. Furthermore, make sure that the
13-
dependencies declared in the `pom.xml` match the entries in `build.properties`
14-
and `META-INF/MANIFEST.MF`.
15-
16-
If the used google java format core version is a 'SNAPSHOT' release, the version
17-
for the Eclipse plugin in the `pom.xml` must end in '-SNAPSHOT' as well and the
18-
bundle version specified in `META-INF/MANIFEST.MF` must end in '.qualifier'.
11+
Before building the plugin, make sure to run `mvn tycho-versions:update-eclipse-metadata` to update
12+
the bundle version in `META-INF/MANIFEST.MF`.
1913

2014
### Building the Plugin
2115

@@ -39,9 +33,8 @@ information on this issue is given
3933
#### Building against a local (snapshot) release of the core
4034

4135
With the current build setup, the Eclipse plugin build pulls the needed build
42-
artifacts of the google java format core specified in the property
43-
`google-java-format.version` and copies it into the `eclipse_plugin/lib/`
44-
directory.
36+
artifacts of the google java format core from the maven repository and copies
37+
it into the `eclipse_plugin/lib/` directory.
4538

4639
If you instead want to build against a local (snapshot) build of the core which
4740
is not available in a maven repository (local or otherwise), you will have to

eclipse_plugin/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ output.. = target/classes
33
bin.includes = META-INF/,\
44
.,\
55
plugin.xml,\
6-
lib/guava-30.1.1-jre.jar,\
7-
lib/google-java-format-1.9.jar
6+
lib/guava.jar,\
7+
lib/google-java-format.jar

eclipse_plugin/pom.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<groupId>com.google.googlejavaformat</groupId>
2323
<artifactId>google-java-format-eclipse-plugin</artifactId>
2424
<packaging>eclipse-plugin</packaging>
25-
<version>1.9.0</version>
25+
<version>1.11.0</version>
2626

2727
<name>Google Java Format Plugin for Eclipse 4.5+</name>
2828

@@ -32,26 +32,14 @@
3232

3333
<properties>
3434
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
35-
3635
<tycho-version>1.7.0</tycho-version>
37-
38-
<!-- specific library versions; must match declarations in build.properties and META-INF/MANIFEST.MF -->
39-
<google-java-format.version>1.9</google-java-format.version>
40-
<guava.version>30.1.1-jre</guava.version>
4136
</properties>
4237

4338
<dependencies>
4439
<dependency>
4540
<groupId>com.google.googlejavaformat</groupId>
4641
<artifactId>google-java-format</artifactId>
47-
<version>${google-java-format.version}</version>
48-
<type>jar</type>
49-
</dependency>
50-
<dependency>
51-
<groupId>com.google.guava</groupId>
52-
<artifactId>guava</artifactId>
53-
<version>${guava.version}</version>
54-
<type>jar</type>
42+
<version>${project.version}</version>
5543
</dependency>
5644
</dependencies>
5745

@@ -81,8 +69,10 @@
8169
<configuration>
8270
<outputDirectory>lib</outputDirectory>
8371
<includeScope>runtime</includeScope>
84-
<excludeTransitive>true</excludeTransitive>
72+
<stripVersion>true</stripVersion>
73+
<overWriteReleases>true</overWriteReleases>
8574
<overWriteSnapshots>true</overWriteSnapshots>
75+
<includeArtifactIds>guava,google-java-format</includeArtifactIds>
8676
</configuration>
8777
</plugin>
8878

@@ -92,6 +82,16 @@
9282
<version>${tycho-version}</version>
9383
<extensions>true</extensions>
9484
</plugin>
85+
86+
<plugin>
87+
<groupId>org.eclipse.tycho</groupId>
88+
<artifactId>tycho-versions-plugin</artifactId>
89+
<version>${tycho-version}</version>
90+
<configuration>
91+
<newVersion>${project.version}</newVersion>
92+
</configuration>
93+
</plugin>
94+
9595
<plugin>
9696
<groupId>org.eclipse.tycho</groupId>
9797
<artifactId>target-platform-configuration</artifactId>

0 commit comments

Comments
 (0)