aboutsummaryrefslogtreecommitdiff
path: root/plugins/uber-jar
diff options
context:
space:
mode:
authorrockjam <5min4eq.unity@gmail.com>2016-06-24 01:43:16 +0300
committerrockjam <5min4eq.unity@gmail.com>2016-06-24 07:27:36 +0300
commit9768c740095672aaad55309ec9b1ce88f7f840be (patch)
treef0aca66f0bb6d577723d18ffa59febc222bcaa08 /plugins/uber-jar
parent314df6dd5627a55f7e368f6fd62c0ad85922607a (diff)
downloadcbt-9768c740095672aaad55309ec9b1ce88f7f840be.tar.gz
cbt-9768c740095672aaad55309ec9b1ce88f7f840be.tar.bz2
cbt-9768c740095672aaad55309ec9b1ce88f7f840be.zip
write current jdk version to MANIFEST.MF
Diffstat (limited to 'plugins/uber-jar')
-rw-r--r--plugins/uber-jar/src/UberJar.scala18
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/uber-jar/src/UberJar.scala b/plugins/uber-jar/src/UberJar.scala
index 32b5c4a..a26053a 100644
--- a/plugins/uber-jar/src/UberJar.scala
+++ b/plugins/uber-jar/src/UberJar.scala
@@ -51,6 +51,7 @@ object UberJar extends JarUtils {
* 4. extract all jars, filter out their MANIFEST.MF and signatures files
* 5. write content of all jars to target jar file
* 6. Finalize everything, and return `ExitCode`
+ *
* @param targetDir build's target directory
* @param compilerTarget directory where compiled classfiles are
* @param classpath build's classpath
@@ -95,14 +96,21 @@ object UberJar extends JarUtils {
}
}
- // Main-Class: classname
- // Manifest-Version: 1.0
- // Created-By: 1.7.0_06 (Oracle Corporation)
- // this template is taken from java tutorial oracle site. replace with actual value, if possible...if needed
+ /**
+ * Writes three attributes to manifest file:
+ *
+ * Main-Class: classname
+ * Manifest-Version: 1.0
+ * Created-By: java.runtime.version
+ *
+ * @param mainClass optional main class
+ * @return mainifest for jar
+ */
private def createManifest(mainClass: Option[String]): jar.Manifest = {
val m = new jar.Manifest()
m.getMainAttributes.putValue("Manifest-Version", "1.0")
- m.getMainAttributes.putValue("Created-By", "1.7.0_06 (Oracle Corporation)")
+ val createdBy = Option(System.getProperty("java.runtime.version")) getOrElse "1.7.0_06 (Oracle Corporation)"
+ m.getMainAttributes.putValue("Created-By", createdBy)
mainClass foreach { className =>
m.getMainAttributes.putValue("Main-Class", className)
}