aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
Diffstat (limited to 'poi')
-rw-r--r--poi/build.gradle27
1 files changed, 26 insertions, 1 deletions
diff --git a/poi/build.gradle b/poi/build.gradle
index d71e86bc51..da8eeb9ff1 100644
--- a/poi/build.gradle
+++ b/poi/build.gradle
@@ -27,6 +27,10 @@ sourceSets {
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
output.dir(JAVA9_OUT, builtBy: 'cacheJava9')
}
+ java {
+ // also include the generated Version.java
+ srcDirs += 'build/generated-sources'
+ }
}
test {
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
@@ -55,6 +59,27 @@ dependencies {
javadocs project(':poi-scratchpad')
}
+// generate and compile the file Version.java file
+task generateVersionJava() {
+ //dependsOn ':poi-ooxml:build', ':poi-integration:build', ':poi-excelant:build'
+
+ File fileIn = file("src/main/version/Version.java.template")
+ File fileOut = file("build/generated-sources/org/apache/poi/Version.java")
+
+ inputs.file fileIn
+ outputs.file fileOut
+
+ doLast {
+ String content = fileIn.text
+
+ content = content.replace("@VERSION@", version)
+ content = content.replace("@DSTAMP@", new Date().format('yyyyMMdd'))
+
+ fileOut.write content
+ }
+}
+compileJava.dependsOn 'generateVersionJava'
+
final String MODULE_NAME = 'org.apache.poi.poi'
final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$|batik-script)'
final Pattern MODULE_REGEX = ~'\\.jar$'
@@ -177,4 +202,4 @@ publishing {
}
}
}
-} \ No newline at end of file
+}