diff options
author | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2019-04-05 13:20:12 -0400 |
---|---|---|
committer | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2019-04-05 13:20:12 -0400 |
commit | 7a2ce294354ab1245d05c6fff44ef9e2d3d4e34d (patch) | |
tree | c3338c1e724fec14a9aa4ee1a25791cf25172c56 /javaEE | |
parent | 6c2c4c7cc7eb0f444036d9488e7e20daf07d3452 (diff) | |
download | sdl_android-7a2ce294354ab1245d05c6fff44ef9e2d3d4e34d.tar.gz |
Add generateSources task to javaEEfix_buildconfig
Diffstat (limited to 'javaEE')
-rw-r--r-- | javaEE/build.gradle | 32 |
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 |