]> source.dussan.org Git - vaadin-framework.git/commitdiff
Always include default widget set files in OSGi manifest (#16993)
authorArtur Signell <artur@vaadin.com>
Tue, 3 Mar 2015 13:11:23 +0000 (15:11 +0200)
committerVaadin Code Review <review@vaadin.com>
Tue, 3 Mar 2015 13:44:33 +0000 (13:44 +0000)
Change-Id: Ib1fc01ced602d3434a0ad63725601237a0def4d1

buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
client-compiled/build.xml
common.xml

index 0d8f117329462a121593dc74789d86a93213d81b..d4ad3f838cf95d842307412a60a4378c64e3c548 100644 (file)
@@ -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;
             }
 
index fb4f26bc73319d8b352f1ff2d1ae269841cc0a6e..5eb8decd22beb1300f35efe4d33121ec32bcc1ed 100644 (file)
     <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>
index 8c2919972d10c652585c527bf957ff9c239b9046..948756005117a232d05f9256e931468f87ebec42 100644 (file)
             <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>
         <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">
             <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>