Latest bnd code
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1350613 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/AnalyzerPlugin.java b/bundleplugin/src/main/java/aQute/bnd/service/AnalyzerPlugin.java
index 3efe8ee..1a5b19a 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/AnalyzerPlugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/AnalyzerPlugin.java
@@ -4,17 +4,17 @@
public interface AnalyzerPlugin {
- /**
- * This plugin is called after analysis. The plugin is free to modify the
- * jar and/or change the classpath information (see referred, contained).
- * This plugin is called after analysis of the JAR but before manifest
- * generation.
- *
- * @param analyzer
- * @return true if the classpace has been modified so that the bundle
- * classpath must be reanalyzed
- * @throws Exception
- */
+ /**
+ * This plugin is called after analysis. The plugin is free to modify the
+ * jar and/or change the classpath information (see referred, contained).
+ * This plugin is called after analysis of the JAR but before manifest
+ * generation.
+ *
+ * @param analyzer
+ * @return true if the classpace has been modified so that the bundle
+ * classpath must be reanalyzed
+ * @throws Exception
+ */
- boolean analyzeJar(Analyzer analyzer) throws Exception;
+ boolean analyzeJar(Analyzer analyzer) throws Exception;
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java b/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java
index e937110..6335697 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java
@@ -6,18 +6,23 @@
import aQute.libg.reporter.*;
public class BndListener {
- final AtomicInteger inside = new AtomicInteger();
-
- public void changed(File file) {
- }
- public void begin() { inside.incrementAndGet();}
- public void end() { inside.decrementAndGet(); }
-
- public boolean isInside() {
- return inside.get()!=0;
- }
-
- public void signal(Reporter reporter) {
-
- }
+ final AtomicInteger inside = new AtomicInteger();
+
+ public void changed(File file) {}
+
+ public void begin() {
+ inside.incrementAndGet();
+ }
+
+ public void end() {
+ inside.decrementAndGet();
+ }
+
+ public boolean isInside() {
+ return inside.get() != 0;
+ }
+
+ public void signal(Reporter reporter) {
+
+ }
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/CommandPlugin.java b/bundleplugin/src/main/java/aQute/bnd/service/CommandPlugin.java
index 34c72c2..9511637 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/CommandPlugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/CommandPlugin.java
@@ -3,28 +3,30 @@
import aQute.bnd.build.*;
/**
- * A plugin that makes it possible to
+ * A plugin that makes it possible to
+ *
* @author aqute
- *
*/
public interface CommandPlugin {
- /**
- * Is run before a command is executed. These plugins are called
- * in the order of declaration.
- *
- * @param project The project for which the command runs
- *
- * @param command the command name
- */
- void before(Project project, String command);
-
- /**
- * Is run after a command is executed. These plugins are
- * called in the reverse order of declaration.
- *
- * @param project The project for which the command runs
- *
- * @param command the command name
- */
- void after(Project project, String command, Throwable outcome);
+ /**
+ * Is run before a command is executed. These plugins are called in the
+ * order of declaration.
+ *
+ * @param project
+ * The project for which the command runs
+ * @param command
+ * the command name
+ */
+ void before(Project project, String command);
+
+ /**
+ * Is run after a command is executed. These plugins are called in the
+ * reverse order of declaration.
+ *
+ * @param project
+ * The project for which the command runs
+ * @param command
+ * the command name
+ */
+ void after(Project project, String command, Throwable outcome);
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/Compiler.java b/bundleplugin/src/main/java/aQute/bnd/service/Compiler.java
index 626b68c..a57fa5f 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/Compiler.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/Compiler.java
@@ -6,6 +6,6 @@
import aQute.bnd.build.*;
public interface Compiler {
- boolean compile(Project project, Collection<File> sources, Collection<Container> buildpath,
- File bin) throws Exception;
+ boolean compile(Project project, Collection<File> sources, Collection<Container> buildpath, File bin)
+ throws Exception;
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/DependencyContributor.java b/bundleplugin/src/main/java/aQute/bnd/service/DependencyContributor.java
index e6a88ff..1fb073b 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/DependencyContributor.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/DependencyContributor.java
@@ -5,5 +5,5 @@
import aQute.bnd.build.*;
public interface DependencyContributor {
- void addDependencies(Project project, Set<String> dependencies);
+ void addDependencies(Project project, Set<String> dependencies);
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/Deploy.java b/bundleplugin/src/main/java/aQute/bnd/service/Deploy.java
index e1d92e1..c2f2b61 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/Deploy.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/Deploy.java
@@ -5,8 +5,7 @@
/**
* Deploy this artifact to maven.
- *
*/
-public interface Deploy {
+public interface Deploy {
boolean deploy(Project project, Jar jar) throws Exception;
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/EclipseJUnitTester.java b/bundleplugin/src/main/java/aQute/bnd/service/EclipseJUnitTester.java
index a2af9b0..f5e4174 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/EclipseJUnitTester.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/EclipseJUnitTester.java
@@ -2,5 +2,6 @@
public interface EclipseJUnitTester {
void setPort(int port);
- void setHost( String host);
+
+ void setHost(String host);
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/IndexProvider.java b/bundleplugin/src/main/java/aQute/bnd/service/IndexProvider.java
index 5454c2d..9805f8b 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/IndexProvider.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/IndexProvider.java
@@ -1,12 +1,11 @@
package aQute.bnd.service;
-import java.net.URL;
-import java.util.List;
-import java.util.Set;
+import java.net.*;
+import java.util.*;
public interface IndexProvider {
- List<URL> getIndexLocations() throws Exception;
+ List<URI> getIndexLocations() throws Exception;
Set<ResolutionPhase> getSupportedPhases();
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/MakePlugin.java b/bundleplugin/src/main/java/aQute/bnd/service/MakePlugin.java
index 20a1849..2e564e5 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/MakePlugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/MakePlugin.java
@@ -6,16 +6,19 @@
public interface MakePlugin {
- /**
- * This plugin is called when Include-Resource detects a reference to a resource
- * that it can not find in the file system.
- *
- * @param builder The current builder
- * @param source The source string (i.e. the place where bnd looked)
- * @param arguments Any arguments on the clause in Include-Resource
- * @return A resource or null if no resource could be made
- * @throws Exception
- */
- Resource make(Builder builder, String source, Map<String,String> arguments) throws Exception;
+ /**
+ * This plugin is called when Include-Resource detects a reference to a
+ * resource that it can not find in the file system.
+ *
+ * @param builder
+ * The current builder
+ * @param source
+ * The source string (i.e. the place where bnd looked)
+ * @param arguments
+ * Any arguments on the clause in Include-Resource
+ * @return A resource or null if no resource could be made
+ * @throws Exception
+ */
+ Resource make(Builder builder, String source, Map<String,String> arguments) throws Exception;
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/Plugin.java b/bundleplugin/src/main/java/aQute/bnd/service/Plugin.java
index 065fac8..6b5bfcf 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/Plugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/Plugin.java
@@ -8,24 +8,23 @@
* An optional interface for plugins. If a plugin implements this interface then
* it can receive the reminaing attributes and directives given in its clause as
* well as the reporter to use.
- *
*/
public interface Plugin {
- /**
- * Give the plugin the remaining properties.
- *
- * When a plugin is declared, the clause can contain extra properties.
- * All the properties and directives are given to the plugin to use.
- *
- * @param map attributes and directives for this plugin's clause
- */
- void setProperties(Map<String,String> map);
-
- /**
- * Set the current reporter. This is called at init time. This plugin
- * should report all errors and warnings to this reporter.
- *
- * @param processor
- */
- void setReporter(Reporter processor);
+ /**
+ * Give the plugin the remaining properties. When a plugin is declared, the
+ * clause can contain extra properties. All the properties and directives
+ * are given to the plugin to use.
+ *
+ * @param map
+ * attributes and directives for this plugin's clause
+ */
+ void setProperties(Map<String,String> map);
+
+ /**
+ * Set the current reporter. This is called at init time. This plugin should
+ * report all errors and warnings to this reporter.
+ *
+ * @param processor
+ */
+ void setReporter(Reporter processor);
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java b/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java
index e5e62e9..aeac258 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java
@@ -3,6 +3,7 @@
import java.io.*;
public interface Refreshable {
- boolean refresh();
- File getRoot();
+ boolean refresh();
+
+ File getRoot();
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/Registry.java b/bundleplugin/src/main/java/aQute/bnd/service/Registry.java
index 90fca36..a55c927 100755
--- a/bundleplugin/src/main/java/aQute/bnd/service/Registry.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/Registry.java
@@ -7,5 +7,6 @@
*/
public interface Registry {
<T> List<T> getPlugins(Class<T> c);
+
<T> T getPlugin(Class<T> c);
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/RegistryPlugin.java b/bundleplugin/src/main/java/aQute/bnd/service/RegistryPlugin.java
index 7a46849..8a80660 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/RegistryPlugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/RegistryPlugin.java
@@ -1,6 +1,5 @@
package aQute.bnd.service;
-
/**
* A plugin that wants a registry
*/
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java b/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java
index e441a4c..8110fab 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java
@@ -5,8 +5,11 @@
public interface RemoteRepositoryPlugin extends RepositoryPlugin {
/**
- * Retrieve a resource handle from the repository. For all implementations of this interface, calling {@code getFile(bsn, range, strategy, props)}
- * should always return the same result as {@code getResource(bsn, range, strategy, props).request()}.
+ * Retrieve a resource handle from the repository. For all implementations
+ * of this interface, calling {@code getFile(bsn, range, strategy, props)}
+ * should always return the same result as
+ * {@code getResource(bsn, range, strategy, props).request()}.
+ *
* @param bsn
* @param range
* @param strategy
@@ -14,7 +17,8 @@
* @return
* @throws Exception
*/
- ResourceHandle getHandle(String bsn, String range, Strategy strategy, Map<String,String> properties) throws Exception;
-
+ ResourceHandle getHandle(String bsn, String range, Strategy strategy, Map<String,String> properties)
+ throws Exception;
+
File getCacheDirectory();
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/RepositoryListenerPlugin.java b/bundleplugin/src/main/java/aQute/bnd/service/RepositoryListenerPlugin.java
index 13899f7..92238ab 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/RepositoryListenerPlugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/RepositoryListenerPlugin.java
@@ -5,9 +5,10 @@
import aQute.lib.osgi.*;
public interface RepositoryListenerPlugin {
-
+
/**
* Called when a bundle is added to a repository.
+ *
* @param repository
* @param jar
* @param file
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java b/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java
index 91b0a7e..c190847 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java
@@ -24,7 +24,8 @@
* @throws Exception
* when anything goes wrong
*/
- @Deprecated File[] get(String bsn, String range) throws Exception;
+ @Deprecated
+ File[] get(String bsn, String range) throws Exception;
/**
* Return a URL to a matching version of the given bundle.
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/ResourceHandle.java b/bundleplugin/src/main/java/aQute/bnd/service/ResourceHandle.java
index be7f79b..42abd9b 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/ResourceHandle.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/ResourceHandle.java
@@ -3,10 +3,14 @@
import java.io.*;
public interface ResourceHandle {
-
- public enum Location { local, remote_cached, remote }
-
+
+ public enum Location {
+ local, remote_cached, remote
+ }
+
String getName();
+
Location getLocation();
+
File request() throws IOException;
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/Scripter.java b/bundleplugin/src/main/java/aQute/bnd/service/Scripter.java
index 2e4e1d3..069590c 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/Scripter.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/Scripter.java
@@ -5,6 +5,6 @@
public interface Scripter {
- void eval(Map<String, Object> x, StringReader stringReader);
+ void eval(Map<String,Object> x, StringReader stringReader);
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/SignerPlugin.java b/bundleplugin/src/main/java/aQute/bnd/service/SignerPlugin.java
index aaef646..b503652 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/SignerPlugin.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/SignerPlugin.java
@@ -3,13 +3,15 @@
import aQute.lib.osgi.*;
public interface SignerPlugin {
- /**
- * Sign the current jar. The alias is the given certificate
- * keystore.
- *
- * @param builder The current builder that contains the jar to sign
- * @param alias The keystore certificate alias
- * @throws Exception When anything goes wrong
- */
- void sign(Builder builder, String alias) throws Exception;
+ /**
+ * Sign the current jar. The alias is the given certificate keystore.
+ *
+ * @param builder
+ * The current builder that contains the jar to sign
+ * @param alias
+ * The keystore certificate alias
+ * @throws Exception
+ * When anything goes wrong
+ */
+ void sign(Builder builder, String alias) throws Exception;
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/action/Action.java b/bundleplugin/src/main/java/aQute/bnd/service/action/Action.java
index 5167827..c74903d 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/action/Action.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/action/Action.java
@@ -3,5 +3,5 @@
import aQute.bnd.build.*;
public interface Action {
- void execute( Project project, String action) throws Exception;
+ void execute(Project project, String action) throws Exception;
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/action/NamedAction.java b/bundleplugin/src/main/java/aQute/bnd/service/action/NamedAction.java
index 5a1c697..7b0c29a 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/action/NamedAction.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/action/NamedAction.java
@@ -1,6 +1,5 @@
package aQute.bnd.service.action;
-
public interface NamedAction extends Action {
- String getName();
+ String getName();
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/diff/Delta.java b/bundleplugin/src/main/java/aQute/bnd/service/diff/Delta.java
index eec4781..5d3aa12 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/diff/Delta.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/diff/Delta.java
@@ -3,7 +3,6 @@
/**
* The Delta provides information about the {@link Diff} object. It tells the
* relation between the newer and older compared elements.
- *
*/
public enum Delta {
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/diff/Diff.java b/bundleplugin/src/main/java/aQute/bnd/service/diff/Diff.java
index 43bf4e5..bf23eee 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/diff/Diff.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/diff/Diff.java
@@ -6,18 +6,32 @@
interface Ignore {
boolean contains(Diff diff);
}
-
+
+ class Data {
+
+ public Type type;
+ public Delta delta;
+ public String name;
+ public Data[] children;
+ public String comment;
+ }
+
+ Data serialize();
+
Delta getDelta();
+
Delta getDelta(Ignore ignore);
Type getType();
+
String getName();
+
Tree getOlder();
+
Tree getNewer();
- Collection<? extends Diff> getChildren();
-
+ Collection< ? extends Diff> getChildren();
+
Diff get(String name);
-
-
+
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/diff/Differ.java b/bundleplugin/src/main/java/aQute/bnd/service/diff/Differ.java
index 869a237..6d60c82 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/diff/Differ.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/diff/Differ.java
@@ -6,7 +6,8 @@
* Compare two Jars and report the differences.
*/
public interface Differ {
- Tree tree(Analyzer source ) throws Exception;
+ Tree tree(Analyzer source) throws Exception;
+
Tree tree(Jar source) throws Exception;
Tree deserialize(Tree.Data data) throws Exception;
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/diff/Tree.java b/bundleplugin/src/main/java/aQute/bnd/service/diff/Tree.java
index 7072ac1..0b61f86 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/diff/Tree.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/diff/Tree.java
@@ -1,6 +1,6 @@
package aQute.bnd.service.diff;
-public interface Tree {
+public interface Tree extends Comparable<Tree>{
public class Data {
public String name;
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/diff/Type.java b/bundleplugin/src/main/java/aQute/bnd/service/diff/Type.java
index d71b9f4..ec4c1b2 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/diff/Type.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/diff/Type.java
@@ -1,10 +1,10 @@
package aQute.bnd.service.diff;
public enum Type {
- ACCESS, BUNDLE, API, MANIFEST, PACKAGE, CLASS, INTERFACE, ANNOTATION, ENUM, EXTENDS, IMPLEMENTS, FIELD, METHOD, ANNOTATED, PROPERTY, RESOURCE, CUSTOM, CLAUSE, HEADER, PARAMETER, CLASS_VERSION, RESOURCES, CONSTANT, RETURN, VERSION, DEPRECATED;
+ ACCESS, BUNDLE, API, MANIFEST, PACKAGE, CLASS, INTERFACE, ANNOTATION, ENUM, EXTENDS, IMPLEMENTS, FIELD, METHOD, ANNOTATED, PROPERTY, RESOURCE, CUSTOM, CLAUSE, HEADER, PARAMETER, CLASS_VERSION, RESOURCES, CONSTANT, RETURN, VERSION, DEPRECATED, REPO, PROGRAM, REVISION;
public boolean isInherited() {
// TODO Auto-generated method stub
return false;
- }
+ }
}
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/packageinfo b/bundleplugin/src/main/java/aQute/bnd/service/packageinfo
index 0ff7674..084a0d4 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/packageinfo
+++ b/bundleplugin/src/main/java/aQute/bnd/service/packageinfo
@@ -1 +1 @@
-version 1.45.0
+version 2.0.0
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/url/TaggedData.java b/bundleplugin/src/main/java/aQute/bnd/service/url/TaggedData.java
index 53332f4..fe81de8 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/url/TaggedData.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/url/TaggedData.java
@@ -1,18 +1,17 @@
package aQute.bnd.service.url;
-import java.io.InputStream;
+import java.io.*;
/**
* Represents a data stream that has a tag associated with it; the primary
* use-case is an HTTP response stream with an ETag header.
*
* @author Neil Bartlett
- *
*/
public class TaggedData {
- private final String tag;
- private final InputStream inputStream;
+ private final String tag;
+ private final InputStream inputStream;
public TaggedData(String tag, InputStream inputStream) {
this.tag = tag;
diff --git a/bundleplugin/src/main/java/aQute/bnd/service/url/URLConnector.java b/bundleplugin/src/main/java/aQute/bnd/service/url/URLConnector.java
index e853509..5781288 100644
--- a/bundleplugin/src/main/java/aQute/bnd/service/url/URLConnector.java
+++ b/bundleplugin/src/main/java/aQute/bnd/service/url/URLConnector.java
@@ -1,8 +1,7 @@
package aQute.bnd.service.url;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
+import java.io.*;
+import java.net.*;
public interface URLConnector {
@@ -24,7 +23,6 @@
* {@link TaggedData#getTag()} method <strong>may</strong> return
* {@code null} if the resource has no tag.
* @throws IOException
- *
* @since 1.1
*/
TaggedData connectTagged(URL url) throws IOException;
@@ -41,7 +39,6 @@
* @return An instance of {@link TaggedData}, or {@code null} if the
* resource has not modified (i.e., if it has the same tag value).
* @throws IOException
- *
* @since 1.1
*/
TaggedData connectTagged(URL url, String tag) throws IOException;