diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2021-04-18 22:11:26 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2021-04-18 22:11:26 +0000 |
commit | 27e0842bcce8bef7125bfbe0d7ffd049acb27d7b (patch) | |
tree | 4870880e9439f3082fa088213a5396b34634aec1 /poi-ooxml-lite | |
parent | 9392b464e3b707b8ee544d0b03ffb106ea5ee0a8 (diff) | |
download | poi-27e0842bcce8bef7125bfbe0d7ffd049acb27d7b.tar.gz poi-27e0842bcce8bef7125bfbe0d7ffd049acb27d7b.zip |
fix gradle builds to better comply with IntelliJ
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888936 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml-lite')
-rw-r--r-- | poi-ooxml-lite/build.gradle | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/poi-ooxml-lite/build.gradle b/poi-ooxml-lite/build.gradle index da40c6d1e8..8dd452f5eb 100644 --- a/poi-ooxml-lite/build.gradle +++ b/poi-ooxml-lite/build.gradle @@ -28,14 +28,20 @@ plugins { final String JAVA9_SRC = 'src/main/java9' final String JAVA9_OUT = "${buildDir}/classes/java9/main/" final String VERSIONS9 = 'META-INF/versions/9' +final String BEANS_SRC = "${buildDir}/generated-sources" +final String BEANS_RES = "${buildDir}/generated-resources" sourceSets { main { if (JavaVersion.current() != JavaVersion.VERSION_1_8) { output.dir(JAVA9_OUT, builtBy: 'cacheJava9') } + compileClasspath += files(BEANS_RES) + java { + srcDirs += BEANS_SRC + } resources { - srcDirs += project(':poi-ooxml-full').sourceSets.main.output.findAll{it =~ /.*(classes\/java\/main|generated-resources)$/} + srcDirs += BEANS_RES } } } @@ -51,7 +57,8 @@ final Pattern MODULE_REGEX = ~'\\.jar$' final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique() final String OOXML_LITE_REPORT = '../build/ooxml-lite-report' -task compileOoxmlLite() { + +task compileOoxmlLite(type: Copy) { dependsOn ':poi-ooxml:build', ':poi-integration:build', ':poi-excelant:build' File fileIn = file("${OOXML_LITE_REPORT}.clazz") @@ -62,6 +69,14 @@ task compileOoxmlLite() { ant.properties.ooxmlLiteUnchanged } + // copy re-/sources to modules own directory to pacify IntelliJ, which doesn't like the same source dir in multiple modules + from(project(':poi-ooxml-full').buildDir) { + include 'generated-sources/**' + include 'generated-resources/**' + include 'classes/java/main/**' + } + into(buildDir) + doLast { String header = fileOut.collect().findAll { !(it =~ /exports|}/) }.join('\n') |