summaryrefslogtreecommitdiffstats
path: root/buildhelpers
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-10-09 11:58:52 +0300
committerArtur Signell <artur@vaadin.com>2012-10-09 11:58:52 +0300
commit59edcbc490f55a0a9c3ad922950d21b6a755bc22 (patch)
tree5dfb145b58c321d6fc659044d6f3e78a3f96a9b1 /buildhelpers
parentd1962559709a8a5ea0b60ac661bd3a1e0e514be4 (diff)
downloadvaadin-framework-59edcbc490f55a0a9c3ad922950d21b6a755bc22.tar.gz
vaadin-framework-59edcbc490f55a0a9c3ad922950d21b6a755bc22.zip
Add version to exported packages (#7222)
Change-Id: I8c22329258cbd8d4dc2f892ae5ba6fa0b9b37a10
Diffstat (limited to 'buildhelpers')
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
index bf9bd7e068..33c822193a 100644
--- a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
+++ b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
@@ -29,9 +29,11 @@ public class GeneratePackageExports {
if (args.length < 2) {
System.err
.println("Invalid number of parameters\n"
- + "Usage: java -cp .. GenerateManifest <package.jar> <accepted package prefixes>");
+ + "Usage: java -cp .. GenerateManifest <package.jar> <accepted package prefixes>\n"
+ + "Use -Dvaadin.version to specify the version to be used for the packages");
System.exit(1);
}
+ String vaadinVersion = System.getProperty("vaadin.version");
// Open the JAR
String jarFilename = args[0];
@@ -57,7 +59,7 @@ public class GeneratePackageExports {
return;
}
- String exportPackage = sortAndJoinPackages(packages);
+ String exportPackage = sortAndJoinPackages(packages, vaadinVersion);
// Read old manifest
Manifest oldMF = null;
@@ -95,7 +97,8 @@ public class GeneratePackageExports {
}
}
- private static String sortAndJoinPackages(HashSet<String> packages) {
+ private static String sortAndJoinPackages(HashSet<String> packages,
+ String vaadinVersion) {
// Produce an ordered listing of the package names
String packageArray[] = new String[packages.size()];
packages.toArray(packageArray);
@@ -105,8 +108,11 @@ public class GeneratePackageExports {
if (i != 0) {
joinedPackages.append(",");
}
-
- joinedPackages.append(packageArray[i]);
+ String packageAndVersion = packageArray[i];
+ if (vaadinVersion != null) {
+ packageAndVersion += ";version=\"" + vaadinVersion + "\"";
+ }
+ joinedPackages.append(packageAndVersion);
}
return joinedPackages.toString();