summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--javaEE/build.gradle32
1 files changed, 32 insertions, 0 deletions
diff --git a/javaEE/build.gradle b/javaEE/build.gradle
index 530e10a54..08a6bcf1e 100644
--- a/javaEE/build.gradle
+++ b/javaEE/build.gradle
@@ -39,9 +39,41 @@ sourceSets {
}
jar {
+ dependsOn 'generateSources'
from {
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
}
}
+task generateSources {
+ outputs.upToDateWhen { false }
+ File outputDir = file("$buildDir/../../javaSE/src/main/java/com/smartdevicelink/")
+ outputs.dir outputDir
+ doFirst {
+ println "Generating BuildConfig.java ..."
+ def srcFile = new File(outputDir, "BuildConfig.java")
+ srcFile.parentFile.mkdirs()
+ File license = new File("$buildDir/../../LICENSE")
+ if (license.exists()) {
+ srcFile.write("/*\n")
+ def lines = license.readLines()
+ for (line in lines) {
+ srcFile.append("* ")
+ srcFile.append(line)
+ srcFile.append("\n")
+ }
+ srcFile.append("*/\n")
+ }else{
+ srcFile.write("\n")
+ }
+ srcFile.append(
+ """package com.smartdevicelink;
+
+// THIS FILE IS AUTO GENERATED, DO NOT MODIFY!!
+public final class BuildConfig {
+ public static final String VERSION_NAME = "$project.version";
+}""")
+ }
+}
+
apply from: 'bintray.gradle' \ No newline at end of file