use spaces as indents
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833095 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e59255c99d
commit
3581bba521
380
build.gradle
380
build.gradle
@ -15,20 +15,20 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==================================================================== */
|
==================================================================== */
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://plugins.gradle.org/m2/" }
|
maven { url "https://plugins.gradle.org/m2/" }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.1.2' // 2.x requires Gradle >=4
|
classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.1.2' // 2.x requires Gradle >=4
|
||||||
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5"
|
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only add the plugin for Sonar if enabled
|
// Only add the plugin for Sonar if enabled
|
||||||
if (project.hasProperty('enableSonar')) {
|
if (project.hasProperty('enableSonar')) {
|
||||||
println 'Enabling Sonar support'
|
println 'Enabling Sonar support'
|
||||||
apply plugin: "org.sonarqube"
|
apply plugin: "org.sonarqube"
|
||||||
}
|
}
|
||||||
|
|
||||||
// For help converting an Ant build to a Gradle build, see
|
// For help converting an Ant build to a Gradle build, see
|
||||||
@ -42,22 +42,22 @@ Define properties for all projects, including this one
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
allprojects {
|
allprojects {
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
task wrapper(type: Wrapper) {
|
task wrapper(type: Wrapper) {
|
||||||
gradleVersion = '3.4.1'
|
gradleVersion = '3.4.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
task adjustWrapperPropertiesFile {
|
task adjustWrapperPropertiesFile {
|
||||||
doLast {
|
doLast {
|
||||||
ant.replaceregexp(match:'^#.*', replace:'', flags:'g', byline:true) {
|
ant.replaceregexp(match:'^#.*', replace:'', flags:'g', byline:true) {
|
||||||
fileset(dir: project.projectDir, includes: 'gradle/wrapper/gradle-wrapper.properties')
|
fileset(dir: project.projectDir, includes: 'gradle/wrapper/gradle-wrapper.properties')
|
||||||
}
|
}
|
||||||
new File(project.projectDir, 'gradle/wrapper/gradle-wrapper.properties').with { it.text = it.readLines().findAll { it }.sort().join('\n') }
|
new File(project.projectDir, 'gradle/wrapper/gradle-wrapper.properties').with { it.text = it.readLines().findAll { it }.sort().join('\n') }
|
||||||
ant.fixcrlf(file: 'gradle/wrapper/gradle-wrapper.properties', eol: 'lf')
|
ant.fixcrlf(file: 'gradle/wrapper/gradle-wrapper.properties', eol: 'lf')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wrapper.finalizedBy adjustWrapperPropertiesFile
|
wrapper.finalizedBy adjustWrapperPropertiesFile
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -71,16 +71,16 @@ subprojects {
|
|||||||
apply plugin: 'jacoco'
|
apply plugin: 'jacoco'
|
||||||
|
|
||||||
// See https://github.com/melix/japicmp-gradle-plugin
|
// See https://github.com/melix/japicmp-gradle-plugin
|
||||||
apply plugin: 'me.champeau.gradle.japicmp'
|
apply plugin: 'me.champeau.gradle.japicmp'
|
||||||
|
|
||||||
version = '4.0.0-SNAPSHOT'
|
version = '4.0.0-SNAPSHOT'
|
||||||
ext {
|
ext {
|
||||||
japicmpversion = '3.17'
|
japicmpversion = '3.17'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
options.encoding = 'UTF-8'
|
options.encoding = 'UTF-8'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
|
|
||||||
@ -88,18 +88,18 @@ subprojects {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': version
|
attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': version
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
// Exclude some tests that are not actually tests or do not run cleanly on purpose
|
// Exclude some tests that are not actually tests or do not run cleanly on purpose
|
||||||
exclude '**/BaseTestBorderStyle.class'
|
exclude '**/BaseTestBorderStyle.class'
|
||||||
exclude '**/BaseTestCellUtil.class'
|
exclude '**/BaseTestCellUtil.class'
|
||||||
exclude '**/TestUnfixedBugs.class'
|
exclude '**/TestUnfixedBugs.class'
|
||||||
exclude '**/TestOneFile.class'
|
exclude '**/TestOneFile.class'
|
||||||
|
|
||||||
// set heap size for the test JVM(s)
|
// set heap size for the test JVM(s)
|
||||||
minHeapSize = "128m"
|
minHeapSize = "128m"
|
||||||
@ -124,192 +124,192 @@ subprojects {
|
|||||||
// ensure the build-dir exists
|
// ensure the build-dir exists
|
||||||
projectDir.mkdirs()
|
projectDir.mkdirs()
|
||||||
|
|
||||||
if (project.hasProperty('enableSonar')) {
|
if (project.hasProperty('enableSonar')) {
|
||||||
sonarqube {
|
sonarqube {
|
||||||
properties {
|
properties {
|
||||||
// as we currently use build/<module>/ as project-basedir, we need to tell Sonar to use
|
// as we currently use build/<module>/ as project-basedir, we need to tell Sonar to use
|
||||||
// the root-folder as "basedir" for the projects
|
// the root-folder as "basedir" for the projects
|
||||||
property "sonar.projectBaseDir", "$projectDir/../.."
|
property "sonar.projectBaseDir", "$projectDir/../.."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project('main') {
|
project('main') {
|
||||||
sourceSets.main.java.srcDirs = ['../../src/java']
|
sourceSets.main.java.srcDirs = ['../../src/java']
|
||||||
sourceSets.main.resources.srcDirs = ['../../src/resources/main']
|
sourceSets.main.resources.srcDirs = ['../../src/resources/main']
|
||||||
sourceSets.test.java.srcDirs = ['../../src/testcases']
|
sourceSets.test.java.srcDirs = ['../../src/testcases']
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile 'commons-codec:commons-codec:1.11'
|
|
||||||
compile 'commons-logging:commons-logging:1.2'
|
|
||||||
compile 'org.apache.commons:commons-collections4:4.1'
|
|
||||||
compile 'org.apache.commons:commons-math3:3.6.1'
|
|
||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
dependencies {
|
||||||
}
|
compile 'commons-codec:commons-codec:1.11'
|
||||||
|
compile 'commons-logging:commons-logging:1.2'
|
||||||
// Create a separate jar for test-code to depend on it in other projects
|
compile 'org.apache.commons:commons-collections4:4.1'
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
compile 'org.apache.commons:commons-math3:3.6.1'
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
|
||||||
baseName = "test-${project.archivesBaseName}"
|
|
||||||
from sourceSets.test.output
|
|
||||||
}
|
|
||||||
|
|
||||||
configurations {
|
testCompile 'junit:junit:4.12'
|
||||||
tests
|
}
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
tests testJar
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
}
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
|
baseName = "test-${project.archivesBaseName}"
|
||||||
|
from sourceSets.test.output
|
||||||
|
}
|
||||||
|
|
||||||
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
|
configurations {
|
||||||
|
tests
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
tests testJar
|
||||||
|
}
|
||||||
|
|
||||||
|
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
|
||||||
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
|
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
|
||||||
baseline = 'org.apache.poi:poi:' + japicmpversion + '@jar'
|
baseline = 'org.apache.poi:poi:' + japicmpversion + '@jar'
|
||||||
to = jar.archivePath
|
to = jar.archivePath
|
||||||
onlyModified = true
|
onlyModified = true
|
||||||
onlyBinaryIncompatibleModified = true
|
onlyBinaryIncompatibleModified = true
|
||||||
failOnModification = false
|
failOnModification = false
|
||||||
txtOutputFile = file("$buildDir/reports/japi.txt")
|
txtOutputFile = file("$buildDir/reports/japi.txt")
|
||||||
htmlOutputFile = file("$buildDir/reports/japi.html")
|
htmlOutputFile = file("$buildDir/reports/japi.html")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project('ooxml') {
|
project('ooxml') {
|
||||||
sourceSets.main.java.srcDirs = ['../../src/ooxml/java']
|
sourceSets.main.java.srcDirs = ['../../src/ooxml/java']
|
||||||
sourceSets.main.resources.srcDirs = ['../../src/ooxml/resources', '../../src/resources/ooxml']
|
sourceSets.main.resources.srcDirs = ['../../src/ooxml/resources', '../../src/resources/ooxml']
|
||||||
sourceSets.test.java.srcDirs = ['../../src/ooxml/testcases']
|
sourceSets.test.java.srcDirs = ['../../src/ooxml/testcases']
|
||||||
|
|
||||||
// for now import the ant-task for building the jars from build.xml
|
// 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
|
// we need to rename the tasks as e.g. task "jar" conflicts with :ooxml:jar
|
||||||
ant.importBuild('../../build.xml') { antTargetName ->
|
ant.importBuild('../../build.xml') { antTargetName ->
|
||||||
'ant-' + antTargetName
|
'ant-' + antTargetName
|
||||||
}
|
}
|
||||||
compileJava.dependsOn 'ant-compile-ooxml-xsds'
|
compileJava.dependsOn 'ant-compile-ooxml-xsds'
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile 'org.apache.xmlbeans:xmlbeans:2.6.0'
|
|
||||||
compile 'org.apache.commons:commons-collections4:4.1'
|
|
||||||
compile 'org.apache.commons:commons-math3:3.6.1'
|
|
||||||
compile 'org.apache.commons:commons-compress:1.17'
|
|
||||||
compile 'org.apache.santuario:xmlsec:2.1.0'
|
|
||||||
compile 'org.bouncycastle:bcpkix-jdk15on:1.59'
|
|
||||||
compile 'com.github.virtuald:curvesapi:1.05'
|
|
||||||
|
|
||||||
// for ooxml-lite, should we move this somewhere else?
|
dependencies {
|
||||||
compile 'junit:junit:4.12'
|
compile 'org.apache.xmlbeans:xmlbeans:2.6.0'
|
||||||
|
compile 'org.apache.commons:commons-collections4:4.1'
|
||||||
|
compile 'org.apache.commons:commons-math3:3.6.1'
|
||||||
|
compile 'org.apache.commons:commons-compress:1.17'
|
||||||
|
compile 'org.apache.santuario:xmlsec:2.1.0'
|
||||||
|
compile 'org.bouncycastle:bcpkix-jdk15on:1.59'
|
||||||
|
compile 'com.github.virtuald:curvesapi:1.05'
|
||||||
|
|
||||||
compile project(':main')
|
// for ooxml-lite, should we move this somewhere else?
|
||||||
compile project(':scratchpad') // TODO: get rid of this dependency!
|
compile 'junit:junit:4.12'
|
||||||
compile files('../../ooxml-lib/ooxml-schemas-1.4.jar')
|
|
||||||
compile files('../../ooxml-lib/ooxml-security-1.1.jar')
|
|
||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
|
||||||
testCompile 'org.mockito:mockito-core:2.13.0'
|
|
||||||
testCompile 'org.xmlunit:xmlunit-core:2.5.1'
|
|
||||||
testCompile project(path: ':main', configuration: 'tests')
|
|
||||||
testCompile 'org.openjdk.jmh:jmh-core:1.19'
|
|
||||||
testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.19'
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
|
compile project(':main')
|
||||||
|
compile project(':scratchpad') // TODO: get rid of this dependency!
|
||||||
|
compile files('../../ooxml-lib/ooxml-schemas-1.4.jar')
|
||||||
|
compile files('../../ooxml-lib/ooxml-security-1.1.jar')
|
||||||
|
|
||||||
|
testCompile 'junit:junit:4.12'
|
||||||
|
testCompile 'org.mockito:mockito-core:2.13.0'
|
||||||
|
testCompile 'org.xmlunit:xmlunit-core:2.5.1'
|
||||||
|
testCompile project(path: ':main', configuration: 'tests')
|
||||||
|
testCompile 'org.openjdk.jmh:jmh-core:1.19'
|
||||||
|
testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.19'
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
|
||||||
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
|
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
|
||||||
baseline = 'org.apache.poi:poi-ooxml:' + japicmpversion + '@jar'
|
baseline = 'org.apache.poi:poi-ooxml:' + japicmpversion + '@jar'
|
||||||
to = jar.archivePath
|
to = jar.archivePath
|
||||||
onlyModified = true
|
onlyModified = true
|
||||||
onlyBinaryIncompatibleModified = true
|
onlyBinaryIncompatibleModified = true
|
||||||
failOnModification = false
|
failOnModification = false
|
||||||
txtOutputFile = file("$buildDir/reports/japi.txt")
|
txtOutputFile = file("$buildDir/reports/japi.txt")
|
||||||
htmlOutputFile = file("$buildDir/reports/japi.html")
|
htmlOutputFile = file("$buildDir/reports/japi.html")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project('examples') {
|
project('examples') {
|
||||||
sourceSets.main.java.srcDirs = ['../../src/examples/src']
|
sourceSets.main.java.srcDirs = ['../../src/examples/src']
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':main')
|
compile project(':main')
|
||||||
compile project(':ooxml')
|
compile project(':ooxml')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
project('excelant') {
|
project('excelant') {
|
||||||
sourceSets.main.java.srcDirs = ['../../src/excelant/java']
|
sourceSets.main.java.srcDirs = ['../../src/excelant/java']
|
||||||
sourceSets.main.resources.srcDirs = ['../../src/excelant/resources']
|
sourceSets.main.resources.srcDirs = ['../../src/excelant/resources']
|
||||||
sourceSets.test.java.srcDirs = ['../../src/excelant/testcases']
|
sourceSets.test.java.srcDirs = ['../../src/excelant/testcases']
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile 'org.apache.ant:ant:1.10.1'
|
|
||||||
|
|
||||||
compile project(':main')
|
dependencies {
|
||||||
compile project(':ooxml')
|
compile 'org.apache.ant:ant:1.10.1'
|
||||||
|
|
||||||
testCompile project(path: ':main', configuration: 'tests')
|
compile project(':main')
|
||||||
}
|
compile project(':ooxml')
|
||||||
|
|
||||||
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
|
testCompile project(path: ':main', configuration: 'tests')
|
||||||
|
}
|
||||||
|
|
||||||
|
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
|
||||||
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
|
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
|
||||||
baseline = 'org.apache.poi:poi-excelant:' + japicmpversion + '@jar'
|
baseline = 'org.apache.poi:poi-excelant:' + japicmpversion + '@jar'
|
||||||
to = jar.archivePath
|
to = jar.archivePath
|
||||||
onlyModified = true
|
onlyModified = true
|
||||||
onlyBinaryIncompatibleModified = true
|
onlyBinaryIncompatibleModified = true
|
||||||
failOnModification = false
|
failOnModification = false
|
||||||
txtOutputFile = file("$buildDir/reports/japi.txt")
|
txtOutputFile = file("$buildDir/reports/japi.txt")
|
||||||
htmlOutputFile = file("$buildDir/reports/japi.html")
|
htmlOutputFile = file("$buildDir/reports/japi.html")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project('integrationtest') {
|
project('integrationtest') {
|
||||||
sourceSets.test.java.srcDirs = ['../../src/integrationtest']
|
sourceSets.test.java.srcDirs = ['../../src/integrationtest']
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile 'org.apache.ant:ant:1.10.1'
|
|
||||||
|
|
||||||
compile project(':main')
|
dependencies {
|
||||||
compile project(':ooxml')
|
compile 'org.apache.ant:ant:1.10.1'
|
||||||
compile project(':scratchpad')
|
|
||||||
compile project(':examples')
|
compile project(':main')
|
||||||
|
compile project(':ooxml')
|
||||||
testCompile 'junit:junit:4.12'
|
compile project(':scratchpad')
|
||||||
}
|
compile project(':examples')
|
||||||
|
|
||||||
|
testCompile 'junit:junit:4.12'
|
||||||
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
// exclude these from the normal test-run
|
// exclude these from the normal test-run
|
||||||
exclude '**/TestAllFiles.class'
|
exclude '**/TestAllFiles.class'
|
||||||
exclude '**/*FileHandler.class'
|
exclude '**/*FileHandler.class'
|
||||||
exclude '**/RecordsStresser.class'
|
exclude '**/RecordsStresser.class'
|
||||||
}
|
}
|
||||||
|
|
||||||
task integrationTest(type: Test) {
|
task integrationTest(type: Test) {
|
||||||
// these are just tests used during development of more test-code
|
// these are just tests used during development of more test-code
|
||||||
exclude '**/*FileHandler.class'
|
exclude '**/*FileHandler.class'
|
||||||
exclude '**/RecordStresser.class'
|
exclude '**/RecordStresser.class'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project('scratchpad') {
|
project('scratchpad') {
|
||||||
sourceSets.main.java.srcDirs = ['../../src/scratchpad/src']
|
sourceSets.main.java.srcDirs = ['../../src/scratchpad/src']
|
||||||
sourceSets.main.resources.srcDirs = ['../../src/resources/scratchpad']
|
sourceSets.main.resources.srcDirs = ['../../src/resources/scratchpad']
|
||||||
sourceSets.test.java.srcDirs = ['../../src/scratchpad/testcases']
|
sourceSets.test.java.srcDirs = ['../../src/scratchpad/testcases']
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile project(':main')
|
|
||||||
// cyclic-dependency here: compile project(':ooxml')
|
|
||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
|
||||||
testCompile project(path: ':main', configuration: 'tests')
|
|
||||||
}
|
|
||||||
|
|
||||||
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
|
dependencies {
|
||||||
|
compile project(':main')
|
||||||
|
// cyclic-dependency here: compile project(':ooxml')
|
||||||
|
|
||||||
|
testCompile 'junit:junit:4.12'
|
||||||
|
testCompile project(path: ':main', configuration: 'tests')
|
||||||
|
}
|
||||||
|
|
||||||
|
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
|
||||||
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
|
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
|
||||||
baseline = 'org.apache.poi:poi-scratchpad:' + japicmpversion + '@jar'
|
baseline = 'org.apache.poi:poi-scratchpad:' + japicmpversion + '@jar'
|
||||||
to = jar.archivePath
|
to = jar.archivePath
|
||||||
onlyModified = true
|
onlyModified = true
|
||||||
onlyBinaryIncompatibleModified = true
|
onlyBinaryIncompatibleModified = true
|
||||||
failOnModification = false
|
failOnModification = false
|
||||||
txtOutputFile = file("$buildDir/reports/japi.txt")
|
txtOutputFile = file("$buildDir/reports/japi.txt")
|
||||||
htmlOutputFile = file("$buildDir/reports/japi.html")
|
htmlOutputFile = file("$buildDir/reports/japi.html")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user