classname: "org.apache.tools.ant.taskdefs.optional.junitlauncher.confined.JUnitLauncherTask",
classpath: configurations.antLibs.asPath)
+
wrapper {
// https://stackoverflow.com/a/54741656/2066598
gradleVersion = '6.8'
Define properties for all projects, including this one
*/
allprojects {
- apply plugin: 'eclipse'
-// apply plugin: 'idea'
+// apply plugin: 'eclipse'
+ apply plugin: 'idea'
}
/**
testImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
}
+ task wrapper(type: Wrapper){
+ // https://stackoverflow.com/a/65701523/2066598
+ gradleVersion = '6.8'
+ }
+
jar {
manifest {
attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': project.version
runtimeOnly "org.apache.logging.log4j:log4j-core:${log4jVersion}"
}
+idea {
+ module {
+ // Marks the already(!) added srcDir as "generated"
+ generatedSourceDirs += file(BEANS_SRC)
+ resourceDirs += file(BEANS_RES)
+ }
+}
+
final Pattern MODULE_REGEX = ~'\\.jar$'
final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
if (!ant.properties.xmlbeans_uptodate) {
ant.xmlbean(
schema: 'build/xsds',
- srcgendir: 'build/generated-sources',
- classgendir: 'build/generated-resources',
+ srcgendir: BEANS_SRC,
+ classgendir: BEANS_RES,
destfile: 'build/xsds.jar',
srconly: true,
failonerror: true,
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
}
}
}
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")
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')