blob: f1afe7205e26193a79a6011fbfaa28432edb6b05 [file] [log] [blame]
Stuart McCulloch26e7a5a2011-10-17 10:31:43 +00001package aQute.lib.osgi;
2
3import java.nio.charset.*;
4import java.util.regex.*;
5
6public interface Constants {
7 /*
8 * Defined in OSGi
9 */
10 /**
11 * @syntax Bundle-ActivationPolicy ::= policy ( ’;’ directive )* policy ::=
12 * ’lazy’
13 */
14 String BND_ADDXMLTOTEST = "Bnd-AddXMLToTest";
15 String BUNDLE_ACTIVATIONPOLICY = "Bundle-ActivationPolicy";
16 String BUNDLE_ACTIVATOR = "Bundle-Activator";
17 String BUNDLE_BLUEPRINT = "Bundle-Copyright";
18 String BUNDLE_CATEGORY = "Bundle-Category";
19 String BUNDLE_CLASSPATH = "Bundle-ClassPath";
20 String BUNDLE_CONTACTADDRESS = "Bundle-ContactAddress";
21 String BUNDLE_COPYRIGHT = "Bundle-Copyright";
22 String BUNDLE_DESCRIPTION = "Bundle-Description";
23 String BUNDLE_DOCURL = "Bundle-DocURL";
24 String BUNDLE_ICON = "Bundle-Icon";
25 String BUNDLE_LICENSE = "Bundle-License";
26 String BUNDLE_LOCALIZATION = "Bundle-Localization";
27 String BUNDLE_MANIFESTVERSION = "Bundle-ManifestVersion";
28 String BUNDLE_NAME = "Bundle-Name";
29 String BUNDLE_NATIVECODE = "Bundle-NativeCode";
30 String BUNDLE_REQUIREDEXECUTIONENVIRONMENT = "Bundle-RequiredExecutionEnvironment";
31 String BUNDLE_SYMBOLICNAME = "Bundle-SymbolicName";
32 String BUNDLE_UPDATELOCATION = "Bundle-UpdateLocation";
33 String BUNDLE_VENDOR = "Bundle-Vendor";
34 String BUNDLE_VERSION = "Bundle-Version";
35 String DYNAMICIMPORT_PACKAGE = "DynamicImport-Package";
36 String EXPORT_PACKAGE = "Export-Package";
37 String EXPORT_SERVICE = "Export-Service";
38 String FRAGMENT_HOST = "Fragment-Host";
39 String IMPORT_PACKAGE = "Import-Package";
40 String IMPORT_SERVICE = "Import-Service";
41 String REQUIRE_BUNDLE = "Require-Bundle";
42 String SERVICE_COMPONENT = "Service-Component";
43
44 String PRIVATE_PACKAGE = "Private-Package";
45 String IGNORE_PACKAGE = "Ignore-Package";
46 String INCLUDE_RESOURCE = "Include-Resource";
47 String CONDITIONAL_PACKAGE = "Conditional-Package";
48 String BND_LASTMODIFIED = "Bnd-LastModified";
49 String CREATED_BY = "Created-By";
50 String TOOL = "Tool";
51 String TESTCASES = "Test-Cases";
52 String SIGNATURE_TEST = "-signaturetest";
53
54 String headers[] = { BUNDLE_ACTIVATOR,
55 BUNDLE_CONTACTADDRESS, BUNDLE_COPYRIGHT, BUNDLE_DESCRIPTION, BUNDLE_DOCURL,
56 BUNDLE_LOCALIZATION, BUNDLE_NATIVECODE, BUNDLE_VENDOR, BUNDLE_VERSION, BUNDLE_LICENSE,
57 BUNDLE_CLASSPATH, SERVICE_COMPONENT, EXPORT_PACKAGE, IMPORT_PACKAGE,
58 BUNDLE_LOCALIZATION, BUNDLE_MANIFESTVERSION, BUNDLE_NAME, BUNDLE_NATIVECODE,
59 BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BUNDLE_SYMBOLICNAME, BUNDLE_VERSION,
60 FRAGMENT_HOST, PRIVATE_PACKAGE, IGNORE_PACKAGE, INCLUDE_RESOURCE, REQUIRE_BUNDLE,
61 IMPORT_SERVICE, EXPORT_SERVICE, CONDITIONAL_PACKAGE, BND_LASTMODIFIED, TESTCASES,
62 SIGNATURE_TEST };
63
64 String BUILDPATH = "-buildpath";
65 String BUILDPACKAGES = "-buildpackages";
66 String BUMPPOLICY = "-bumppolicy";
67 String CONDUIT = "-conduit";
68 String COMPILER_SOURCE = "-source";
69 String COMPILER_TARGET = "-target";
70 String DEPENDSON = "-dependson";
71 String DEPLOY = "-deploy";
72 String DEPLOYREPO = "-deployrepo";
73 String DONOTCOPY = "-donotcopy";
74 String DEBUG = "-debug";
75 String EXPORT_CONTENTS = "-exportcontents";
76 String FAIL_OK = "-failok";
77 String INCLUDE = "-include";
78 String INCLUDERESOURCE = "-includeresource";
79 String MAKE = "-make";
80 String METATYPE = "-metatype";
81 String MANIFEST = "-manifest";
82 String SAVEMANIFEST = "-savemanifest";
83 String NODEFAULTVERSION = "-nodefaultversion";
84 String NOEXTRAHEADERS = "-noextraheaders";
85 String NOMANIFEST = "-nomanifest";
86 String NOUSES = "-nouses";
87 @Deprecated String NOPE = "-nope";
88 String NOBUNDLES = "-nobundles";
89 String PEDANTIC = "-pedantic";
90 String PLUGIN = "-plugin";
91 String POM = "-pom";
92 String RELEASEREPO = "-releaserepo";
93 String REMOVEHEADERS = "-removeheaders";
94 String RESOURCEONLY = "-resourceonly";
95 String SOURCES = "-sources";
96 String SOURCEPATH = "-sourcepath";
97 String SUB = "-sub";
98 String RUNPROPERTIES = "-runproperties";
99 String RUNSYSTEMPACKAGES = "-runsystempackages";
100 String RUNBUNDLES = "-runbundles";
101 String RUNPATH = "-runpath";
102 String RUNSTORAGE = "-runstorage";
103 String RUNBUILDS = "-runbuilds";
104 String RUNPATH_MAIN_DIRECTIVE = "main:";
105 String RUNPATH_LAUNCHER_DIRECTIVE = "launcher:";
106 String RUNVM = "-runvm";
107 String RUNTRACE = "-runtrace";
108 String RUNFRAMEWORK = "-runframework";
109 String RUNTIMEOUT = "-runtimeout";
110 String SNAPSHOT = "-snapshot";
111 String RUNFRAMEWORK_SERVICES = "services";
112 String RUNFRAMEWORK_NONE = "none";
113 String REPORTNEWER = "-reportnewer";
114 String SIGN = "-sign";
115 String TESTPACKAGES = "-testpackages";
116 String TESTREPORT = "-testreport";
117 String TESTPATH = "-testpath";
118 String TESTCONTINUOUS = "-testcontinuous";
119 String UNDERTEST = "-undertest";
120 String VERBOSE = "-verbose";
121 @Deprecated String VERSIONPOLICY_IMPL = "-versionpolicy-impl";
122 @Deprecated String VERSIONPOLICY_USES = "-versionpolicy-uses";
123 String PROVIDER_POLICY = "-provider-policy";
124 String CONSUMER_POLICY = "-consumer-policy";
125 @Deprecated String VERSIONPOLICY = "-versionpolicy";
126 String WAB = "-wab";
127 String WABLIB = "-wablib";
128 String REQUIRE_BND = "-require-bnd";
129
130 // Deprecated
131 String CLASSPATH = "-classpath";
132
133 String options[] = { BUILDPATH, BUMPPOLICY,
134 CONDUIT, CLASSPATH, CONSUMER_POLICY, DEPENDSON, DONOTCOPY, EXPORT_CONTENTS, FAIL_OK,
135 INCLUDE, INCLUDERESOURCE, MAKE, MANIFEST, NOEXTRAHEADERS, NOUSES, NOBUNDLES, PEDANTIC,
136 PLUGIN, POM, PROVIDER_POLICY, REMOVEHEADERS, RESOURCEONLY, SOURCES, SOURCEPATH,
137 SOURCES, SOURCEPATH, SUB, RUNBUNDLES, RUNPATH, RUNSYSTEMPACKAGES, RUNPROPERTIES,
138 REPORTNEWER, UNDERTEST, TESTPATH, TESTPACKAGES, TESTREPORT, VERBOSE, NOMANIFEST,
139 DEPLOYREPO, RELEASEREPO, SAVEMANIFEST, RUNVM, WAB, WABLIB, RUNFRAMEWORK, RUNTRACE,
140 TESTCONTINUOUS, SNAPSHOT };
141
142 // Ignore bundle specific headers. These bundles do not make
143 // a lot of sense to inherit
144 String[] BUNDLE_SPECIFIC_HEADERS = new String[] {
145 INCLUDE_RESOURCE, BUNDLE_ACTIVATOR, BUNDLE_CLASSPATH, BUNDLE_NAME, BUNDLE_NATIVECODE,
146 BUNDLE_SYMBOLICNAME, IMPORT_PACKAGE, EXPORT_PACKAGE, DYNAMICIMPORT_PACKAGE,
147 FRAGMENT_HOST, REQUIRE_BUNDLE, PRIVATE_PACKAGE, EXPORT_CONTENTS, TESTCASES, NOMANIFEST,
148 SIGNATURE_TEST, WAB, WABLIB };
149
150 char DUPLICATE_MARKER = '~';
151 String SPECIFICATION_VERSION = "specification-version";
152 String SPLIT_PACKAGE_DIRECTIVE = "-split-package:";
153 String IMPORT_DIRECTIVE = "-import:";
154 String NO_IMPORT_DIRECTIVE = "-noimport:";
155 String REMOVE_ATTRIBUTE_DIRECTIVE = "-remove-attribute:";
156 String LIB_DIRECTIVE = "lib:";
157 String NOANNOTATIONS = "-noannotations";
158 String COMMAND_DIRECTIVE = "command:";
159 String USES_DIRECTIVE = "uses:";
160 String MANDATORY_DIRECTIVE = "mandatory:";
161 String INCLUDE_DIRECTIVE = "include:";
162 String PROVIDE_DIRECTIVE = "provide:";
163 String EXCLUDE_DIRECTIVE = "exclude:";
164 String PRESENCE_DIRECTIVE = "presence:";
165 String PRIVATE_DIRECTIVE = "private:";
166 String SINGLETON_DIRECTIVE = "singleton:";
167 String EXTENSION_DIRECTIVE = "extension:";
168 String VISIBILITY_DIRECTIVE = "visibility:";
169 String FRAGMENT_ATTACHMENT_DIRECTIVE = "fragment-attachment:";
170 String RESOLUTION_DIRECTIVE = "resolution:";
171 String PATH_DIRECTIVE = "path:";
172 String SIZE_ATTRIBUTE = "size";
173 String LINK_ATTRIBUTE = "link";
174 String NAME_ATTRIBUTE = "name";
175 String DESCRIPTION_ATTRIBUTE = "description";
176 String OSNAME_ATTRIBUTE = "osname";
177 String OSVERSION_ATTRIBUTE = "osversion";
178 String PROCESSOR_ATTRIBUTE = "processor";
179 String LANGUAGE_ATTRIBUTE = "language";
180 String SELECTION_FILTER_ATTRIBUTE = "selection-filter";
181 String BLUEPRINT_WAIT_FOR_DEPENDENCIES_ATTRIBUTE = "blueprint.wait-for-dependencies";
182 String BLUEPRINT_TIMEOUT_ATTRIBUTE = "blueprint.timeout";
183 String VERSION_ATTRIBUTE = "version";
184 String BUNDLE_SYMBOLIC_NAME_ATTRIBUTE = "bundle-symbolic-name";
185 String BUNDLE_VERSION_ATTRIBUTE = "bundle-version";
186 String FROM_DIRECTIVE = "from:";
187
188 String KEYSTORE_LOCATION_DIRECTIVE = "keystore:";
189 String KEYSTORE_PROVIDER_DIRECTIVE = "provider:";
190 String KEYSTORE_PASSWORD_DIRECTIVE = "password:";
191 String SIGN_PASSWORD_DIRECTIVE = "sign-password:";
192
193 String NONE = "none";
194
195 String directives[] = {
196 SPLIT_PACKAGE_DIRECTIVE, NO_IMPORT_DIRECTIVE, IMPORT_DIRECTIVE, RESOLUTION_DIRECTIVE,
197 INCLUDE_DIRECTIVE, USES_DIRECTIVE, EXCLUDE_DIRECTIVE, KEYSTORE_LOCATION_DIRECTIVE,
198 KEYSTORE_PROVIDER_DIRECTIVE, KEYSTORE_PASSWORD_DIRECTIVE, SIGN_PASSWORD_DIRECTIVE,
199 COMMAND_DIRECTIVE, NOANNOTATIONS, LIB_DIRECTIVE, RUNPATH_LAUNCHER_DIRECTIVE,
200 FROM_DIRECTIVE, PRIVATE_DIRECTIVE
201
202 // TODO
203 };
204
205 String USES_USES = "<<USES>>";
206 String CURRENT_USES = "@uses";
207 String IMPORT_REFERENCE = "reference";
208 String IMPORT_PRIVATE = "private";
209 String[] importDirectives = { IMPORT_REFERENCE,
210 IMPORT_PRIVATE };
211
212 static final Pattern VALID_PROPERTY_TYPES = Pattern
213 .compile("(String|Long|Double|Float|Integer|Byte|Character|Boolean|Short)");
214
215 String DEFAULT_BND_EXTENSION = ".bnd";
216 String DEFAULT_JAR_EXTENSION = ".jar";
217 String DEFAULT_BAR_EXTENSION = ".bar";
218 String DEFAULT_BNDRUN_EXTENSION = ".bndrun";
219 String[] METAPACKAGES = { "META-INF", "OSGI-INF",
220 "OSGI-OPT" };
221
222 String CURRENT_VERSION = "@";
223 String CURRENT_PACKAGE = "@package";
224
225 String BUILDFILES = "buildfiles";
226
227 String EMPTY_HEADER = "<<EMPTY>>";
228
229 String EMBEDDED_REPO = "/embedded-repo.jar";
230 String LAUNCHER_PLUGIN = "Launcher-Plugin";
231 String TESTER_PLUGIN = "Tester-Plugin";
232
233 String DEFAULT_LAUNCHER_BSN = "biz.aQute.launcher";
234 String DEFAULT_TESTER_BSN = "biz.aQute.junit";
235
236 String DEFAULT_DO_NOT_COPY = "CVS|\\.svn|\\.git|\\.DS_Store";
237
238 Charset DEFAULT_CHARSET = Charset.forName("UTF8");
239 String VERSION_FILTER = "version";
240}