From 6e6dd6ff0d64917effed33c7253c3b135183c355 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 3 Mar 2015 15:11:23 +0200 Subject: [PATCH] Always include default widget set files in OSGi manifest (#16993) Change-Id: Ib1fc01ced602d3434a0ad63725601237a0def4d1 --- .../buildhelpers/GeneratePackageExports.java | 15 +++++++++++---- client-compiled/build.xml | 1 + common.xml | 4 +++- 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 \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 packages = getPackages(jar, acceptedPackagePrefixes); + HashSet packages = getPackages(jar, acceptedPackagePrefixes, + includeNumberPackages); // Avoid writing empty Export-Package attribute if (packages.isEmpty()) { @@ -171,7 +178,7 @@ public class GeneratePackageExports { } private static HashSet getPackages(JarFile jar, - List acceptedPackagePrefixes) { + List acceptedPackagePrefixes, boolean includeNumberPackages) { HashSet packages = new HashSet(); 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 @@ + diff --git a/common.xml b/common.xml index 8c2919972d..9487560051 100644 --- a/common.xml +++ b/common.xml @@ -163,6 +163,7 @@ + @@ -174,7 +175,7 @@ - + @@ -228,6 +229,7 @@ + -- 2.39.5