diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2021-03-27 14:03:16 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2021-03-27 14:03:16 +0000 |
commit | 37791e4bdfc706aa5684745594260f243b4be7ee (patch) | |
tree | a8dd8d0976fc478074d52cd3de79e0e6b5e6a33a /build.gradle | |
parent | 2bb3839bfe3e3bacff79f8157465633e311239ce (diff) | |
download | poi-37791e4bdfc706aa5684745594260f243b4be7ee.tar.gz poi-37791e4bdfc706aa5684745594260f243b4be7ee.zip |
65206 - Migrate ant / maven to gradle build
update gradle files and project structure along https://github.com/centic9/poi/tree/gradle_build
remove eclipse IDE project files
remove obsolete record generator files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888111 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 210 |
1 files changed, 3 insertions, 207 deletions
diff --git a/build.gradle b/build.gradle index 4247631df4..df2d2ba6d7 100644 --- a/build.gradle +++ b/build.gradle @@ -163,7 +163,7 @@ subprojects { // http://forums.gradle.org/gradle/topics/jacoco_related_failure_in_multiproject_build systemProperties['user.dir'] = workingDir - systemProperties['POI.testdata.path'] = '../../test-data' + systemProperties['POI.testdata.path'] = '../test-data' // this is necessary for JDK 9+ to keep formatting dates the same way as in previous JDK-versions systemProperties['java.locale.providers'] = 'JRE,CLDR' @@ -195,7 +195,7 @@ subprojects { properties { // as we currently use build/<module>/ as project-basedir, we need to tell Sonar to use // the root-folder as "basedir" for the projects - property "sonar.projectBaseDir", "$projectDir/../.." + property "sonar.projectBaseDir", "$projectDir" // currently supported providers on Jenkins: "hg,git": property "sonar.scm.provider", "svn" // the plugin seems to not detect our non-standard build-layout @@ -213,208 +213,4 @@ subprojects { txtOutputFile = file("$buildDir/reports/japi.txt") htmlOutputFile = file("$buildDir/reports/japi.html") } -} - -project('main') { - sourceSets.main.java.srcDirs = ['../../src/java'] - sourceSets.main.resources.srcDirs = ['../../src/resources/main'] - sourceSets.test.java.srcDirs = ['../../src/testcases'] - sourceSets.test.resources.srcDirs = ['../../src/resources/test'] - - dependencies { - implementation "commons-codec:commons-codec:${commonsCodecVersion}" - implementation 'org.apache.commons:commons-collections4:4.4' - implementation "org.apache.commons:commons-math3:${commonsMathVersion}" - implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}" - implementation 'javax.activation:activation:1.1.1' - api 'com.zaxxer:SparseBitSet:1.2' - - testImplementation 'org.reflections:reflections:0.9.12' - } - - jar { - manifest { - attributes 'Automatic-Module-Name': 'org.apache.poi.main' - } - } - - // Create a separate jar for test-code to depend on it in other projects - // See http://stackoverflow.com/questions/5144325/gradle-test-dependency - task testJar(type: Jar, dependsOn: testClasses) { - baseName = "test-${project.archivesBaseName}" - from sourceSets.test.output - } - - configurations { - tests - } - - artifacts { - tests testJar - } - - japicmp.baseline = "org.apache.poi:poi:${japicmpversion}@jar" -} - -project('ooxml') { - - sourceSets.main.java.srcDirs = ['../../src/ooxml/java'] - sourceSets.main.resources.srcDirs = ['../../src/ooxml/resources', '../../src/resources/ooxml'] - sourceSets.test.java.srcDirs = ['../../src/ooxml/testcases'] - sourceSets.test.resources.srcDirs = ['../../src/resources/test'] - - configurations { - antdep - } - - dependencies { - antdep 'org.apache.ant:ant:1.10.9' - } - - // we need to ensure that the custom ant tasks are compiled before we import the build.xml file - ant.mkdir(dir: "../../build/poi-ant-contrib") - ant.javac(srcdir: "../../src/excelant/poi-ant-contrib" - , destdir: "../../build/poi-ant-contrib" - , classpath: configurations.antdep.asPath - , includeantruntime: "true" - , excludes: "Junit5Progress.java" - ) - - // for now import the ant-task for building the jars from build.xml - // we need to rename the tasks as e.g. task "jar" conflicts with :ooxml:jar - ant.importBuild('../../build.xml') { antTargetName -> - 'ant-' + antTargetName - } - compileJava.dependsOn 'ant-compile-ooxml-xsds' - - dependencies { - api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" - implementation 'org.apache.commons:commons-collections4:4.4' - api "org.apache.commons:commons-compress:${commonsCompressVersion}" - api 'org.apache.santuario:xmlsec:2.2.1' - api "org.bouncycastle:bcpkix-jdk15on:${bouncyCastleVersion}" - api 'com.github.virtuald:curvesapi:1.06' - implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}" - - api "org.apache.xmlgraphics:batik-svggen:${batikVersion}" - implementation("org.apache.xmlgraphics:batik-bridge:${batikVersion}") { - exclude group: 'org.apache.xmlgraphics', module: 'batik-script' - } - implementation "org.apache.xmlgraphics:batik-codec:${batikVersion}" - - api 'de.rototor.pdfbox:graphics2d:0.31' - - api project(':main') - api files("../../build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version}.jar") - - testRuntime project(':scratchpad') - testImplementation 'org.xmlunit:xmlunit-core:2.8.0' - testImplementation 'org.reflections:reflections:0.9.12' - testImplementation project(path: ':main', configuration: 'tests') - testImplementation 'org.openjdk.jmh:jmh-core:1.26' - testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.26' - testImplementation 'com.google.guava:guava:30.0-jre' - } - - jar { - manifest { - attributes 'Automatic-Module-Name': 'org.apache.poi.ooxml' - } - } - - japicmp.baseline = "org.apache.poi:poi:${japicmpversion}@jar" - - test { - // for some reason catching the OOM does not work when run from Gradle - exclude '**/MemoryUsage.class' - } -} - -project('examples') { - sourceSets.main.java.srcDirs = ['../../src/examples/src'] - - dependencies { - implementation project(':ooxml') - implementation project(':scratchpad') - - implementation "org.apache.logging.log4j:log4j-core:${log4jVersion}" - } - - japicmp.enabled = false -} - - -project('excelant') { - sourceSets.main.java.srcDirs = ['../../src/excelant/java'] - sourceSets.main.resources.srcDirs = ['../../src/excelant/resources'] - sourceSets.test.java.srcDirs = ['../../src/excelant/testcases'] - sourceSets.test.resources.srcDirs = ['../../src/resources/test'] - - dependencies { - api 'org.apache.ant:ant:1.10.9' - - api project(':ooxml') - - testImplementation project(path: ':main', configuration: 'tests') - } - - jar { - manifest { - attributes 'Automatic-Module-Name': 'org.apache.poi.excelant' - } - } - - japicmp.baseline = "org.apache.poi:poi-excelant:${japicmpversion}@jar" -} - -project('integrationtest') { - sourceSets.test.java.srcDirs = ['../../src/integrationtest'] - sourceSets.test.resources.srcDirs = ['../../src/resources/integrationtest'] - - dependencies { - testImplementation 'org.apache.ant:ant:1.10.9' - - testImplementation project(':ooxml') - testImplementation project(':scratchpad') - testImplementation project(':examples') - - testImplementation files(this.project(':ooxml').sourceSets.test.runtimeClasspath) - } - - jar { - manifest { - attributes 'Automatic-Module-Name': 'org.apache.poi.integrationtest' - } - } - - test { - // exclude these from the normal test-run - exclude '**/*FileHandler.class' - } - - japicmp.enabled = false -} - -project('scratchpad') { - sourceSets.main.java.srcDirs = ['../../src/scratchpad/src'] - sourceSets.main.resources.srcDirs = ['../../src/resources/scratchpad'] - sourceSets.test.java.srcDirs = ['../../src/scratchpad/testcases'] - sourceSets.test.resources.srcDirs = ['../../src/resources/test'] - - dependencies { - api project(':main') - implementation "commons-codec:commons-codec:${commonsCodecVersion}" - implementation "org.apache.commons:commons-math3:${commonsMathVersion}" - implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}" - - testImplementation project(path: ':main', configuration: 'tests') - } - - jar { - manifest { - attributes 'Automatic-Module-Name': 'org.apache.poi.scratchpad' - } - } - - japicmp.baseline = "org.apache.poi:poi:${japicmpversion}@jar" -} +}
\ No newline at end of file |