You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by mc...@apache.org on 2012/09/06 20:28:09 UTC

svn commit: r1381708 [2/3] - in /felix/trunk/bundleplugin/src/main/java/aQute: bnd/build/ bnd/build/model/ bnd/build/model/conversions/ bnd/component/ bnd/differ/ bnd/filerepo/ bnd/help/ bnd/make/calltree/ bnd/make/component/ bnd/make/coverage/ bnd/mav...

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java Thu Sep  6 18:28:06 2012
@@ -15,25 +15,25 @@ public class Syntax implements Constants
 
 	static Syntax							version					= new Syntax(
 																			VERSION_ATTRIBUTE,
-																			"A version range to select the version of an export definition. The default value is 0.0.0 .",
-																			"version=\"[1.2,3.0)\"", null,
+																			"A version range to select the version of an export definition. The default value is 0.0.0.",
+																			VERSION_ATTRIBUTE + "=\"[1.2,3.0)\"", null,
 																			Verifier.VERSIONRANGE);
 	static Syntax							bundle_symbolic_name	= new Syntax(
 																			BUNDLE_SYMBOLIC_NAME_ATTRIBUTE,
 																			"The bundle symbolic name of the exporting bundle.",
-																			"bundle-symbolic-name=com.acme.foo.daffy",
+																			BUNDLE_SYMBOLIC_NAME_ATTRIBUTE + "=com.acme.foo.daffy",
 																			null, Verifier.SYMBOLICNAME);
 
 	static Syntax							bundle_version			= new Syntax(
 																			BUNDLE_VERSION_ATTRIBUTE,
-																			"a version range to select the bundle version of the exporting bundle. The default value is 0.0.0.",
-																			"bundle-version=1.3", null,
+																			"A version range to select the bundle version of the exporting bundle. The default value is 0.0.0.",
+																			BUNDLE_VERSION_ATTRIBUTE + "=1.3", null,
 																			Verifier.VERSIONRANGE);
 
 	static Syntax							path_version			= new Syntax(
 																			VERSION_ATTRIBUTE,
-																			"Specifies the range in the repository, project, or file",
-																			"version=project", "project,type", Pattern
+																			"Specifies the range in the repository, project or file.",
+																			VERSION_ATTRIBUTE + "=project", "project,type", Pattern
 																					.compile("project|type|"
 																							+ Verifier.VERSIONRANGE
 																									.toString()));
@@ -41,94 +41,94 @@ public class Syntax implements Constants
 	static Syntax[]							syntaxes				= new Syntax[] {
 			new Syntax(
 					BUNDLE_ACTIVATIONPOLICY,
-					"The Bundle-ActivationPolicy specifies how the framework should activate the bundle once started. ",
-					"Bundle-ActivationPolicy: lazy", "lazy", Pattern.compile("lazy")),
+					"The " + BUNDLE_ACTIVATIONPOLICY + " header specifies how the framework should activate the bundle once started.",
+					BUNDLE_ACTIVATIONPOLICY + ": lazy", "lazy", Pattern.compile("lazy")),
 
 			new Syntax(BUNDLE_ACTIVATOR,
-					"The Bundle-Activator header specifies the name of the class used to start and stop the bundle. ",
-					"Bundle-Activator: com.acme.foo.Activator",
+					"The " + BUNDLE_ACTIVATOR + " header specifies the name of the class used to start and stop the bundle.",
+					BUNDLE_ACTIVATOR + ": com.acme.foo.Activator",
 					"${classes;implementing;org.osgi.framework.BundleActivator}", Verifier.FQNPATTERN),
-			new Syntax(BUNDLE_CATEGORY, "The Bundle-Category header holds a comma-separated list of category names",
-					"Bundle-Category: test", "osgi,test,game,util,eclipse,netbeans,jdk,specification", null),
+			new Syntax(BUNDLE_CATEGORY, "The " + BUNDLE_CATEGORY + " header holds a comma-separated list of category names.",
+					BUNDLE_CATEGORY + ": test", "osgi,test,game,util,eclipse,netbeans,jdk,specification", null),
 			new Syntax(
 					BUNDLE_CLASSPATH,
-					"The Bundle-ClassPath header defines a comma-separated list of JAR file path names or directories (inside the bundle) containing classes and resources. The period (’.’) specifies the root directory of the bundle’s JAR. The period is also the default.",
-					"Bundle-Classpath: /lib/libnewgen.so, .", null, Verifier.PATHPATTERN),
+					"The " + BUNDLE_CLASSPATH + " header defines a comma-separated list of JAR file path names or directories (inside the bundle) containing classes and resources. The period (’.’) specifies the root directory of the bundle’s JAR. The period is also the default.",
+					BUNDLE_CLASSPATH + ": /lib/libnewgen.so, .", null, Verifier.PATHPATTERN),
 			new Syntax(BUNDLE_CONTACTADDRESS,
-					"The Bundle-ContactAddress header provides the contact address of the vendor. ",
-					"Bundle-ContactAddress: 2400 Oswego Road, Austin, TX 74563", null, null),
+					"The " + BUNDLE_CONTACTADDRESS + " header provides the contact address of the vendor.",
+					BUNDLE_CONTACTADDRESS + ": 2400 Oswego Road, Austin, TX 74563", null, null),
 			new Syntax(BUNDLE_COPYRIGHT,
-					"The Bundle-Copyright header contains the copyright specification for this bundle. ",
-					"Bundle-Copyright: OSGi (c) 2002", null, null),
-			new Syntax(BUNDLE_DESCRIPTION, "The Bundle-Description header defines a short description of this bundle.",
-					"Bundle-Description: Ceci ce n'est pas une bundle", null, null),
+					"The " + BUNDLE_COPYRIGHT + " header contains the copyright specification for this bundle.",
+					BUNDLE_COPYRIGHT + ": OSGi (c) 2002", null, null),
+			new Syntax(BUNDLE_DESCRIPTION, "The " + BUNDLE_DESCRIPTION + " header defines a short description of this bundle.",
+					BUNDLE_DESCRIPTION + ": Ceci ce n'est pas une bundle", null, null),
 
 			new Syntax(BUNDLE_DOCURL,
-					"The Bundle-DocURL headers must contain a URL pointing to documentation about this bundle.",
-					"Bundle-DocURL: http://www.aQute.biz/Code/Bnd", null, Verifier.URLPATTERN),
+					"The " + BUNDLE_DOCURL + " header must contain a URL pointing to documentation about this bundle.",
+					BUNDLE_DOCURL + ": http://www.aQute.biz/Code/Bnd", null, Verifier.URLPATTERN),
 
 			new Syntax(
 					BUNDLE_ICON,
-					"The optional Bundle-Icon header provides a list of (relative) URLs to icons representing this bundle in different sizes. ",
-					"Bundle-Icon: /icons/bnd.png;size=64", "/icons/bundle.png", Verifier.URLPATTERN, new Syntax("size",
-							"Icons size in pixels, e.g. 64", "64", "16,32,48,64,128", Verifier.NUMBERPATTERN)),
+					"The optional " + BUNDLE_ICON + " header provides a list of (relative) URLs to icons representing this bundle in different sizes.",
+					BUNDLE_ICON + ": /icons/bnd.png;size=64", "/icons/bundle.png", Verifier.URLPATTERN, new Syntax("size",
+							"Icons size in pixels, e.g. 64.", "size=64", "16,32,48,64,128", Verifier.NUMBERPATTERN)),
 
 			new Syntax(
 					BUNDLE_LICENSE,
-					"The Bundle-License header provides an optional machine readable form of license information. The purpose of this header is to automate some of the license processing required by many organizations",
-					"Bundle License: http://www.opensource.org/licenses/jabberpl.php",
+					"The " + BUNDLE_LICENSE + " header provides an optional machine readable form of license information. The purpose of this header is to automate some of the license processing required by many organizations.",
+					BUNDLE_LICENSE + ": http://www.opensource.org/licenses/jabberpl.php",
 					"http://www.apache.org/licenses/LICENSE-2.0,<<EXTERNAL>>", Pattern.compile("("
 							+ Verifier.URLPATTERN + "|<<EXTERNAL>>)"), new Syntax(DESCRIPTION_ATTRIBUTE,
-							"Human readable description of the license", "description=\"Described the license here\"",
+							"Human readable description of the license.", DESCRIPTION_ATTRIBUTE + "=\"Describe the license here\"",
 							null, Verifier.ANYPATTERN), new Syntax(LINK_ATTRIBUTE, "", "", null, Verifier.URLPATTERN)),
 			new Syntax(
 					BUNDLE_LOCALIZATION,
-					"The Bundle-Localization header contains the location in the bundle where localization files can be found. The default value is OSGI-INF/l10n/bundle. Translations are by default therefore OSGI-INF/l10n/bundle_de.properties, OSGI-INF/l10n/bundle_nl.properties, etc.",
-					"Bundle-Localization: OSGI-INF/l10n/bundle", "OSGI-INF/l10n/bundle", Verifier.URLPATTERN),
+					"The " + BUNDLE_LOCALIZATION + " header contains the location in the bundle where localization files can be found. The default value is OSGI-INF/l10n/bundle. Translations are by default therefore OSGI-INF/l10n/bundle_de.properties, OSGI-INF/l10n/bundle_nl.properties, etc.",
+					BUNDLE_LOCALIZATION + ": OSGI-INF/l10n/bundle", "OSGI-INF/l10n/bundle", Verifier.URLPATTERN),
 			new Syntax(
 					BUNDLE_MANIFESTVERSION,
-					"This header is set by bnd automatically to 2. The Bundle-ManifestVersion header defines that the bundle follows the rules of this specification. The Bundle-ManifestVersion header determines whether the bundle follows the rules of this specification.",
-					"# Bundle-ManifestVersion: 2", "2", Verifier.NUMBERPATTERN),
+					"The " + BUNDLE_MANIFESTVERSION + " header is set by bnd automatically to 2. The header defines that the bundle follows the rules of this specification.",
+					"# " + BUNDLE_MANIFESTVERSION + ": 2", "2", Verifier.NUMBERPATTERN),
 			new Syntax(
 					BUNDLE_NAME,
-					"This header will be derived from the  Bundle-SymbolicName if not set. The Bundle-Name header defines a readable name for this bundle. This should be a short, human-readable name that can contain spaces.",
-					"Bundle-Name: My Bundle", null, Verifier.ANYPATTERN),
+					"The " + BUNDLE_NAME + " header will be derived from the " + BUNDLE_SYMBOLICNAME + " header if not set. The " + BUNDLE_NAME + " header defines a readable name for this bundle. This should be a short, human-readable name that can contain spaces.",
+					BUNDLE_NAME + ": My Bundle", null, Verifier.ANYPATTERN),
 			new Syntax(
 					BUNDLE_NATIVECODE,
-					"The Bundle-NativeCode header contains a specification of native code libraries contained in this bundle. ",
-					"Bundle-NativeCode: /lib/http.DLL; osname = QNX; osversion = 3.1",
+					"The " + BUNDLE_NATIVECODE + " header contains a specification of native code libraries contained in this bundle.",
+					BUNDLE_NATIVECODE + ": /lib/http.DLL; osname = QNX; osversion = 3.1",
 					null,
 					Verifier.PATHPATTERN,
-					new Syntax(OSNAME_ATTRIBUTE, "The name of the operating system", "osname=MacOS", Processor.join(
+					new Syntax(OSNAME_ATTRIBUTE, "The name of the operating system.", OSNAME_ATTRIBUTE + "=MacOS", Processor.join(
 							Verifier.OSNAMES, ","), Verifier.ANYPATTERN),
-					new Syntax(OSVERSION_ATTRIBUTE, "Operating System Version", "osversion=3.1", null,
+					new Syntax(OSVERSION_ATTRIBUTE, "Operating System Version.", OSVERSION_ATTRIBUTE + "=3.1", null,
 							Verifier.ANYPATTERN),
-					new Syntax(LANGUAGE_ATTRIBUTE, "Language ISO 639 code", "language=nl", null, Verifier.ISO639),
-					new Syntax(PROCESSOR_ATTRIBUTE, "Processor name", "processor=x86", Processor.join(
+					new Syntax(LANGUAGE_ATTRIBUTE, "Language ISO 639 code.", LANGUAGE_ATTRIBUTE + "=nl", null, Verifier.ISO639),
+					new Syntax(PROCESSOR_ATTRIBUTE, "Processor name.", PROCESSOR_ATTRIBUTE + "=x86", Processor.join(
 							Verifier.PROCESSORNAMES, ","), Verifier.ANYPATTERN),
 					new Syntax(
 							SELECTION_FILTER_ATTRIBUTE,
 							"The value of this attribute must be a filter expression that indicates if the native code clause should be selected or not.",
-							"selection-filter=\"(com.acme.windowing=win32)\"", null, Verifier.FILTERPATTERN)),
+							SELECTION_FILTER_ATTRIBUTE + "=\"(com.acme.windowing=win32)\"", null, Verifier.FILTERPATTERN)),
 			new Syntax(
 					BUNDLE_REQUIREDEXECUTIONENVIRONMENT,
-					"The Bundle-RequiredExecutionEnvironment contains a comma-separated list of execution environments that must be present on the Service Platform.",
-					"Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0", Processor.join(Verifier.EES, ","),
+					"The " + BUNDLE_REQUIREDEXECUTIONENVIRONMENT + " contains a comma-separated list of execution environments that must be present on the Service Platform.",
+					BUNDLE_REQUIREDEXECUTIONENVIRONMENT + ": CDC-1.0/Foundation-1.0", Processor.join(Verifier.EES, ","),
 					Verifier.ANYPATTERN),
 
 			new Syntax(
 					BUNDLE_SYMBOLICNAME,
-					"The Bundle-SymbolicName header specifies a non-localizable name for this bundle. The bundle symbolic name together with a version must identify a  unique bundle. The bundle symbolic name should be based on the reverse  domain name convention",
-					"Bundle-SymbolicName: com.acme.foo.daffy;singleton:=true",
+					"The " + BUNDLE_SYMBOLICNAME + " header specifies a non-localizable name for this bundle. The bundle symbolic name together with a version must identify a unique bundle. The bundle symbolic name should be based on the reverse domain name convention.",
+					BUNDLE_SYMBOLICNAME + ": com.acme.foo.daffy;singleton:=true",
 					"${p}",
 					Verifier.SYMBOLICNAME,
 					new Syntax(
 							SINGLETON_DIRECTIVE,
-							" Indicates that the bundle can only have  a single version resolved.  A value of true indicates that the bundle is a singleton bundle. The default value is false. The Framework must resolve at most one  bundle when multiple versions of a singleton bundle with the same symbolic name are installed. Singleton bundles do not affect the resolution of non-singleton bundles with the same symbolic name.",
-							"false", "true,false", Verifier.TRUEORFALSEPATTERN),
+							"Indicates that the bundle can only have a single version resolved. A value of true indicates that the bundle is a singleton bundle. The default value is false. The Framework must resolve at most one bundle when multiple versions of a singleton bundle with the same symbolic name are installed. Singleton bundles do not affect the resolution of non-singleton bundles with the same symbolic name.",
+							SINGLETON_DIRECTIVE + "=false", "true,false", Verifier.TRUEORFALSEPATTERN),
 					new Syntax(
 							FRAGMENT_ATTACHMENT_DIRECTIVE,
-							"Defines how fragments are allowed to be attached, see the fragments in Fragment Bundles on page73. The following values are valid for this directive:",
+							"Defines how fragments are allowed to be attached, see the fragments in Fragment Bundles on page 73. The following values are valid for this directive:",
 							"", "always|never|resolve-time", Pattern.compile("always|never|resolve-time")), new Syntax(
 							BLUEPRINT_WAIT_FOR_DEPENDENCIES_ATTRIBUTE, "", "", "true,false",
 							Verifier.TRUEORFALSEPATTERN), new Syntax(BLUEPRINT_TIMEOUT_ATTRIBUTE, "", "",
@@ -136,199 +136,199 @@ public class Syntax implements Constants
 
 			new Syntax(
 					BUNDLE_UPDATELOCATION,
-					"The Bundle-UpdateLocation header specifies a URL where an update for this bundle should come from. If the bundle is updated, this location should be used, if present, to retrieve the updated JAR file.",
-					"Bundle-UpdateLocation: http://www.acme.com/Firewall/bundle.jar", null, Verifier.URLPATTERN),
+					"The " + BUNDLE_UPDATELOCATION + " header specifies a URL where an update for this bundle should come from. If the bundle is updated, this location should be used, if present, to retrieve the updated JAR file.",
+					BUNDLE_UPDATELOCATION + ": http://www.acme.com/Firewall/bundle.jar", null, Verifier.URLPATTERN),
 
 			new Syntax(BUNDLE_VENDOR,
-					"The Bundle-Vendor header contains a human-readable description of the bundle vendor. ",
-					"Bundle-Vendor: OSGi Alliance ", null, null),
+					"The " + BUNDLE_VENDOR + " header contains a human-readable description of the bundle vendor.",
+					BUNDLE_VENDOR + ": OSGi Alliance", null, null),
 
-			new Syntax(BUNDLE_VERSION, "The Bundle-Version header specifies the version of this bundle",
-					"Bundle-Version: 1.23.4.build200903221000", null, Verifier.VERSION),
+			new Syntax(BUNDLE_VERSION, "The " + BUNDLE_VERSION + " header specifies the version of this bundle.",
+					BUNDLE_VERSION + ": 1.23.4.build200903221000", null, Verifier.VERSION),
 
 			new Syntax(
 					DYNAMICIMPORT_PACKAGE,
-					"The DynamicImport-Package header contains a comma-separated list of package names that should be dynamically imported when needed.",
-					"DynamicImport-Package: com.acme.plugin.*", "", Verifier.WILDCARDNAMEPATTERN, version,
+					"The " + DYNAMICIMPORT_PACKAGE + " header contains a comma-separated list of package names that should be dynamically imported when needed.",
+					DYNAMICIMPORT_PACKAGE + ": com.acme.plugin.*", "", Verifier.WILDCARDNAMEPATTERN, version,
 					bundle_symbolic_name, bundle_version),
 
 			new Syntax(
 					EXPORT_PACKAGE,
-					"The Export-Package header contains a declaration of exported packages.",
-					"Export-Package: org.osgi.util.tracker;version=1.3",
+					"The " + EXPORT_PACKAGE + " header contains a declaration of exported packages.",
+					EXPORT_PACKAGE + ": org.osgi.util.tracker;version=1.3",
 					"${packages}",
 					null,
 					new Syntax(
 							NO_IMPORT_DIRECTIVE,
-							"By default, bnd makes all exports also imports. Adding a -noimport to an exported package will make it export only",
-							"-noimport:=true", "true,false", Verifier.TRUEORFALSEPATTERN),
+							"By default, bnd makes all exports also imports. Adding a " + NO_IMPORT_DIRECTIVE + " to an exported package will make it export only.",
+							NO_IMPORT_DIRECTIVE + "=true", "true,false", Verifier.TRUEORFALSEPATTERN),
 					new Syntax(
 							USES_DIRECTIVE,
-							"Calculated by bnd: It is a comma-separated list of package names that are used by the exported package",
+							"Calculated by bnd: It is a comma-separated list of package names that are used by the exported package.",
 							"Is calculated by bnd", null, null),
 					new Syntax(
 							MANDATORY_DIRECTIVE,
-							"A comma-separated list of attribute names. Note that the use of a comma in the value requires it to be enclosed in double quotes. A bundle importing the package must specify the mandatory attributes, with a value that matches, to resolve to the exported package",
-							"mandatory=\"bar,foo\"", null, null), new Syntax(INCLUDE_DIRECTIVE,
-							"A comma-separated list of class names that must be visible to an importer",
-							"include:=\"Qux*\"", null, null), new Syntax(EXCLUDE_DIRECTIVE,
-							"A comma-separated list of class names that must not be visible to an importer",
-							"exclude:=\"QuxImpl*,BarImpl\"", null, Verifier.WILDCARDNAMEPATTERN), new Syntax(
-							IMPORT_DIRECTIVE, "Experimental", "", null, null)
+							"A comma-separated list of attribute names. Note that the use of a comma in the value requires it to be enclosed in double quotes. A bundle importing the package must specify the mandatory attributes, with a value that matches, to resolve to the exported package.",
+							MANDATORY_DIRECTIVE + "=\"bar,foo\"", null, null), new Syntax(INCLUDE_DIRECTIVE,
+							"A comma-separated list of class names that must be visible to an importer.",
+							INCLUDE_DIRECTIVE + "=\"Qux*\"", null, null), new Syntax(EXCLUDE_DIRECTIVE,
+							"A comma-separated list of class names that must not be visible to an importer.",
+							EXCLUDE_DIRECTIVE + "=\"QuxImpl*,BarImpl\"", null, Verifier.WILDCARDNAMEPATTERN), new Syntax(
+							IMPORT_DIRECTIVE, "Experimental.", "", null, null)
 
 			),
-			new Syntax(EXPORT_SERVICE, "Deprecated", "Export-Service: org.osgi.service.log.LogService ",
+			new Syntax(EXPORT_SERVICE, "Deprecated.", EXPORT_SERVICE + ": org.osgi.service.log.LogService",
 					"${classes;implementing;*}", null),
 			new Syntax(
 					FRAGMENT_HOST,
-					"The Fragment-Host header defines the host bundle for this fragment.",
-					"Fragment-Host: org.eclipse.swt; bundle-version=\"[3.0.0,4.0.0)\"",
+					"The " + FRAGMENT_HOST + " header defines the host bundle for this fragment.",
+					FRAGMENT_HOST + ": org.eclipse.swt; bundle-version=\"[3.0.0,4.0.0)\"",
 					null,
 					null,
 					new Syntax(
 							EXTENSION_DIRECTIVE,
-							" Indicates this extension is a system or boot class path extension. It is only applicable when the Fragment-Host is the System Bundle",
-							"extension:=framework", "framework,bootclasspath", Pattern
+							"Indicates this extension is a system or boot class path extension. It is only applicable when the Fragment-Host is the System Bundle.",
+							EXTENSION_DIRECTIVE + "=framework", "framework,bootclasspath", Pattern
 									.compile("framework|bootclasspath")), bundle_version),
 			new Syntax(
 					IMPORT_PACKAGE,
-					"This header is normally calculated by bnd, however, you can decorate packages or skip packages. The Import-Package header declares the imported packages for this bundle",
-					"Import-Package: !com.exotic.*, com.acme.foo;vendor=ACME, *",
+					"The " + IMPORT_PACKAGE + " header is normally calculated by bnd, however, you can decorate packages or skip packages. The header declares the imported packages for this bundle.",
+					IMPORT_PACKAGE + ": !com.exotic.*, com.acme.foo;vendor=ACME, *",
 					"${exported_packages}",
 					Verifier.WILDCARDNAMEPATTERN,
 					new Syntax(REMOVE_ATTRIBUTE_DIRECTIVE,
-							"Remove the given attributes from matching imported packages", "-remove-attribute:=foo.*",
+							"Remove the given attributes from matching imported packages.", REMOVE_ATTRIBUTE_DIRECTIVE + "=foo.*",
 							null, Verifier.WILDCARDNAMEPATTERN),
 					new Syntax(
 							RESOLUTION_DIRECTIVE,
-							"Indicates that the packages must be resolved if the value is mandatory, which is the default. If mandatory packages cannot be resolved, then the bundle must fail to resolve. A value of optional indicates that the packages are optional",
-							"resolution:=optional", "mandatory,optional", Pattern.compile("mandatory|optional")
+							"Indicates that the packages must be resolved if the value is mandatory, which is the default. If mandatory packages cannot be resolved, then the bundle must fail to resolve. A value of optional indicates that the packages are optional.",
+							RESOLUTION_DIRECTIVE + "=optional", "mandatory,optional", Pattern.compile("mandatory|optional")
 
 					), version, bundle_symbolic_name, bundle_version),
 
 			new Syntax(
 					REQUIRE_BUNDLE,
-					"The Require-Bundle header specifies the required exports from another bundle.",
-					"Require-Bundle: com.acme.chess",
+					"The " + REQUIRE_BUNDLE + " header specifies the required exports from another bundle.",
+					REQUIRE_BUNDLE + ": com.acme.chess",
 					null,
 					Verifier.WILDCARDNAMEPATTERN,
 
 					new Syntax(
 							VISIBILITY_DIRECTIVE,
-							" If the value is private (Default), then all visible packages from the required bundles are not re-exported. If the value is reexport then bundles that require this bundle will transitively have access to these required bundle’s exported packages.",
-							"visibility:=private", "private,reexport", Pattern.compile("private|reexport")),
+							"If the value is private (Default), then all visible packages from the required bundles are not re-exported. If the value is reexport then bundles that require this bundle will transitively have access to these required bundle’s exported packages.",
+							VISIBILITY_DIRECTIVE + "=private", "private,reexport", Pattern.compile("private|reexport")),
 
 					new Syntax(
 							RESOLUTION_DIRECTIVE,
 							"If the value is mandatory (default) then the required bundle must exist for this bundle to resolve. If the value is optional, the bundle will resolve even if the required bundle does not exist.",
-							"resolution:=optional", "mandatory,optional", Pattern.compile("mandatory|optional")),
+							RESOLUTION_DIRECTIVE + "=optional", "mandatory,optional", Pattern.compile("mandatory|optional")),
 
 					new Syntax(
 							SPLIT_PACKAGE_DIRECTIVE,
-							"Indicates how an imported package should be merged when it is split between different exporters. The default is merge-first with warning",
-							"-split-package:=merge-first", "merge-first,merge-last,error,first", Pattern
+							"Indicates how an imported package should be merged when it is split between different exporters. The default is merge-first with warning.",
+							SPLIT_PACKAGE_DIRECTIVE + "=merge-first", "merge-first,merge-last,error,first", Pattern
 									.compile("merge-first|merge-last|error|first")), bundle_version
 
 			),
 			new Syntax(BUILDPATH,
-					"Provides the class path for building the jar. The entries are references to the repository",
-					"-buildpath=osgi;version=4.1", "${repo;bsns}", Verifier.SYMBOLICNAME, path_version),
+					"Provides the class path for building the jar. The entries are references to the repository.",
+					BUILDPATH + "=osgi;version=4.1", "${repo;bsns}", Verifier.SYMBOLICNAME, path_version),
 			new Syntax(BUMPPOLICY, "Sets the version bump policy. This is a parameter to the ${version} macro.",
-					"-bumppolicy==+0", "==+,=+0,+00", Pattern.compile("[=+-0][=+-0][=+-0]")),
+					BUMPPOLICY + "==+0", "==+,=+0,+00", Pattern.compile("[=+-0][=+-0][=+-0]")),
 
 			new Syntax(CONDUIT,
-					"Allows a bnd file to point to files which will be returned when the bnd file is build",
-					"-conduit= jar/osgi.jar", null, null),
+					"Allows a bnd file to point to files which will be returned when the bnd file is build.",
+					CONDUIT + "= jar/osgi.jar", null, null),
 
 			new Syntax(
 					DEPENDSON,
-					"List of project names that this project directly depends on. These projects are always build ahead of this project",
-					"-dependson=org.acme.cm", "${projects}", null),
+					"List of project names that this project directly depends on. These projects are always build ahead of this project.",
+					DEPENDSON + "=org.acme.cm", "${projects}", null),
 
-			new Syntax(DEPLOYREPO, "Specifies to which repo the project should be deployed.", "-deployrepo=cnf",
+			new Syntax(DEPLOYREPO, "Specifies to which repo the project should be deployed.", DEPLOYREPO + "=cnf",
 					"${repos}", null),
 
 			new Syntax(DONOTCOPY,
-					"Regular expression for names of files and directories that should not be copied when discovered",
-					"-donotcopy=(CVS|\\.svn)", null, null),
+					"Regular expression for names of files and directories that should not be copied when discovered.",
+					DONOTCOPY + "=(CVS|\\.svn)", null, null),
 
 			new Syntax(
 					EXPORT_CONTENTS,
-					"Build the JAR in the normal way but use this header for the Export-Package header manifest generation, same format",
-					"-exportcontents=!*impl*,*;version=3.0", null, null),
+					"Build the JAR in the normal way but use this header for the " + EXPORT_PACKAGE + " header manifest generation, same format.",
+					EXPORT_CONTENTS + "=!*impl*,*;version=3.0", null, null),
 
-			new Syntax(FAIL_OK, "Return with an ok status (0) even if the build generates errors", "-failok=true",
+			new Syntax(FAIL_OK, "Return with an ok status (0) even if the build generates errors.", FAIL_OK + "=true",
 					"true,false", Verifier.TRUEORFALSEPATTERN),
 
 			new Syntax(
 					INCLUDE,
-					"Include files. If an entry starts with '-', it does not have to exist. If it starts with '~', it must not overwrite any existing properties",
-					"-include: -${java.user}/.bnd", null, null),
+					"Include files. If an entry starts with '-', it does not have to exist. If it starts with '~', it must not overwrite any existing properties.",
+					INCLUDE + ": -${java.user}/.bnd", null, null),
 
 			new Syntax(
 					INCLUDERESOURCE,
-					"Include resources from the file system. You can specify a directory, or file. All files are copied to the root, unless a destination directory is indicated",
-					"-includeresource: lib=jar", null, null),
+					"Include resources from the file system. You can specify a directory, or file. All files are copied to the root, unless a destination directory is indicated.",
+					INCLUDERESOURCE + ": lib=jar", null, null),
 
 			new Syntax(
 					MAKE,
 					"Set patterns for make plugins. These patterns are used to find a plugin that can make a resource that can not be found.",
-					"-make: (*).jar;type=bnd;  recipe=\"bnd/$1.bnd\"", null, null, new Syntax("type",
-							"Type name for plugin", "type=bnd", "bnd", null), new Syntax("recipe",
-							"Recipe for the plugin, can use back references", "recipe=\"bnd/$1.bnd\"", "bnd", null)),
+					MAKE + ": (*).jar;type=bnd; recipe=\"bnd/$1.bnd\"", null, null, new Syntax("type",
+							"Type name for plugin.", "type=bnd", "bnd", null), new Syntax("recipe",
+							"Recipe for the plugin, can use back references.", "recipe=\"bnd/$1.bnd\"", "bnd", null)),
 
-			new Syntax(MANIFEST, "Directly include a manifest, do not use the calculated manifest",
-					"-manifest = META-INF/MANIFEST.MF", null, null),
+			new Syntax(MANIFEST, "Directly include a manifest, do not use the calculated manifest.",
+					MANIFEST + "=META-INF/MANIFEST.MF", null, null),
 
-			new Syntax(NOEXTRAHEADERS, "Do not generate housekeeping headers", "-noextraheaders", "true,false",
+			new Syntax(NOEXTRAHEADERS, "Do not generate housekeeping headers.", NOEXTRAHEADERS + "=true", "true,false",
 					Verifier.TRUEORFALSEPATTERN),
 
-			new Syntax(NOUSES, "Do not calculate the uses: directive on exports", "-nouses=true", "true,false",
+			new Syntax(NOUSES, "Do not calculate the " + USES_DIRECTIVE + " directive on exports.", NOUSES + "=true", "true,false",
 					Verifier.TRUEORFALSEPATTERN),
 
-			new Syntax(PEDANTIC, "Warn about things that are not really wrong but still not right", "-nope=true",
+			new Syntax(PEDANTIC, "Warn about things that are not really wrong but still not right.", PEDANTIC + "=true",
 					"true,false", Verifier.TRUEORFALSEPATTERN),
 
-			new Syntax(PLUGIN, "Define the plugins",
-					"-plugin=aQute.lib.spring.SpringComponent,aQute.lib.deployer.FileRepo;location=${repo}", null, null),
+			new Syntax(PLUGIN, "Define the plugins.",
+					PLUGIN + "=aQute.lib.spring.SpringComponent,aQute.lib.deployer.FileRepo;location=${repo}", null, null),
 
-			new Syntax(SERVICE_COMPONENT, "The header for Declarative Services",
-					"Service-Component=com.acme.Foo?;activate='start'", null, null),
+			new Syntax(SERVICE_COMPONENT, "The header for Declarative Services.",
+					SERVICE_COMPONENT + "=com.acme.Foo?;activate='start'", null, null),
 
-			new Syntax(POM, "Generate a maven pom", "-pom=true", "true,false", Verifier.TRUEORFALSEPATTERN),
+			new Syntax(POM, "Generate a maven pom.", POM + "=true", "true,false", Verifier.TRUEORFALSEPATTERN),
 
-			new Syntax(RELEASEREPO, "Specifies to which repo the project should be released.", "-releaserepo=cnf",
+			new Syntax(RELEASEREPO, "Specifies to which repo the project should be released.", RELEASEREPO + "=cnf",
 					"${repos}", null),
 
-			new Syntax(REMOVEHEADERS, "Remove all headers that match the regular expressions",
-					"-removeheaders=FOO_.*,Proprietary", null, null),
+			new Syntax(REMOVEHEADERS, "Remove all headers that match the regular expressions.",
+					REMOVEHEADERS + "=FOO_.*,Proprietary", null, null),
 			new Syntax(
 					RESOURCEONLY,
-					"Normally bnd warns when the JAR does not contain any classes, this option suppresses this warning",
-					"-resourceonly=true", "true,false", Verifier.TRUEORFALSEPATTERN),
-			new Syntax(SOURCES, "Include sources in the jar", "-sources=true", "true,false",
+					"Normally bnd warns when the JAR does not contain any classes, this option suppresses this warning.",
+					RESOURCEONLY + "=true", "true,false", Verifier.TRUEORFALSEPATTERN),
+			new Syntax(SOURCES, "Include sources in the jar.", SOURCES + "=true", "true,false",
 					Verifier.TRUEORFALSEPATTERN),
-			new Syntax(SOURCEPATH, "List of directory names that used to source sources for -sources",
-					"-sourcepath:= src, test", null, null),
+			new Syntax(SOURCEPATH, "List of directory names that used to source sources for " + SOURCES + ".",
+					SOURCEPATH + ":= src, test", null, null),
 			new Syntax(
 					SUB,
-					"Build a set of bnd files that use this bnd file as a basis. The list of bnd file can be specified with wildcards",
-					"-sub=com.acme.*.bnd", null, null),
-			new Syntax(RUNPROPERTIES, "Properties that are set as system properties before the framework is started",
-					"-runproperties= foo=3, bar=4", null, null),
-			new Syntax(RUNSYSTEMPACKAGES, "Add additional system packages to a framework run",
-					"-runsystempackages=com.acme.foo,javax.management", null, null),
+					"Build a set of bnd files that use this bnd file as a basis. The list of bnd file can be specified with wildcards.",
+					SUB + "=com.acme.*.bnd", null, null),
+			new Syntax(RUNPROPERTIES, "Properties that are set as system properties before the framework is started.",
+					RUNPROPERTIES + "= foo=3, bar=4", null, null),
+			new Syntax(RUNSYSTEMPACKAGES, "Add additional system packages to a framework run.",
+					RUNSYSTEMPACKAGES + "=com.acme.foo,javax.management", null, null),
 			new Syntax(
 					RUNBUNDLES,
-					"Add additional bundles, specified with their bsn and version like in -buildpath, that are started before the project is run",
-					"-runbundles=osgi;version=\"[4.1,4.2)\", junit.junit, com.acme.foo;version=project", null,
+					"Add additional bundles, specified with their bsn and version like in " + BUILDPATH + ", that are started before the project is run.",
+					RUNBUNDLES + "=osgi;version=\"[4.1,4.2)\", junit.junit, com.acme.foo;version=project", null,
 					Verifier.SYMBOLICNAME, path_version),
-			new Syntax(RUNPATH, "Additional JARs for the VM path, should include the framework",
-					"-runpath=org.eclipse.osgi;version=3.5", null, null, path_version),
+			new Syntax(RUNPATH, "Additional JARs for the VM path, should include the framework.",
+					RUNPATH + "=org.eclipse.osgi;version=3.5", null, null, path_version),
 			new Syntax(
 					RUNVM,
-					"Additional arguments for the VM invokation. Keys that start with a - are added as options, otherwise they are treated as -D properties for the VM",
-					"-runvm=-Xmax=30", null, null)
+					"Additional arguments for the VM invokation. Keys that start with a - are added as options, otherwise they are treated as -D properties for the VM.",
+					RUNVM + "=-Xmax=30", null, null)
 																	};
 
 	public final static Map<String,Syntax>	HELP					= new HashMap<String,Syntax>();

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/calltree/CalltreeResource.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/calltree/CalltreeResource.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/calltree/CalltreeResource.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/calltree/CalltreeResource.java Thu Sep  6 18:28:06 2012
@@ -86,21 +86,21 @@ public class CalltreeResource extends Wr
 				COMPARATOR);
 
 		ClassDataCollector cd = new ClassDataCollector() {
-			Clazz.MethodDef	source;
+//			Clazz.MethodDef	source;
 
 			// Before a method is parsed
 			@Override
 			public void method(Clazz.MethodDef source) {
-				this.source = source;
+//				this.source = source;
 				xref(using, source, null);
 				xref(usedby, source, null);
 			}
 
 			// For any reference in the previous method.
-			public void reference(Clazz.MethodDef reference) {
-				xref(using, source, reference);
-				xref(usedby, reference, source);
-			}
+//			public void reference(Clazz.MethodDef reference) {
+//				xref(using, source, reference);
+//				xref(usedby, reference, source);
+//			}
 		};
 		for (Clazz clazz : classes) {
 			clazz.parseClassFileWithCollector(cd);

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java Thu Sep  6 18:28:06 2012
@@ -1,9 +1,7 @@
 package aQute.bnd.make.component;
 
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.Map;
+import java.io.*;
+import java.util.*;
 import java.util.Map.Entry;
 
 import aQute.bnd.annotation.component.*;
@@ -14,7 +12,7 @@ import aQute.bnd.osgi.*;
 import aQute.bnd.osgi.Clazz.QUERY;
 import aQute.bnd.osgi.Descriptors.TypeRef;
 import aQute.bnd.service.*;
-import aQute.lib.tag.Tag;
+import aQute.lib.tag.*;
 
 /**
  * This class is an analyzer plugin. It looks at the properties and tries to

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/coverage/Coverage.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/coverage/Coverage.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/coverage/Coverage.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/coverage/Coverage.java Thu Sep  6 18:28:06 2012
@@ -35,7 +35,7 @@ public class Coverage {
 			throws Exception {
 		for (final Clazz clazz : source) {
 			clazz.parseClassFileWithCollector(new ClassDataCollector() {
-				MethodDef	source;
+//				MethodDef	source;
 
 				@Override
 				public void implementsInterfaces(TypeRef names[]) {
@@ -56,15 +56,16 @@ public class Coverage {
 				// Method definitions
 				@Override
 				public void method(MethodDef source) {
-					this.source = source;
+//					this.source = source;
 				}
 
-				public void reference(MethodDef reference) {
-					List<MethodDef> references = catalog.get(reference);
-					if (references != null) {
-						references.add(source);
-					}
-				}
+				// TODO need to use different reference method
+//				public void reference(MethodDef reference) {
+//					List<MethodDef> references = catalog.get(reference);
+//					if (references != null) {
+//						references.add(source);
+//					}
+//				}
 			});
 		}
 	}

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenCommand.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenCommand.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenCommand.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenCommand.java Thu Sep  6 18:28:06 2012
@@ -13,9 +13,9 @@ import aQute.bnd.maven.support.*;
 import aQute.bnd.maven.support.Pom.Scope;
 import aQute.bnd.osgi.*;
 import aQute.bnd.osgi.Descriptors.PackageRef;
-import aQute.bnd.settings.*;
 import aQute.lib.collections.*;
 import aQute.lib.io.*;
+import aQute.lib.settings.*;
 import aQute.libg.command.*;
 
 public class MavenCommand extends Processor {
@@ -185,7 +185,7 @@ public class MavenCommand extends Proces
 		}
 
 		if (developers.isEmpty()) {
-			String email = settings.globalGet(Settings.EMAIL, null);
+			String email = settings.remove("email");
 			if (email == null)
 				error("No developer email set, you can set global default email with: bnd global email Peter.Kriens@aQute.biz");
 			else

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java Thu Sep  6 18:28:06 2012
@@ -7,6 +7,7 @@ import java.util.regex.*;
 import aQute.bnd.osgi.*;
 import aQute.bnd.service.*;
 import aQute.bnd.version.*;
+import aQute.lib.collections.*;
 import aQute.service.reporter.*;
 
 public class MavenRepository implements RepositoryPlugin, Plugin, BsnToMavenPath {
@@ -114,10 +115,10 @@ public class MavenRepository implements 
 	}
 
 	public PutResult put(InputStream stream, PutOptions options) throws Exception {
-		throw new IllegalStateException("Maven does not support the put command");
+		throw new UnsupportedOperationException("Maven does not support the put command");
 	}
 
-	public List<Version> versions(String bsn) throws Exception {
+	public SortedSet<Version> versions(String bsn) throws Exception {
 
 		File files[] = get(bsn, null);
 		List<Version> versions = new ArrayList<Version>();
@@ -127,7 +128,10 @@ public class MavenRepository implements 
 			Version v = new Version(version);
 			versions.add(v);
 		}
-		return versions;
+		if ( versions.isEmpty())
+			return SortedList.empty();
+		
+		return new SortedList<Version>(versions);
 	}
 
 	public void setProperties(Map<String,String> map) {
@@ -201,4 +205,20 @@ public class MavenRepository implements 
 	public String getLocation() {
 		return root.toString();
 	}
+
+	public File get(String bsn, Version version, Map<String,String> properties, DownloadListener ... listeners) throws Exception {
+		File file = get(bsn, version.toString(), Strategy.EXACT, properties);
+		if ( file == null)
+			return null;
+		
+		for (DownloadListener l : listeners) {
+			try {
+				l.success(file);
+			}
+			catch (Exception e) {
+				reporter.exception(e, "Download listener for %s", file);
+			}
+		}
+		return file;
+	}
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java Thu Sep  6 18:28:06 2012
@@ -75,7 +75,7 @@ public class MavenRemoteRepository imple
 		throw new UnsupportedOperationException("cannot do list");
 	}
 
-	public List<Version> versions(String bsn) throws Exception {
+	public SortedSet<Version> versions(String bsn) throws Exception {
 		throw new UnsupportedOperationException("cannot do versions");
 	}
 
@@ -126,4 +126,21 @@ public class MavenRemoteRepository imple
 
 		return Arrays.toString(repositories);
 	}
+
+	public File get(String bsn, Version version, Map<String,String> properties, DownloadListener ... listeners) throws Exception {
+		File f= get(bsn, version.toString(), Strategy.EXACT, properties);
+		if ( f == null)
+			return null;
+		
+		for (DownloadListener l : listeners) {
+			try {
+				l.success(f);
+			}
+			catch (Exception e) {
+				reporter.exception(e, "Download listener for %s", f);
+			}
+		}
+		return f;
+	}
+
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Analyzer.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Analyzer.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Analyzer.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Analyzer.java Thu Sep  6 18:28:06 2012
@@ -698,6 +698,10 @@ public class Analyzer extends Processor 
 		return apiUses;
 	}
 
+	public Packages getClasspathExports() {
+		return classpathExports;
+	}
+
 	/**
 	 * Get the version for this bnd
 	 * 
@@ -2035,6 +2039,8 @@ public class Analyzer extends Processor 
 				typeName = "extends";
 			else if (typeName.equalsIgnoreCase("importing"))
 				typeName = "imports";
+			else if (typeName.equalsIgnoreCase("annotation"))
+				typeName = "annotated";
 			else if (typeName.equalsIgnoreCase("implementing"))
 				typeName = "implements";
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Annotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Annotation.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Annotation.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Annotation.java Thu Sep  6 18:28:06 2012
@@ -62,8 +62,15 @@ public class Annotation {
 
 	public <T extends java.lang.annotation.Annotation> T getAnnotation() throws Exception {
 		String cname = name.getFQN();
-		Class<T> c = (Class<T>) getClass().getClassLoader().loadClass(cname);
-		return getAnnotation(c);
+		try {
+			Class<T> c = (Class<T>) getClass().getClassLoader().loadClass(cname);
+			return getAnnotation(c);
+		}
+		catch (ClassNotFoundException e) {
+		}
+		catch (NoClassDefFoundError e) {
+		}
+		return null;
 	}
 
 	public <T extends java.lang.annotation.Annotation> T getAnnotation(Class<T> c) throws Exception {

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Builder.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Builder.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Builder.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Builder.java Thu Sep  6 18:28:06 2012
@@ -9,7 +9,6 @@ import java.util.zip.*;
 
 import aQute.bnd.component.*;
 import aQute.bnd.differ.*;
-import aQute.bnd.differ.Baseline.Info;
 import aQute.bnd.header.*;
 import aQute.bnd.make.*;
 import aQute.bnd.make.component.*;
@@ -18,7 +17,6 @@ import aQute.bnd.maven.*;
 import aQute.bnd.osgi.Descriptors.PackageRef;
 import aQute.bnd.osgi.Descriptors.TypeRef;
 import aQute.bnd.service.*;
-import aQute.bnd.service.RepositoryPlugin.Strategy;
 import aQute.bnd.service.diff.*;
 import aQute.lib.collections.*;
 import aQute.libg.generics.*;
@@ -309,8 +307,10 @@ public class Builder extends Analyzer {
 				}
 			}
 		}
-		if (jar.getDirectories().size() == 0)
+		if (jar.getDirectories().size() == 0) {
+			trace("extra dirs %s", jar.getDirectories());
 			return null;
+		}
 		return jar;
 	}
 
@@ -860,6 +860,7 @@ public class Builder extends Analyzer {
 
 		if (!destination.contains("${@}")) {
 			cr = new CombinedResource();
+			cr.lastModified = lastModified;
 		}
 		trace("last modified requires %s", lastModified);
 
@@ -869,9 +870,10 @@ public class Builder extends Analyzer {
 				String path = getReplacer().process(destination);
 				String command = getReplacer().process(cmd);
 				File file = getFile(item);
-
-				Resource r = new CommandResource(command, this, Math.max(lastModified,
-						file.exists() ? file.lastModified() : 0L));
+				if ( file.exists())
+					lastModified = Math.max(lastModified, file.lastModified());
+				
+				Resource r = new CommandResource(command, this, lastModified, getBase());
 
 				if (preprocess)
 					r = new PreprocessResource(this, r);
@@ -890,6 +892,8 @@ public class Builder extends Analyzer {
 		// to update the modified time.
 		if (cr != null)
 			jar.putResource(destination, cr);
+		
+		updateModified(lastModified, "Include-Resource: cmd");
 	}
 
 	private String doResourceDirectory(Jar jar, Map<String,String> extra, boolean preprocess, File sourceFile,
@@ -945,6 +949,10 @@ public class Builder extends Analyzer {
 				files.put(p, file);
 			}
 		}
+		if (fs.length == 0) {
+			File empty = new File(dir, Constants.EMPTY_HEADER);
+			files.put(appendPath(path, empty.getName()), empty);
+		}
 	}
 
 	private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath)
@@ -1065,6 +1073,8 @@ public class Builder extends Analyzer {
 				if (isTrue(extra.get(LIB_DIRECTIVE))) {
 					setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH), path));
 				}
+			} else if (from.getName().equals(Constants.EMPTY_HEADER)) {
+				jar.putResource(path, new EmbeddedResource(new byte[0], 0));
 			} else {
 				error("Input file does not exist: " + from);
 			}
@@ -1159,7 +1169,7 @@ public class Builder extends Analyzer {
 		Parameters subsMap = parseHeader(sub);
 		for (Iterator<String> i = subsMap.keySet().iterator(); i.hasNext();) {
 			File file = getFile(i.next());
-			if (file.isFile()) {
+			if (file.isFile() && !file.getName().startsWith(".")) {
 				builders.add(getSubBuilder(file));
 				i.remove();
 			}
@@ -1500,84 +1510,18 @@ public class Builder extends Analyzer {
 			show(c, indent, warning);
 	}
 
-	/**
-	 * Base line against a previous version
-	 * 
-	 * @throws Exception
-	 */
-
-	private void doBaseline(Jar dot) throws Exception {
-		Parameters diffs = parseHeader(getProperty("-baseline"));
-		if (diffs.isEmpty())
-			return;
-
-		System.err.printf("baseline %s%n", diffs);
-
-		Jar other = getBaselineJar();
-		if (other == null) {
-			return;
-		}
-		Baseline baseline = new Baseline(this, differ);
-		Set<Info> infos = baseline.baseline(dot, other, null);
-		for (Info info : infos) {
-			if (info.mismatch) {
-				error("%s %-50s %-10s %-10s %-10s %-10s %-10s\n", info.mismatch ? '*' : ' ', info.packageName,
-						info.packageDiff.getDelta(), info.newerVersion, info.olderVersion, info.suggestedVersion,
-						info.suggestedIfProviders == null ? "-" : info.suggestedIfProviders);
-			}
-		}
-	}
-
+	
 	public void addSourcepath(Collection<File> sourcepath) {
 		for (File f : sourcepath) {
 			addSourcepath(f);
 		}
 	}
 
-	public Jar getBaselineJar() throws Exception {
-
-		List<RepositoryPlugin> repos = getPlugins(RepositoryPlugin.class);
-
-		Parameters diffs = parseHeader(getProperty("-baseline"));
-		File baselineFile = null;
-		if (diffs.isEmpty()) {
-			String repoName = getProperty("-baseline-repo");
-			if (repoName == null) {
-				return null;
-			}
-			for (RepositoryPlugin repo : repos) {
-				if (repoName.equals(repo.getName())) {
-					baselineFile = repo.get(getBsn(), null, Strategy.HIGHEST, null);
-					break;
-				}
-			}
-		} else {
+	/**
+	 * Base line against a previous version. Should be overridden in the ProjectBuilder where we have access to the repos
+	 * 
+	 * @throws Exception
+	 */
 
-			String bsn = null;
-			String version = null;
-			for (Entry<String,Attrs> entry : diffs.entrySet()) {
-				bsn = entry.getKey();
-				if ("@".equals(bsn)) {
-					bsn = getBsn();
-				}
-				version = entry.getValue().get(Constants.VERSION_ATTRIBUTE);
-				break;
-			}
-	
-			for (RepositoryPlugin repo : repos) {
-				if (version == null) {
-					baselineFile = repo.get(bsn, null, Strategy.HIGHEST, null);
-				} else {
-					baselineFile = repo.get(bsn, version, Strategy.EXACT, null);
-				}
-				if (baselineFile != null) {
-					break;
-				}
-			}
-		}
-		if (baselineFile == null) {
-			return new Jar(".");
-		}
-		return new Jar(baselineFile);
-	}
+	protected void doBaseline(Jar dot) throws Exception {}
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/ClassDataCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/ClassDataCollector.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/ClassDataCollector.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/ClassDataCollector.java Thu Sep  6 18:28:06 2012
@@ -2,28 +2,28 @@ package aQute.bnd.osgi;
 
 import aQute.bnd.osgi.Descriptors.TypeRef;
 
+@SuppressWarnings("unused")
 public class ClassDataCollector {
-	public void classBegin(@SuppressWarnings("unused") int access, @SuppressWarnings("unused") TypeRef name) {}
+	public void classBegin(int access, TypeRef name) {}
 
 	public boolean classStart(int access, TypeRef className) {
 		classBegin(access, className);
 		return true;
 	}
 
-	public void extendsClass(@SuppressWarnings("unused") TypeRef zuper) throws Exception {}
+	public void extendsClass(TypeRef zuper) throws Exception {}
 
-	public void implementsInterfaces(@SuppressWarnings("unused") TypeRef[] interfaces) throws Exception {}
+	public void implementsInterfaces(TypeRef[] interfaces) throws Exception {}
 
-	public void addReference(@SuppressWarnings("unused") TypeRef ref) {}
+	public void addReference(TypeRef ref) {}
 
-	public void annotation(@SuppressWarnings("unused") Annotation annotation) {}
+	public void annotation(Annotation annotation) {}
 
-	public void parameter(@SuppressWarnings("unused") int p) {}
+	public void parameter(int p) {}
 
-	public void method(@SuppressWarnings("unused") Clazz.MethodDef defined) {}
-
-	public void field(@SuppressWarnings("unused") Clazz.FieldDef defined) {}
+	public void method(Clazz.MethodDef defined) {}
 
+	public void field(Clazz.FieldDef defined) {}
 
 	public void classEnd() throws Exception {}
 
@@ -58,27 +58,18 @@ public class ClassDataCollector {
 	 *            The access flags
 	 * @throws Exception
 	 */
-	public void innerClass(TypeRef innerClass, TypeRef outerClass, String innerName, @SuppressWarnings("unused") int innerClassAccessFlags)
+	public void innerClass(TypeRef innerClass, TypeRef outerClass, String innerName, int innerClassAccessFlags)
 			throws Exception {}
 
-	public void signature(@SuppressWarnings("unused") String signature) {}
+	public void signature(String signature) {}
 
-	public void constant(@SuppressWarnings("unused") Object object) {}
+	public void constant(Object object) {}
 
 	public void memberEnd() {}
 
-	public void version(@SuppressWarnings("unused") int minor, @SuppressWarnings("unused") int major) {
-		// TODO Auto-generated method stub
-
-	}
-
-	public void referenceMethod(@SuppressWarnings("unused")
-	int access, @SuppressWarnings("unused")
-	TypeRef className, @SuppressWarnings("unused")
-	String method, @SuppressWarnings("unused") String descriptor) {
-		// TODO Auto-generated method stub
+	public void version(int minor, int major) {}
 
-	}
+	public void referenceMethod(int access, TypeRef className, String method, String descriptor) {}
 
 	/**
 	 * A reference to a type from method or field. The modifiers indicate the
@@ -87,8 +78,6 @@ public class ClassDataCollector {
 	 * @param typeRef
 	 * @param modifiers
 	 */
-	public void referTo(TypeRef typeRef, int modifiers) {
-		
-	}
+	public void referTo(TypeRef typeRef, int modifiers) {}
 
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Clazz.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Clazz.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Clazz.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Clazz.java Thu Sep  6 18:28:06 2012
@@ -147,7 +147,7 @@ public class Clazz {
 	}
 
 	public abstract class Def {
-		
+
 		final int		access;
 		Set<TypeRef>	annotations;
 
@@ -220,9 +220,11 @@ public class Clazz {
 		public TypeRef getOwnerType() {
 			return className;
 		}
-		
+
 		public abstract String getName();
+
 		public abstract TypeRef getType();
+
 		public abstract TypeRef[] getPrototype();
 
 		public Object getClazz() {
@@ -255,7 +257,6 @@ public class Clazz {
 		public String getName() {
 			return name;
 		}
-		
 
 		@Override
 		public TypeRef getType() {
@@ -296,6 +297,7 @@ public class Clazz {
 		public TypeRef[] getPrototype() {
 			return null;
 		}
+
 		public String getSignature() {
 			return signature;
 		}
@@ -338,7 +340,6 @@ public class Clazz {
 		public boolean getImplements() {
 			return interf;
 		}
-		
 
 		@Override
 		public String getName() {
@@ -346,11 +347,12 @@ public class Clazz {
 				return "<implements>";
 			return "<extends>";
 		}
-		
+
 		@Override
 		public TypeRef getType() {
 			return type;
 		}
+
 		@Override
 		public TypeRef[] getPrototype() {
 			return null;
@@ -859,9 +861,9 @@ public class Clazz {
 			doSignature(in, member, access_flags);
 		else if ("ConstantValue".equals(attributeName))
 			doConstantValue(in);
-        else if ("Exceptions".equals(attributeName))
-             doExceptions(in, access_flags);
-        else {
+		else if ("Exceptions".equals(attributeName))
+			doExceptions(in, access_flags);
+		else {
 			if (attribute_length > 0x7FFFFFFF) {
 				throw new IllegalArgumentException("Attribute > 2Gb");
 			}
@@ -1006,8 +1008,8 @@ public class Clazz {
 				referTo(clazz, access_flags);
 			}
 		}
-	}	
-	       
+	}
+
 	/**
 	 * <pre>
 	 * Code_attribute {
@@ -1154,7 +1156,8 @@ public class Clazz {
 		}
 	}
 
-	private void doAnnotations(DataInputStream in, ElementType member, RetentionPolicy policy, int access_flags) throws IOException {
+	private void doAnnotations(DataInputStream in, ElementType member, RetentionPolicy policy, int access_flags)
+			throws IOException {
 		int num_annotations = in.readUnsignedShort(); // # of annotations
 		for (int a = 0; a < num_annotations; a++) {
 			if (cd == null)
@@ -1166,8 +1169,8 @@ public class Clazz {
 		}
 	}
 
-	private Annotation doAnnotation(DataInputStream in, ElementType member, RetentionPolicy policy, boolean collect, int access_flags)
-			throws IOException {
+	private Annotation doAnnotation(DataInputStream in, ElementType member, RetentionPolicy policy, boolean collect,
+			int access_flags) throws IOException {
 		int type_index = in.readUnsignedShort();
 		if (annotations == null)
 			annotations = new HashSet<TypeRef>();
@@ -1201,8 +1204,8 @@ public class Clazz {
 		return null;
 	}
 
-	private Object doElementValue(DataInputStream in, ElementType member, RetentionPolicy policy, boolean collect, int access_flags)
-			throws IOException {
+	private Object doElementValue(DataInputStream in, ElementType member, RetentionPolicy policy, boolean collect,
+			int access_flags) throws IOException {
 		char tag = (char) in.readUnsignedByte();
 		switch (tag) {
 			case 'B' : // Byte
@@ -1228,8 +1231,8 @@ public class Clazz {
 				if (policy == RetentionPolicy.RUNTIME) {
 					referTo(type_name_index, 0);
 					if (api != null && (Modifier.isPublic(access_flags) || Modifier.isProtected(access_flags))) {
-						 TypeRef name = analyzer.getTypeRef((String) pool[type_name_index]);
-						 api.add(name.getPackageRef());
+						TypeRef name = analyzer.getTypeRef((String) pool[type_name_index]);
+						api.add(name.getPackageRef());
 					}
 				}
 				int const_name_index = in.readUnsignedShort();
@@ -1240,8 +1243,8 @@ public class Clazz {
 				if (policy == RetentionPolicy.RUNTIME) {
 					referTo(class_info_index, 0);
 					if (api != null && (Modifier.isPublic(access_flags) || Modifier.isProtected(access_flags))) {
-						 TypeRef name = analyzer.getTypeRef((String) pool[class_info_index]);
-						 api.add(name.getPackageRef());
+						TypeRef name = analyzer.getTypeRef((String) pool[class_info_index]);
+						api.add(name.getPackageRef());
 					}
 				}
 				return pool[class_info_index];
@@ -1729,5 +1732,4 @@ public class Clazz {
 	public Clazz.TypeDef getImplements(TypeRef type) {
 		return new TypeDef(type, true);
 	}
-
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/CommandResource.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/CommandResource.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/CommandResource.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/CommandResource.java Thu Sep  6 18:28:06 2012
@@ -8,11 +8,13 @@ public class CommandResource extends Wri
 	final long		lastModified;
 	final Builder	domain;
 	final String	command;
+	final File wd;
 
-	public CommandResource(String command, Builder domain, long lastModified) {
+	public CommandResource(String command, Builder domain, long lastModified, File wd) {
 		this.lastModified = lastModified;
 		this.domain = domain;
 		this.command = command;
+		this.wd = wd;
 	}
 
 	@Override
@@ -22,6 +24,7 @@ public class CommandResource extends Wri
 		try {
 			domain.trace("executing command %s", command);
 			Command cmd = new Command("sh");
+			cmd.setCwd(wd);
 			cmd.inherit();
 			String oldpath = cmd.var("PATH");
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Constants.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Constants.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Constants.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Constants.java Thu Sep  6 18:28:06 2012
@@ -69,6 +69,8 @@ public interface Constants {
 			PROVIDE_CAPABILITY, BUNDLE_ICON
 																				};
 
+	String							BASELINE									= "-baseline";
+	String							BASELINEREPO								= "-baselinerepo";
 	String							BUILDPATH									= "-buildpath";
 	String							BUILDPACKAGES								= "-buildpackages";
 	String							BUMPPOLICY									= "-bumppolicy";
@@ -90,6 +92,7 @@ public interface Constants {
 	String							MAKE										= "-make";
 	String							METATYPE									= "-metatype";
 	String							MANIFEST									= "-manifest";
+	String							PROFILE										= "-profile";
 	String							SAVEMANIFEST								= "-savemanifest";
 	String							NAMESECTION									= "-namesection";
 	String							NODEFAULTVERSION							= "-nodefaultversion";
@@ -130,6 +133,7 @@ public interface Constants {
 	String							RUNVM										= "-runvm";
 	String							RUNTRACE									= "-runtrace";
 	String							RUNFRAMEWORK								= "-runframework";
+	String							RUNFW										= "-runfw";
 	String							RUNTIMEOUT									= "-runtimeout";
 	String							SNAPSHOT									= "-snapshot";
 	String							RUNFRAMEWORK_SERVICES						= "services";
@@ -153,12 +157,12 @@ public interface Constants {
 	String							OUTPUT										= "-output";
 
 	String							options[]									= {
-			BUILDPATH, BUMPPOLICY, CONDUIT, CLASSPATH, CONSUMER_POLICY, DEPENDSON, DONOTCOPY, EXPORT_CONTENTS, FAIL_OK,
+			BASELINE, BUILDPATH, BUMPPOLICY, CONDUIT, CLASSPATH, CONSUMER_POLICY, DEPENDSON, DONOTCOPY, EXPORT_CONTENTS, FAIL_OK,
 			INCLUDE, INCLUDERESOURCE, MAKE, MANIFEST, NOEXTRAHEADERS, NOUSES, NOBUNDLES, PEDANTIC, PLUGIN, POM,
 			PROVIDER_POLICY, REMOVEHEADERS, RESOURCEONLY, SOURCES, SOURCEPATH, SOURCES, SOURCEPATH, SUB, RUNBUNDLES,
 			RUNPATH, RUNSYSTEMPACKAGES, RUNPROPERTIES, REPORTNEWER, UNDERTEST, TESTPATH, TESTPACKAGES, TESTREPORT,
-			VERBOSE, NOMANIFEST, DEPLOYREPO, RELEASEREPO, SAVEMANIFEST, RUNVM, WAB, WABLIB, RUNFRAMEWORK, RUNTRACE,
-			TESTCONTINUOUS, SNAPSHOT, NAMESECTION, DIGESTS, DSANNOTATIONS, EXPERIMENTS
+			VERBOSE, NOMANIFEST, DEPLOYREPO, RELEASEREPO, SAVEMANIFEST, RUNVM, WAB, WABLIB, RUNFRAMEWORK, RUNFW, RUNTRACE,
+			TESTCONTINUOUS, SNAPSHOT, NAMESECTION, DIGESTS, DSANNOTATIONS, EXPERIMENTS, BASELINE, BASELINEREPO, PROFILE
 																				};
 
 	// Ignore bundle specific headers. These bundles do not make

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Jar.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Jar.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Jar.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Jar.java Thu Sep  6 18:28:06 2012
@@ -515,6 +515,8 @@ public class Jar implements Closeable {
 			return;
 		try {
 			createDirectories(directories, jout, path);
+			if (path.endsWith(Constants.EMPTY_HEADER))
+				return;
 			ZipEntry ze = new ZipEntry(path);
 			ze.setMethod(ZipEntry.DEFLATED);
 			long lastModified = resource.lastModified();

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Macro.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Macro.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Macro.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Macro.java Thu Sep  6 18:28:06 2012
@@ -229,7 +229,7 @@ public class Macro {
 			}
 			catch (InvocationTargetException e) {
 				if (e.getCause() instanceof IllegalArgumentException) {
-					domain.error("%s, for cmd: %s, arguments; %s", e.getMessage(), method, Arrays.toString(args));
+					domain.error("%s, for cmd: %s, arguments; %s", e.getCause().getMessage(), method, Arrays.toString(args));
 				} else {
 					domain.warning("Exception in replace: %s", e.getCause());
 					e.getCause().printStackTrace();

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Processor.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Processor.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Processor.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/osgi/Processor.java Thu Sep  6 18:28:06 2012
@@ -38,6 +38,7 @@ public class Processor extends Domain im
 	private File					base			= new File("").getAbsoluteFile();
 
 	Properties						properties;
+	String							profile;
 	private Macro					replacer;
 	private long					lastModified;
 	private File					propertiesFile;
@@ -138,7 +139,7 @@ public class Processor extends Domain im
 	}
 
 	public void progress(float progress, String format, Object... args) {
-		format = String.format("[%2d] %s", (int)progress, format);
+		format = String.format("[%2d] %s", (int) progress, format);
 		trace(format, args);
 	}
 
@@ -354,8 +355,8 @@ public class Processor extends Domain im
 					Class< ? > c = loader.loadClass(key);
 					Object plugin = c.newInstance();
 					customize(plugin, entry.getValue());
-					if ( plugin instanceof Closeable){
-						addClose((Closeable)plugin);
+					if (plugin instanceof Closeable) {
+						addClose((Closeable) plugin);
 					}
 					list.add(plugin);
 				}
@@ -470,7 +471,8 @@ public class Processor extends Domain im
 		toBeClosed.clear();
 	}
 
-	public String _basedir(@SuppressWarnings("unused") String args[]) {
+	public String _basedir(@SuppressWarnings("unused")
+	String args[]) {
 		if (base == null)
 			throw new IllegalArgumentException("No base dir set");
 
@@ -656,7 +658,8 @@ public class Processor extends Domain im
 
 	public boolean refresh() {
 		plugins = null; // We always refresh our plugins
-
+		
+		
 		if (propertiesFile == null)
 			return false;
 
@@ -670,6 +673,8 @@ public class Processor extends Domain im
 			}
 		}
 
+		profile = getProperty(PROFILE); // Used in property access
+		
 		if (changed) {
 			forceRefresh();
 			return true;
@@ -762,6 +767,7 @@ public class Processor extends Domain im
 	 * @return
 	 */
 	public String getProperty(String key, String deflt) {
+
 		String value = null;
 
 		Instruction ins = new Instruction(key);
@@ -789,6 +795,8 @@ public class Processor extends Domain im
 
 		Processor source = this;
 
+		// Use the key as is first, if found ok
+
 		if (filter != null && filter.contains(key)) {
 			value = (String) getProperties().get(key);
 		} else {
@@ -801,6 +809,26 @@ public class Processor extends Domain im
 			}
 		}
 
+		// Check if we found a value, if not, try to prefix
+		// it with a profile if found and search again. profiles
+		// are a simple name that is prefixed like [profile]. This
+		// allows different variables to be used in different profiles.
+
+		if (value == null && profile != null) {
+			String pkey = "[" + profile + "]" + key;
+			if (filter != null && filter.contains(key)) {
+				value = (String) getProperties().get(pkey);
+			} else {
+				while (source != null) {
+					value = (String) source.getProperties().get(pkey);
+					if (value != null)
+						break;
+
+					source = source.getParent();
+				}
+			}
+		}
+
 		if (value != null)
 			return getReplacer().process(value, source);
 		else if (deflt != null)
@@ -876,8 +904,8 @@ public class Processor extends Domain im
 		return printClauses(exports, false);
 	}
 
-	public static String printClauses(Map< ? , ? extends Map< ? , ? >> exports, @SuppressWarnings("unused") boolean checkMultipleVersions)
-			throws IOException {
+	public static String printClauses(Map< ? , ? extends Map< ? , ? >> exports, @SuppressWarnings("unused")
+	boolean checkMultipleVersions) throws IOException {
 		StringBuilder sb = new StringBuilder();
 		String del = "";
 		for (Entry< ? , ? extends Map< ? , ? >> entry : exports.entrySet()) {
@@ -977,7 +1005,8 @@ public class Processor extends Domain im
 		return result;
 	}
 
-	public boolean updateModified(long time, @SuppressWarnings("unused") String reason) {
+	public boolean updateModified(long time, @SuppressWarnings("unused")
+	String reason) {
 		if (time > lastModified) {
 			lastModified = time;
 			return true;

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Actionable.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Actionable.java?rev=1381708&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Actionable.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Actionable.java Thu Sep  6 18:28:06 2012
@@ -0,0 +1,48 @@
+package aQute.bnd.service;
+
+import java.util.*;
+
+/**
+ * An interface to allow bnd to provide commands on elements. This interface can
+ * provide information about the implementer but it can also provide information
+ * about its elements. These elements are identified by a <i>target</i>. A
+ * target is one or more objects that uniquely identify a child in the
+ * container. The exact protocol for the target is left to the implementers,
+ * this interface is just a conduit between the bnd world (no Eclipse etc) and
+ * the GUI world, using only bnd and java interfaces.
+ */
+public interface Actionable {
+	/**
+	 * Return a map with command names (potentially localized) and a Runnable.
+	 * The caller can execute the caller at will.
+	 * 
+	 * @param target
+	 *            the target object, null if commands for the encompassing
+	 *            entity is sought (e.g. the repo itself).
+	 * @return A Map with the actions or null if no actions are available.
+	 * @throws Exception
+	 */
+	Map<String,Runnable> actions(Object... target) throws Exception;
+
+	/**
+	 * Return a tooltip for the given target or the encompassing entity if null
+	 * is passed.
+	 * 
+	 * @param target
+	 *            the target, any number of parameters to identify
+	 * @return the tooltip or null
+	 * @throws Exception
+	 */
+	String tooltip(Object... target) throws Exception;
+
+	/**
+	 * Provide a title for an element.
+	 * 
+	 * @param target
+	 *            the target, any number of parameters to identify
+	 * @return the text for this element
+	 * @throws Exception
+	 */
+
+	String title(Object... target) throws Exception;
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Actionable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Actionable.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java Thu Sep  6 18:28:06 2012
@@ -3,7 +3,7 @@ package aQute.bnd.service;
 import java.io.*;
 
 public interface Refreshable {
-	boolean refresh();
+	boolean refresh() throws Exception;
 
 	File getRoot();
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java Thu Sep  6 18:28:06 2012
@@ -7,17 +7,16 @@ public interface RemoteRepositoryPlugin 
 	/**
 	 * 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()}.
+	 * should always return the same result as {@link RepositoryPlugin#get(String, aQute.bnd.version.Version, Map)}
 	 * 
-	 * @param bsn
-	 * @param range
-	 * @param strategy
-	 * @param properties
+	 * @param bsn the bsn of the revision
+	 * @param version the version of the revision
+	 * @param strategy strategy
+	 * @param properties any properties
 	 * @return
 	 * @throws Exception
 	 */
-	ResourceHandle getHandle(String bsn, String range, Strategy strategy, Map<String,String> properties)
+	ResourceHandle getHandle(String bsn, String version, Strategy strategy, Map<String,String> properties)
 			throws Exception;
 
 	File getCacheDirectory();

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java Thu Sep  6 18:28:06 2012
@@ -6,113 +6,63 @@ import java.util.*;
 
 import aQute.bnd.version.*;
 
+/**
+ * A Repository Plugin abstract a bnd repository. This interface allows bnd to
+ * find programs from their bsn and revisions from their bsn-version
+ * combination. It is also possible to put revisions in a repository if the
+ * repository is not read only.
+ */
 public interface RepositoryPlugin {
-	public enum Strategy {
-		LOWEST, HIGHEST, EXACT
-	}
-
 	/**
 	 * Options used to steer the put operation
 	 */
-	public class PutOptions {
+	class PutOptions {
+		public String	BUNDLE	= "application/vnd.osgi.bundle";
+		public String	LIB		= "application/vnd.aQute.lib";
+
 		/**
-		 * The <b>SHA1</b> digest of the artifact to put into the repository.<br/>
-		 * <br/>
+		 * The <b>SHA1</b> digest of the artifact to put into the repository.
 		 * When specified the digest of the <b>fetched</b> artifact will be
 		 * calculated and verified against this digest, <b>before</b> putting
-		 * the artifact into the repository.<br/>
-		 * <br/>
-		 * An exception is thrown if the specified digest and the calculated
-		 * digest do not match.
-		 */
-		public byte[]	digest				= null;
-
-		/**
-		 * Allow the implementation to change the artifact.<br/>
-		 * <br/>
-		 * When set to true the implementation is allowed to change the artifact
-		 * when putting it into the repository.<br/>
-		 * <br/>
-		 * An exception is thrown when set to false and the implementation can't
-		 * put the artifact into the repository without changing it.
-		 */
-		public boolean	allowArtifactChange	= false;
-
-		/**
-		 * Generate a <b>SHA1</b> digest.<br/>
-		 * <br/>
-		 * When set to true the implementation generates a digest of the
-		 * artifact as it is put into the repository and returns that digest in
-		 * the result.
+		 * the artifact into the repository. </p> An exception is thrown if the
+		 * specified digest and the calculated digest do not match.
 		 */
-		public boolean	generateDigest		= false;
+		public byte[]	digest	= null;
 
 		/**
-		 * Create a 'latest' artifact when it did not exist.<br/>
-		 * <br/>
-		 * When set to true the implementation is requested to create a 'latest'
-		 * artifact.
+		 * Specify the mime type of the importing stream. This can be either
+		 * {@link #BUNDLE} or {@link #LIB}. If left open, it is up to the
+		 * repository to guess the content type.
 		 */
-		public boolean	createLatest		= false;
+		public String	type;
 	}
 
+	PutOptions	DEFAULTOPTIONS	= new PutOptions();
+
 	/**
 	 * Results returned by the put operation
 	 */
-	public class PutResult {
+	class PutResult {
 		/**
-		 * The artifact as it was put in the repository.<br/>
+		 * A (potentially public) uri to the revision as it was put in the
+		 * repository.<br/>
 		 * <br/>
-		 * This can be a URI to the artifact (when it was put into the
-		 * repository), or null when the artifact was not put into the
-		 * repository (for example because it was already in the repository).
+		 * This can be a URI to the given artifact (when it was put into the
+		 * repository). This does not have to be a File URI!
 		 */
 		public URI		artifact	= null;
 
 		/**
-		 * The 'latest' artifact as it was put in the repository.<br/>
-		 * <br/>
-		 * Only set when {@link PutOptions#createLatest} was set to true and the
-		 * 'latest' artifact did not exist, or when the 'latest' artifact did
-		 * exists and was older than the artifact being put in the repository.
-		 */
-		public URI		latest		= null;
-
-		/**
 		 * The <b>SHA1</b> digest of the artifact as it was put into the
 		 * repository.<br/>
 		 * <br/>
-		 * This will be null when {@link PutOptions#generateDigest} was null, or
-		 * when {@link #artifact} is null.
+		 * This can be null and it can differ from the input digest if the
+		 * repository rewrote the stream for optimization reason. If the
 		 */
 		public byte[]	digest		= null;
 	}
 
 	/**
-	 * Return a URL to a matching version of the given bundle.
-	 * 
-	 * @param bsn
-	 *            Bundle-SymbolicName of the searched bundle
-	 * @param range
-	 *            Version range for this bundle,"latest" if you only want the
-	 *            latest, or null when you want all.
-	 * @param strategy
-	 *            Get the highest or the lowest
-	 * @return A list of URLs sorted on version, lowest version is at index 0.
-	 *         null is returned when no files with the given bsn ould be found.
-	 * @throws Exception
-	 *             when anything goes wrong
-	 */
-	File get(String bsn, String range, Strategy strategy, Map<String,String> properties) throws Exception;
-
-	/**
-	 * Answer if this repository can be used to store files.
-	 * 
-	 * @return true if writable
-	 */
-	boolean canWrite();
-
-	/**
 	 * Put an artifact (from the InputStream) into the repository.<br/>
 	 * <br/>
 	 * There is NO guarantee that the artifact on the input stream has not been
@@ -123,7 +73,9 @@ public interface RepositoryPlugin {
 	 * @param stream
 	 *            The input stream with the artifact
 	 * @param options
-	 *            The put options. See {@link RepositoryPlugin.PutOptions}
+	 *            The put options. See {@link RepositoryPlugin.PutOptions}, can
+	 *            be {@code null}, which will then take the default options like
+	 *            new PutOptions().
 	 * @return The result of the put, never null. See
 	 *         {@link RepositoryPlugin.PutResult}
 	 * @throws Exception
@@ -138,16 +90,99 @@ public interface RepositoryPlugin {
 	PutResult put(InputStream stream, PutOptions options) throws Exception;
 
 	/**
+	 * The caller can specify any number of DownloadListener objects that are
+	 * called back when a download is finished (potentially before the get
+	 * method has returned).
+	 */
+
+	interface DownloadListener {
+		/**
+		 * Called when the file is successfully downloaded from a remote
+		 * repository.
+		 * 
+		 * @param file
+		 *            The file that was downloaded
+		 * @throws Exception
+		 *             , are logged and ignored
+		 */
+		void success(File file) throws Exception;
+
+		/**
+		 * Called when the file could not be downloaded from a remote
+		 * repository.
+		 * 
+		 * @param file
+		 *            The file that was intended to be downloaded.
+		 * @throws Exception
+		 *             , are logged and ignored
+		 */
+		void failure(File file, String reason) throws Exception;
+
+		/**
+		 * Can be called back regularly before success/failure but never after.
+		 * Indicates how far the download has progressed in percents. Since
+		 * downloads can be restarted, it is possible that the percentage
+		 * decreases.
+		 * 
+		 * @param file
+		 *            The file that was intended to be downloaded
+		 * @param percentage
+		 *            Percentage of file downloaded (can go down)
+		 * @return true if the download should continue, fails if it should be
+		 *         canceled (and fail)
+		 * @throws Exception
+		 *             , are logged and ignored
+		 */
+		boolean progress(File file, int percentage) throws Exception;
+	}
+
+	/**
+	 * Return a URL to a matching version of the given bundle.
+	 * <p/>
+	 * If download listeners are specified then the returned file is not
+	 * guaranteed to exist before a download listener is notified of success or
+	 * failure. The callback can happen before the method has returned. If the
+	 * returned file is null then download listeners are not called back.
+	 * <p/>
+	 * The intention of the Download Listeners is to allow a caller to obtain
+	 * references to files that do not yet exist but are to be downloaded. If
+	 * the downloads were done synchronously in the call, then no overlap of
+	 * downloads could take place.
+	 * 
+	 * @param bsn
+	 *            Bundle-SymbolicName of the searched bundle
+	 * @param version
+	 *            Version requested
+	 * @param listeners
+	 *            Zero or more download listener that will be notified of the
+	 *            outcome.
+	 * @return A file to the revision or null if not found
+	 * @throws Exception
+	 *             when anything goes wrong, in this case no listeners will be
+	 *             called back.
+	 */
+	File get(String bsn, Version version, Map<String,String> properties, DownloadListener... listeners)
+			throws Exception;
+
+	/**
+	 * Answer if this repository can be used to store files.
+	 * 
+	 * @return true if writable
+	 */
+	boolean canWrite();
+
+	/**
 	 * Return a list of bsns that are present in the repository.
 	 * 
-	 * @param regex
-	 *            if not null, match against the bsn and if matches, return
-	 *            otherwise skip
-	 * @return A list of bsns that match the regex parameter or all if regex is
-	 *         null
+	 * @param pattern
+	 *            A <ahref="https://en.wikipedia.org/wiki/Glob_%28programming%29">glob pattern</a>
+	 *            to be matched against bsns present in the repository, or {@code null}.
+	 * @return A list of bsns that match the pattern parameter or all if pattern
+	 *         is null; repositories that do not support browsing or querying
+	 *         should return an empty list.
 	 * @throws Exception
 	 */
-	List<String> list(String regex) throws Exception;
+	List<String> list(String pattern) throws Exception;
 
 	/**
 	 * Return a list of versions.
@@ -155,7 +190,7 @@ public interface RepositoryPlugin {
 	 * @throws Exception
 	 */
 
-	List<Version> versions(String bsn) throws Exception;
+	SortedSet<Version> versions(String bsn) throws Exception;
 
 	/**
 	 * @return The name of the repository

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Strategy.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Strategy.java?rev=1381708&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Strategy.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Strategy.java Thu Sep  6 18:28:06 2012
@@ -0,0 +1,5 @@
+package aQute.bnd.service;
+
+public enum Strategy {
+	LOWEST, EXACT, HIGHEST;
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Strategy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Strategy.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/ExtList.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/ExtList.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/ExtList.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/ExtList.java Thu Sep  6 18:28:06 2012
@@ -20,6 +20,11 @@ public class ExtList<T> extends ArrayLis
 		super(_);
 	}
 
+	public ExtList(Iterable<T> _) {
+		for ( T t : _)
+			add(t);
+	}
+
 	public static ExtList<String> from(String s) {
 		// TODO make sure no \ before comma
 		return from(s, "\\s*,\\s*");

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/SortedList.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/SortedList.java?rev=1381708&r1=1381707&r2=1381708&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/SortedList.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/SortedList.java Thu Sep  6 18:28:06 2012
@@ -431,4 +431,8 @@ public class SortedList<T> implements So
 		IteratorList<T> l = new IteratorList<T>(it);
 		return new SortedList<T>(l, cmp);
 	}
+
+	public static <T> SortedSet<T> empty() {
+		return (SortedSet<T>) empty;
+	}
 }