blob: 9535bac67f0959a77ac39058ad82cdc6b2c3515d [file] [log] [blame]
Stuart McCulloch5ec302d2008-12-04 07:58:07 +00001package aQute.lib.osgi;
2
3import java.util.*;
4import java.util.regex.*;
5
6public interface Constants {
Stuart McCulloch14173442009-01-29 07:46:54 +00007 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 McCulloch5ec302d2008-12-04 07:58:07 +000037
Stuart McCulloch14173442009-01-29 07:46:54 +000038 String headers[] = {
Stuart McCulloch5ec302d2008-12-04 07:58:07 +000039 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 McCulloch14173442009-01-29 07:46:54 +000048 CONDITIONAL_PACKAGE, BND_LASTMODIFIED };
Stuart McCulloch5ec302d2008-12-04 07:58:07 +000049
Stuart McCulloch14173442009-01-29 07:46:54 +000050 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 McCulloch5ec302d2008-12-04 07:58:07 +000078
Stuart McCulloch14173442009-01-29 07:46:54 +000079 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 McCulloch5ec302d2008-12-04 07:58:07 +000086
Stuart McCulloch14173442009-01-29 07:46:54 +000087 String options[] = { BUILDPATH,
88 BUMPPOLICY, CONDUIT, CLASSPATH, DEPENDSON, DONOTCOPY,
89 EXPORT_CONTENTS, FAIL_OK, INCLUDE, INCLUDERESOURCE, MAKE, MANIFEST, NOEXTRAHEADERS,
Stuart McCulloch5ec302d2008-12-04 07:58:07 +000090 NOUSES, NOPE, PEDANTIC, PLUGIN, POM, REMOVE_HEADERS, RESOURCEONLY,
91 SOURCES, SOURCEPATH, SOURCES, SOURCEPATH, SUB, RUNBUNDLES, RUNPATH,
92 RUNSYSTEMPACKAGES, RUNPROPERTIES, REPORTNEWER, UNDERTEST,
Stuart McCulloch14173442009-01-29 07:46:54 +000093 TESTPACKAGES, TESTREPORT, VERBOSE };
Stuart McCulloch5ec302d2008-12-04 07:58:07 +000094
Stuart McCulloch14173442009-01-29 07:46:54 +000095 char DUPLICATE_MARKER = '~';
Stuart McCulloch5ec302d2008-12-04 07:58:07 +000096
Stuart McCulloch14173442009-01-29 07:46:54 +000097 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 McCulloch5ec302d2008-12-04 07:58:07 +0000103
Stuart McCulloch14173442009-01-29 07:46:54 +0000104 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 McCulloch5ec302d2008-12-04 07:58:07 +0000108
Stuart McCulloch14173442009-01-29 07:46:54 +0000109 String directives[] = {
Stuart McCulloch5ec302d2008-12-04 07:58:07 +0000110 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 McCulloch14173442009-01-29 07:46:54 +0000115 // TODO
116 };
Stuart McCulloch5ec302d2008-12-04 07:58:07 +0000117
Stuart McCulloch14173442009-01-29 07:46:54 +0000118 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 McCulloch5ec302d2008-12-04 07:58:07 +0000124
Stuart McCulloch14173442009-01-29 07:46:54 +0000125 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 McCulloch5ec302d2008-12-04 07:58:07 +0000136 COMPONENT_FACTORY, COMPONENT_IMMEDIATE, COMPONENT_ENABLED,
137 COMPONENT_DYNAMIC, COMPONENT_MULTIPLE, COMPONENT_PROVIDE,
Stuart McCulloch14173442009-01-29 07:46:54 +0000138 COMPONENT_OPTIONAL, COMPONENT_PROPERTIES, COMPONENT_IMPLEMENTATION,
139 COMPONENT_SERVICEFACTORY };
Stuart McCulloch5ec302d2008-12-04 07:58:07 +0000140
141 // static Map EES = new HashMap();
Stuart McCulloch14173442009-01-29 07:46:54 +0000142 static Set<String> SET_COMPONENT_DIRECTIVES = new HashSet<String>(
143 Arrays
144 .asList(componentDirectives));
Stuart McCulloch5ec302d2008-12-04 07:58:07 +0000145
Stuart McCulloch14173442009-01-29 07:46:54 +0000146 static final Pattern VALID_PROPERTY_TYPES = Pattern
147 .compile("(String|Long|Double|Float|Integer|Byte|Character|Boolean|Short)");
Stuart McCulloch5ec302d2008-12-04 07:58:07 +0000148
Stuart McCulloch14173442009-01-29 07:46:54 +0000149 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 McCulloch5ec302d2008-12-04 07:58:07 +0000154
Stuart McCulloch14173442009-01-29 07:46:54 +0000155 int STRATEGY_HIGHEST = 1;
156 int STRATEGY_LOWEST = -1;
Stuart McCulloch5ec302d2008-12-04 07:58:07 +0000157
Stuart McCulloch14173442009-01-29 07:46:54 +0000158 String CURRENT_VERSION = "@";
159 String CURRENT_PACKAGE = "@package";
Stuart McCulloch5ec302d2008-12-04 07:58:07 +0000160}