Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 1 | package aQute.lib.osgi; |
| 2 | |
| 3 | import java.util.*; |
| 4 | import java.util.regex.*; |
| 5 | |
| 6 | public interface Constants { |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 7 | String BUNDLE_CLASSPATH = "Bundle-ClassPath"; |
| 8 | String BUNDLE_COPYRIGHT = "Bundle-Copyright"; |
| 9 | String BUNDLE_DESCRIPTION = "Bundle-Description"; |
| 10 | String BUNDLE_NAME = "Bundle-Name"; |
| 11 | String BUNDLE_NATIVECODE = "Bundle-NativeCode"; |
| 12 | String EXPORT_PACKAGE = "Export-Package"; |
| 13 | String EXPORT_SERVICE = "Export-Service"; |
| 14 | String IMPORT_PACKAGE = "Import-Package"; |
| 15 | String DYNAMICIMPORT_PACKAGE = "DynamicImport-Package"; |
| 16 | String IMPORT_SERVICE = "Import-Service"; |
| 17 | String BUNDLE_VENDOR = "Bundle-Vendor"; |
| 18 | String BUNDLE_VERSION = "Bundle-Version"; |
| 19 | String BUNDLE_DOCURL = "Bundle-DocURL"; |
| 20 | String BUNDLE_CONTACTADDRESS = "Bundle-ContactAddress"; |
| 21 | String BUNDLE_ACTIVATOR = "Bundle-Activator"; |
| 22 | String BUNDLE_REQUIREDEXECUTIONENVIRONMENT = "Bundle-RequiredExecutionEnvironment"; |
| 23 | String BUNDLE_SYMBOLICNAME = "Bundle-SymbolicName"; |
| 24 | String BUNDLE_LOCALIZATION = "Bundle-Localization"; |
| 25 | String REQUIRE_BUNDLE = "Require-Bundle"; |
| 26 | String FRAGMENT_HOST = "Fragment-Host"; |
| 27 | String BUNDLE_MANIFESTVERSION = "Bundle-ManifestVersion"; |
| 28 | String SERVICE_COMPONENT = "Service-Component"; |
| 29 | String BUNDLE_LICENSE = "Bundle-License"; |
| 30 | String PRIVATE_PACKAGE = "Private-Package"; |
| 31 | String IGNORE_PACKAGE = "Ignore-Package"; |
| 32 | String INCLUDE_RESOURCE = "Include-Resource"; |
| 33 | String CONDITIONAL_PACKAGE = "Conditional-Package"; |
| 34 | String BND_LASTMODIFIED = "Bnd-LastModified"; |
| 35 | String CREATED_BY = "Created-By"; |
| 36 | String TOOL = "Tool"; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 37 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 38 | String headers[] = { |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 39 | BUNDLE_ACTIVATOR, BUNDLE_CONTACTADDRESS, BUNDLE_COPYRIGHT, |
| 40 | BUNDLE_DESCRIPTION, BUNDLE_DOCURL, BUNDLE_LOCALIZATION, |
| 41 | BUNDLE_NATIVECODE, BUNDLE_VENDOR, BUNDLE_VERSION, BUNDLE_LICENSE, |
| 42 | BUNDLE_CLASSPATH, SERVICE_COMPONENT, EXPORT_PACKAGE, |
| 43 | IMPORT_PACKAGE, BUNDLE_LOCALIZATION, BUNDLE_MANIFESTVERSION, |
| 44 | BUNDLE_NAME, BUNDLE_NATIVECODE, |
| 45 | BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BUNDLE_SYMBOLICNAME, |
| 46 | BUNDLE_VERSION, FRAGMENT_HOST, PRIVATE_PACKAGE, IGNORE_PACKAGE, |
| 47 | INCLUDE_RESOURCE, REQUIRE_BUNDLE, IMPORT_SERVICE, EXPORT_SERVICE, |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 48 | CONDITIONAL_PACKAGE, BND_LASTMODIFIED }; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 49 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 50 | String BUILDPATH = "-buildpath"; |
| 51 | String BUMPPOLICY = "-bumppolicy"; |
| 52 | String CONDUIT = "-conduit"; |
| 53 | String CLASSPATH = "-classpath"; |
| 54 | String DEPENDSON = "-dependson"; |
| 55 | String DONOTCOPY = "-donotcopy"; |
| 56 | String EXPORT_CONTENTS = "-exportcontents"; |
| 57 | String FAIL_OK = "-failok"; |
| 58 | String INCLUDE = "-include"; |
| 59 | String INCLUDERESOURCE = "-includeresource"; |
| 60 | String MAKE = "-make"; |
| 61 | String MANIFEST = "-manifest"; |
| 62 | String NOEXTRAHEADERS = "-noextraheaders"; |
| 63 | String NOUSES = "-nouses"; |
| 64 | String NOPE = "-nope"; |
| 65 | String PEDANTIC = "-pedantic"; |
| 66 | String PLUGIN = "-plugin"; |
| 67 | String POM = "-pom"; |
| 68 | String REMOVE_HEADERS = "-removeheaders"; |
| 69 | String RESOURCEONLY = "-resourceonly"; |
| 70 | String SOURCES = "-sources"; |
| 71 | String SOURCEPATH = "-sourcepath"; |
| 72 | String SUB = "-sub"; |
| 73 | String RUNPROPERTIES = "-runproperties"; |
| 74 | String RUNSYSTEMPACKAGES = "-runsystempackages"; |
| 75 | String RUNBUNDLES = "-runbundles"; |
| 76 | String RUNPATH = "-runpath"; |
| 77 | String RUNVM = "-runvm"; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 78 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 79 | String REPORTNEWER = "-reportnewer"; |
| 80 | String SIGN = "-sign"; |
| 81 | String TESTPACKAGES = "-testpackages"; |
| 82 | String TESTREPORT = "-testreport"; |
| 83 | String UNDERTEST = "-undertest"; |
| 84 | String VERBOSE = "-verbose"; |
| 85 | String VERSIONPOLICY = "-versionpolicy"; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 86 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 87 | String options[] = { BUILDPATH, |
| 88 | BUMPPOLICY, CONDUIT, CLASSPATH, DEPENDSON, DONOTCOPY, |
| 89 | EXPORT_CONTENTS, FAIL_OK, INCLUDE, INCLUDERESOURCE, MAKE, MANIFEST, NOEXTRAHEADERS, |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 90 | NOUSES, NOPE, PEDANTIC, PLUGIN, POM, REMOVE_HEADERS, RESOURCEONLY, |
| 91 | SOURCES, SOURCEPATH, SOURCES, SOURCEPATH, SUB, RUNBUNDLES, RUNPATH, |
| 92 | RUNSYSTEMPACKAGES, RUNPROPERTIES, REPORTNEWER, UNDERTEST, |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 93 | TESTPACKAGES, TESTREPORT, VERBOSE }; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 94 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 95 | char DUPLICATE_MARKER = '~'; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 96 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 97 | String SPLIT_PACKAGE_DIRECTIVE = "-split-package:"; |
| 98 | String IMPORT_DIRECTIVE = "-import:"; |
| 99 | String NO_IMPORT_DIRECTIVE = "-noimport:"; |
| 100 | String REMOVE_ATTRIBUTE_DIRECTIVE = "-remove-attribute:"; |
| 101 | String USES_DIRECTIVE = "uses:"; |
| 102 | String PRESENCE_DIRECTIVE = "presence:"; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 103 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 104 | String KEYSTORE_LOCATION_DIRECTIVE = "keystore:"; |
| 105 | String KEYSTORE_PROVIDER_DIRECTIVE = "provider:"; |
| 106 | String KEYSTORE_PASSWORD_DIRECTIVE = "password:"; |
| 107 | String SIGN_PASSWORD_DIRECTIVE = "sign-password:"; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 108 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 109 | String directives[] = { |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 110 | SPLIT_PACKAGE_DIRECTIVE, NO_IMPORT_DIRECTIVE, IMPORT_DIRECTIVE, |
| 111 | "resolution:", "include:", "uses:", "exclude:", USES_DIRECTIVE, |
| 112 | KEYSTORE_LOCATION_DIRECTIVE, KEYSTORE_PROVIDER_DIRECTIVE, |
| 113 | KEYSTORE_PASSWORD_DIRECTIVE, SIGN_PASSWORD_DIRECTIVE, |
| 114 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 115 | // TODO |
| 116 | }; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 117 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 118 | String USES_USES = "<<USES>>"; |
| 119 | String CURRENT_USES = "@uses"; |
| 120 | String IMPORT_REFERENCE = "reference"; |
| 121 | String IMPORT_PRIVATE = "private"; |
| 122 | String[] importDirectives = { |
| 123 | IMPORT_REFERENCE, IMPORT_PRIVATE }; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 124 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 125 | String COMPONENT_FACTORY = "factory:"; |
| 126 | String COMPONENT_SERVICEFACTORY = "servicefactory:"; |
| 127 | String COMPONENT_IMMEDIATE = "immediate:"; |
| 128 | String COMPONENT_ENABLED = "enabled:"; |
| 129 | String COMPONENT_DYNAMIC = "dynamic:"; |
| 130 | String COMPONENT_MULTIPLE = "multiple:"; |
| 131 | String COMPONENT_PROVIDE = "provide:"; |
| 132 | String COMPONENT_OPTIONAL = "optional:"; |
| 133 | String COMPONENT_PROPERTIES = "properties:"; |
| 134 | String COMPONENT_IMPLEMENTATION = "implementation:"; |
| 135 | String[] componentDirectives = new String[] { |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 136 | COMPONENT_FACTORY, COMPONENT_IMMEDIATE, COMPONENT_ENABLED, |
| 137 | COMPONENT_DYNAMIC, COMPONENT_MULTIPLE, COMPONENT_PROVIDE, |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 138 | COMPONENT_OPTIONAL, COMPONENT_PROPERTIES, COMPONENT_IMPLEMENTATION, |
| 139 | COMPONENT_SERVICEFACTORY }; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 140 | |
| 141 | // static Map EES = new HashMap(); |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 142 | static Set<String> SET_COMPONENT_DIRECTIVES = new HashSet<String>( |
| 143 | Arrays |
| 144 | .asList(componentDirectives)); |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 145 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 146 | static final Pattern VALID_PROPERTY_TYPES = Pattern |
| 147 | .compile("(String|Long|Double|Float|Integer|Byte|Character|Boolean|Short)"); |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 148 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 149 | String DEFAULT_BND_EXTENSION = ".bnd"; |
| 150 | String DEFAULT_JAR_EXTENSION = ".jar"; |
| 151 | String DEFAULT_BAR_EXTENSION = ".bar"; |
| 152 | String[] METAPACKAGES = { "META-INF", |
| 153 | "OSGI-INF", "OSGI-OPT" }; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 154 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 155 | int STRATEGY_HIGHEST = 1; |
| 156 | int STRATEGY_LOWEST = -1; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 157 | |
Stuart McCulloch | 1417344 | 2009-01-29 07:46:54 +0000 | [diff] [blame^] | 158 | String CURRENT_VERSION = "@"; |
| 159 | String CURRENT_PACKAGE = "@package"; |
Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 160 | } |