Permalink
Browse files

[deps][bug 401285] use package-import to depend on guava

Xtext and Xtend should use Package-Import declarations to depend on
Guava rather than Require-Bundle declarations. The reason for this is
that the user may want to use a different bundle than the standard
com.google.guava bundle; e.g. com.google.guava.jdk5.

Also Xtext and Xtend should when possible omit the version qualifier
from the dependencies on Guava. The reason being that if Xtext depends
upon a specific Guava version, e.g. version="10.0.1", then users would
not really be able to use any other Guava version, since the major
version is incremented with every release. So if a specific minimum
version of Guava is required it is be best to test against all current
Guava versions and then specify a version range as in e.g.
version="[10.0.1,14.0.0)". These dependencies should
then be updated when new versions of Guava become available.

This change corrects all Xtext and Xtend Guava dependencies and adds
API filters where necessary. Bundle re-exports remain, but are optional.

Change-Id: Iae2140ce606f697d9f5300f39b2e161dd5e02047
  • Loading branch information...
1 parent 238a3b3 commit 09fb0ebc257aad2a3c0dbec1abf5227dbb2b7f31 @knutwannheden knutwannheden committed with Gerrit Code Review @ Eclipse.org Feb 21, 2013
@@ -14,7 +14,6 @@ Require-Bundle: org.eclipse.xpand;bundle-version="1.1.0",
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
de.itemis.xtext.antlr;bundle-version="2.0.0";resolution:=optional;x-installation:=greedy,
com.google.inject;bundle-version="2.0.0",
- com.google.guava;bundle-version="1.0.0",
org.eclipse.xtext.ui;bundle-version="2.0.0",
org.eclipse.emf.mwe.utils;bundle-version="1.0.0",
org.eclipse.emf.mwe2.launch;bundle-version="2.0.0";resolution:=optional;x-installation:=greedy
@@ -16,6 +16,5 @@ Require-Bundle: org.eclipse.xtext.tests;bundle-version="1.0.0",
org.eclipse.xtext.xtext.ui.tests;bundle-version="1.0.0",
org.eclipse.emf.codegen;bundle-version="2.5.0",
org.eclipse.emf.codegen.ecore;bundle-version="2.5.0",
- com.google.guava;bundle-version="1.0.0",
org.eclipse.emf.mwe2.launch;bundle-version="1.0.0";resolution:=optional;x-installation:=greedy
Import-Package: org.apache.log4j;version="1.2.15"
@@ -8,7 +8,6 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.xtext.example.arithmetics;bundle-version="2.0.0",
org.eclipse.emf.ecore;bundle-version="2.5.0",
org.eclipse.xtext.junit4;bundle-version="2.3.0",
- com.google.guava;bundle-version="1.0.0",
com.google.inject;bundle-version="2.0.0",
org.eclipse.xtext;bundle-version="2.0.0",
org.eclipse.xtext.example.arithmetics.ui,
@@ -8,7 +8,6 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.5.0",
org.junit;bundle-version="3.8.2",
org.eclipse.xtext.junit;bundle-version="2.0.0",
- com.google.guava;bundle-version="1.0.0",
com.google.inject;bundle-version="2.0.0",
org.eclipse.xtext;bundle-version="2.0.0",
org.eclipse.xtext.example.css;bundle-version="1.0.0",
@@ -10,5 +10,5 @@ Export-Package: org.eclipse.xtend.lib,
org.eclipse.xtend.lib.macro.declaration,
org.eclipse.xtend.lib.macro.expression,
org.eclipse.xtend.lib.macro.services
-Import-Package: com.google.common.annotations;version="10.0.1"
+Import-Package: com.google.common.annotations
Require-Bundle: org.eclipse.xtext.xbase.lib;bundle-version="2.4.0";visibility:=reexport
@@ -25,7 +25,6 @@ Export-Package: org.eclipse.xtext.builder,
Require-Bundle: org.eclipse.xtext;bundle-version="2.0.0",
org.eclipse.xtext.util;bundle-version="2.0.0",
org.eclipse.emf.ecore;bundle-version="2.5.0";visibility:=reexport,
- com.google.guava;bundle-version="1.0.0",
com.google.inject;bundle-version="2.0.0",
org.eclipse.core.resources;bundle-version="3.5.0";resolution:=optional;x-installation:=greedy,
org.eclipse.jdt.core;bundle-version="3.5.0";resolution:=optional;x-installation:=greedy,
@@ -45,5 +44,8 @@ Require-Bundle: org.eclipse.xtext;bundle-version="2.0.0",
org.eclipse.debug.ui;bundle-version="3.5.0";resolution:=optional;visibility:=reexport;x-installation:=greedy,
org.eclipse.jdt.debug;bundle-version="3.5.0";resolution:=optional;x-installation:=greedy
Bundle-ActivationPolicy: lazy
-Import-Package: org.apache.log4j;version="1.2.15"
+Import-Package: com.google.common.base,
+ com.google.common.collect,
+ com.google.common.io,
+ org.apache.log4j;version="1.2.15"
Bundle-Activator: org.eclipse.xtext.builder.internal.Activator
@@ -7,5 +7,11 @@
<message_argument value="2.2.1"/>
</message_arguments>
</filter>
+ <filter id="927989779">
+ <message_arguments>
+ <message_argument value="2.4.0"/>
+ <message_argument value="com.google.guava"/>
+ </message_arguments>
+ </filter>
</resource>
</component>
@@ -11,8 +11,10 @@ Export-Package: org.eclipse.xtext.util,
org.eclipse.xtext.util.formallang;x-internal:=true,
org.eclipse.xtext.util.internal;x-internal:=true
Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.3.2",
- com.google.guava;bundle-version="10.0.1";resolution:=optional;x-installation:=greedy;visibility:=reexport,
- com.google.inject;bundle-version="2.0.0";resolution:=optional;x-installation:=greedy;visibility:=reexport,
- javax.inject;bundle-version="1.0.0";resolution:=optional;x-installation:=greedy;visibility:=reexport,
+ com.google.guava;resolution:=optional;visibility:=reexport;x-installation:=greedy,
+ com.google.inject;bundle-version="2.0.0";resolution:=optional;visibility:=reexport;x-installation:=greedy,
+ javax.inject;bundle-version="1.0.0";resolution:=optional;visibility:=reexport;x-installation:=greedy,
org.eclipse.jdt.annotation;bundle-version="1.0.0";resolution:=optional;x-installation:=greedy
-Import-Package: org.apache.log4j;version="1.2.15"
+Import-Package: com.google.common.base,
+ com.google.common.collect,
+ org.apache.log4j;version="1.2.15"
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.xtext.xbase.junit" version="2">
+ <resource path="META-INF/MANIFEST.MF">
+ <filter id="927989779">
+ <message_arguments>
+ <message_argument value="2.4.0"/>
+ <message_argument value="com.google.guava"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
@@ -5,7 +5,7 @@ Bundle-Version: 2.4.0.qualifier
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.xtext.xbase.lib;bundle-version="2.0.0";visibility:=reexport,
- com.google.guava;bundle-version="1.0.0";visibility:=reexport,
+ com.google.guava;resolution:=optional;visibility:=reexport,
com.google.inject;bundle-version="2.0.0";visibility:=reexport,
org.eclipse.core.resources;bundle-version="3.5.0";resolution:=optional;visibility:=reexport;x-installation:=greedy,
org.eclipse.emf.ecore;bundle-version="2.5.0";resolution:=optional;visibility:=reexport;x-installation:=greedy,
@@ -27,5 +27,9 @@ Export-Package: org.eclipse.xtext.xbase.compiler;x-internal:=true,
testdata.ordersensitivity
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
-Import-Package: org.apache.log4j;version="1.2.15",
+Import-Package: com.google.common.annotations,
+ com.google.common.base,
+ com.google.common.collect,
+ com.google.common.primitives,
+ org.apache.log4j;version="1.2.15",
org.junit;version="[4.0.0,5.0.0)"
@@ -6,5 +6,6 @@ Bundle-Version: 2.4.0.qualifier
Export-Package: org.eclipse.xtend2.lib,
org.eclipse.xtext.xbase.lib
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: com.google.guava;bundle-version="10.0.1"
-
+Import-Package: com.google.common.annotations,
+ com.google.common.base,
+ com.google.common.collect
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.xtext.xbase.lib" version="2">
+ <resource path="META-INF/MANIFEST.MF">
+ <filter id="923795461">
+ <message_arguments>
+ <message_argument value="2.4.0"/>
+ <message_argument value="2.3.0"/>
+ </message_arguments>
+ </filter>
+ <filter id="927989779">
+ <message_arguments>
+ <message_argument value="2.4.0"/>
+ <message_argument value="com.google.guava"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
@@ -8,5 +8,9 @@ Export-Package: org.eclipse.xtend2.lib,
org.eclipse.xtext.xbase.lib,
org.eclipse.xtext.xbase.lib.internal;x-internal:=true,
org.eclipse.xtext.xbase.lib.util
-Require-Bundle: com.google.guava;visibility:=reexport;bundle-version="10.0.1"
+Require-Bundle: com.google.guava;resolution:=optional;visibility:=reexport
Bundle-Vendor: Eclipse Modeling Project
+Import-Package: com.google.common.annotations,
+ com.google.common.base,
+ com.google.common.collect,
+ com.google.common.primitives
@@ -5,7 +5,6 @@ Bundle-SymbolicName: xtext.website.generator
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.xtend.lib;bundle-version="2.3.0",
- com.google.guava,
org.eclipse.xtext.xbase.lib,
org.eclipse.xtend.bootstrapdoc;bundle-version="1.0.0",
org.eclipse.xtext.xdoc;bundle-version="0.1.0",
@@ -14,3 +13,6 @@ Require-Bundle: org.eclipse.xtend.lib;bundle-version="2.3.0",
org.eclipse.xtend.core;bundle-version="2.3.0"
Export-Package: generator,
xdocgen
+Import-Package: com.google.common.base,
+ com.google.common.collect,
+ com.google.common.io

0 comments on commit 09fb0eb

Please sign in to comment.