summaryrefslogtreecommitdiffstats
path: root/buildhelpers/src
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-10-09 17:58:01 +0300
committerArtur Signell <artur@vaadin.com>2012-10-09 18:54:37 +0300
commit45e2be6ab35e730197a314d3276a61d682c72419 (patch)
treed7391c17c975ff7b0e10063a23111180741b9a12 /buildhelpers/src
parentd693378d9350934aebbf3b3562c1132fbbbd7a64 (diff)
downloadvaadin-framework-45e2be6ab35e730197a314d3276a61d682c72419.tar.gz
vaadin-framework-45e2be6ab35e730197a314d3276a61d682c72419.zip
Allow specifying prefixes also for resource directories (#9793)
* Export VAADIN/widgetsets/* in client-compiled * Export VAADIN/themes/* in themes * Export VAADIN in server (vaadinBootstrap.js) Change-Id: I15b0f7352779479bf73585017f0b95492692f73b
Diffstat (limited to 'buildhelpers/src')
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java36
1 files changed, 15 insertions, 21 deletions
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
index 33c822193a..0a69fbdf97 100644
--- a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
+++ b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
@@ -123,18 +123,15 @@ public class GeneratePackageExports {
HashSet<String> packages = new HashSet<String>();
for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) {
JarEntry entry = it.nextElement();
- if (!entry.getName().endsWith(".class")) {
+
+ boolean classFile = entry.getName().endsWith(".class");
+ boolean directory = entry.isDirectory();
+
+ if (!classFile && !directory) {
continue;
}
- boolean accept = false;
- for (String prefix : acceptedPackagePrefixes) {
- if (entry.getName().startsWith(prefix)) {
- accept = true;
- break;
- }
- }
- if (!accept) {
+ if (!acceptEntry(entry.getName(), acceptedPackagePrefixes)) {
continue;
}
@@ -144,19 +141,16 @@ public class GeneratePackageExports {
packages.add(pkg);
}
- // List theme packages
- for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) {
- JarEntry entry = it.nextElement();
- if (entry.isDirectory()
- && entry.getName().startsWith("VAADIN/themes")) {
- // Strip ending slash
- int lastSlash = entry.getName().lastIndexOf('/');
- String pkg = entry.getName().substring(0, lastSlash)
- .replace('/', '.');
- packages.add(pkg);
+ return packages;
+ }
+
+ private static boolean acceptEntry(String name,
+ List<String> acceptedPackagePrefixes) {
+ for (String prefix : acceptedPackagePrefixes) {
+ if (name.startsWith(prefix)) {
+ return true;
}
}
-
- return packages;
+ return false;
}
}