summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java15
-rw-r--r--client-compiled/build.xml1
-rw-r--r--common.xml4
3 files changed, 15 insertions, 5 deletions
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
index 0d8f117329..d4ad3f838c 100644
--- a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
+++ b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
@@ -47,7 +47,8 @@ public class GeneratePackageExports {
System.err
.println("Invalid number of parameters\n"
+ "Usage: java -cp .. GenerateManifest <package.jar> <accepted package prefixes>\n"
- + "Use -Dvaadin.version to specify the version to be used for the packages");
+ + "Use -Dvaadin.version to specify the version to be used for the packages\n"
+ + "Use -DincludeNumberPackages=1 to include package names which start with a number (not 100% OSGi compatible)");
System.exit(1);
}
@@ -67,8 +68,14 @@ public class GeneratePackageExports {
acceptedPackagePrefixes.add(args[i]);
}
+ boolean includeNumberPackages = false;
+ if ("1".equals(System.getProperty("includeNumberPackages"))) {
+ includeNumberPackages = true;
+ }
+
// List the included Java packages
- HashSet<String> packages = getPackages(jar, acceptedPackagePrefixes);
+ HashSet<String> packages = getPackages(jar, acceptedPackagePrefixes,
+ includeNumberPackages);
// Avoid writing empty Export-Package attribute
if (packages.isEmpty()) {
@@ -171,7 +178,7 @@ public class GeneratePackageExports {
}
private static HashSet<String> getPackages(JarFile jar,
- List<String> acceptedPackagePrefixes) {
+ List<String> acceptedPackagePrefixes, boolean includeNumberPackages) {
HashSet<String> packages = new HashSet<String>();
Pattern startsWithNumber = Pattern.compile("\\.\\d");
@@ -194,7 +201,7 @@ public class GeneratePackageExports {
String pkg = entry.getName().substring(0, lastSlash)
.replace('/', '.');
- if (startsWithNumber.matcher(pkg).find()) {
+ if (!includeNumberPackages && startsWithNumber.matcher(pkg).find()) {
continue;
}
diff --git a/client-compiled/build.xml b/client-compiled/build.xml
index fb4f26bc73..5eb8decd22 100644
--- a/client-compiled/build.xml
+++ b/client-compiled/build.xml
@@ -124,6 +124,7 @@
<target name="jar" depends="default-widgetset">
<antcall target="common.jar">
<param name="osgi.extra.package.prefixes" value="VAADIN/widgetsets/" />
+ <param name="osgi.includeNumberPackages" value="1" />
<reference torefid="extra.jar.includes" refid="jar.includes" />
</antcall>
</target>
diff --git a/common.xml b/common.xml
index 8c2919972d..9487560051 100644
--- a/common.xml
+++ b/common.xml
@@ -163,6 +163,7 @@
<param name="bundle-name" value="${module.name}" />
<param name="bundle-symbolic" value="${module.symbolic}" />
<param name="bundle-vendor" value="${vaadin.vendor}" />
+ <param name="includeNumberPackages" value="${osgi.includeNumberPackages}" />
</antcall>
</target>
@@ -174,7 +175,7 @@
<fail unless="bundle-symbolic" message="No bundle-symbolic parameter given" />
<fail unless="bundle-version" message="No bundle-version parameter given" />
<fail unless="bundle-vendor" message="No bundle-vendor parameter given" />
-
+ <fail unless="includeNumberPackages" message="No includeNumberPackages parameter given" />
<property name="bundle-manifestversion" value="2" />
<jar file="${jar}" update="true">
@@ -228,6 +229,7 @@
<arg line="com/vaadin com/google ${osgi.extra.package.prefixes}" />
<classpath refid="buildhelpers.classpath" />
<jvmarg value="-Dvaadin.version=${vaadin.version}" />
+ <jvmarg value="-DincludeNumberPackages=${includeNumberPackages}" />
</java>
</target>