2016-09-22 09:21:56 +00:00
|
|
|
/* ====================================================================
|
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
==================================================================== */
|
2016-10-14 20:46:30 +00:00
|
|
|
buildscript {
|
2018-06-07 05:58:10 +00:00
|
|
|
repositories {
|
|
|
|
|
maven { url "https://plugins.gradle.org/m2/" }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2020-10-25 16:07:12 +00:00
|
|
|
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.0"
|
2018-06-07 05:58:10 +00:00
|
|
|
}
|
2016-10-14 20:46:30 +00:00
|
|
|
}
|
2016-09-22 09:21:56 +00:00
|
|
|
|
2018-06-30 20:40:53 +00:00
|
|
|
repositories {
|
|
|
|
|
mavenCentral()
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-15 18:39:18 +00:00
|
|
|
// Only add the plugin for Sonar if enabled
|
2017-03-10 20:13:46 +00:00
|
|
|
if (project.hasProperty('enableSonar')) {
|
2018-06-07 05:58:10 +00:00
|
|
|
println 'Enabling Sonar support'
|
|
|
|
|
apply plugin: "org.sonarqube"
|
2017-03-10 20:13:46 +00:00
|
|
|
}
|
2016-12-26 20:47:29 +00:00
|
|
|
|
2016-09-22 09:21:56 +00:00
|
|
|
// For help converting an Ant build to a Gradle build, see
|
|
|
|
|
// https://docs.gradle.org/current/userguide/ant.html
|
|
|
|
|
|
2018-06-30 20:36:47 +00:00
|
|
|
configurations {
|
2020-12-25 19:19:32 +00:00
|
|
|
antLibs {
|
|
|
|
|
attributes {
|
|
|
|
|
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling, Bundling.EXTERNAL))
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-30 20:36:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2020-12-25 19:19:32 +00:00
|
|
|
antLibs("org.junit.jupiter:junit-jupiter:5.7.0")
|
|
|
|
|
antLibs("org.apache.ant:ant-junitlauncher:1.10.9")
|
2018-06-30 20:36:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ant.taskdef(name: "junit",
|
2020-12-25 19:19:32 +00:00
|
|
|
classname: "org.apache.tools.ant.taskdefs.optional.junitlauncher.confined.JUnitLauncherTask",
|
2018-06-30 20:36:47 +00:00
|
|
|
classpath: configurations.antLibs.asPath)
|
|
|
|
|
|
2019-10-26 05:26:56 +00:00
|
|
|
wrapper {
|
2021-01-18 17:58:03 +00:00
|
|
|
gradleVersion = '6.8'
|
2019-10-26 05:26:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task adjustWrapperPropertiesFile {
|
2020-05-27 20:27:38 +00:00
|
|
|
doLast {
|
|
|
|
|
ant.replaceregexp(match:'^#.*', replace:'', flags:'g', byline:true) {
|
|
|
|
|
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') }
|
|
|
|
|
ant.fixcrlf(file: 'gradle/wrapper/gradle-wrapper.properties', eol: 'lf')
|
|
|
|
|
}
|
2019-10-26 05:26:56 +00:00
|
|
|
}
|
|
|
|
|
wrapper.finalizedBy adjustWrapperPropertiesFile
|
2016-10-07 19:33:11 +00:00
|
|
|
|
|
|
|
|
/**
|
2020-05-27 20:27:38 +00:00
|
|
|
Define properties for all projects, including this one
|
|
|
|
|
*/
|
2016-10-07 19:33:11 +00:00
|
|
|
allprojects {
|
2018-06-07 05:58:10 +00:00
|
|
|
apply plugin: 'eclipse'
|
2016-10-07 19:33:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
2020-05-27 20:27:38 +00:00
|
|
|
Define things that are only necessary in sub-projects, but not in the master-project itself
|
2016-10-07 19:33:11 +00:00
|
|
|
|
2020-05-27 20:27:38 +00:00
|
|
|
*/
|
2016-10-07 19:33:11 +00:00
|
|
|
subprojects {
|
|
|
|
|
//Put instructions for each sub project, but not the master
|
2021-03-14 20:43:43 +00:00
|
|
|
apply plugin: 'java-library'
|
2016-10-07 19:33:11 +00:00
|
|
|
apply plugin: 'jacoco'
|
2016-10-14 20:46:30 +00:00
|
|
|
|
2021-01-17 18:24:31 +00:00
|
|
|
version = '5.0.1-SNAPSHOT'
|
2018-06-07 05:58:10 +00:00
|
|
|
ext {
|
2021-02-13 14:49:40 +00:00
|
|
|
bouncyCastleVersion = '1.68'
|
2020-10-22 22:51:31 +00:00
|
|
|
commonsCodecVersion = '1.15'
|
2020-02-14 23:00:49 +00:00
|
|
|
commonsCompressVersion = '1.20'
|
|
|
|
|
commonsMathVersion = '3.6.1'
|
2020-12-25 19:19:32 +00:00
|
|
|
junitVersion = '5.7.0'
|
2021-02-21 20:57:25 +00:00
|
|
|
log4jVersion = '2.14.0'
|
2020-11-11 21:53:05 +00:00
|
|
|
mockitoVersion = '3.6.0'
|
2021-01-03 18:19:55 +00:00
|
|
|
hamcrestVersion = '2.2'
|
2021-03-08 22:36:08 +00:00
|
|
|
xmlbeansVersion = '5.0.0'
|
2021-03-14 18:51:12 +00:00
|
|
|
batikVersion = '1.14'
|
2018-06-07 05:58:10 +00:00
|
|
|
}
|
2016-10-07 19:33:11 +00:00
|
|
|
|
2018-06-07 05:58:10 +00:00
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
|
}
|
2016-10-07 19:33:11 +00:00
|
|
|
|
2017-09-15 18:39:18 +00:00
|
|
|
sourceCompatibility = 1.8
|
2020-12-25 19:19:32 +00:00
|
|
|
targetCompatibility = 1.8
|
2016-10-07 19:33:11 +00:00
|
|
|
|
|
|
|
|
repositories {
|
2019-03-21 09:38:21 +00:00
|
|
|
mavenCentral()
|
2019-03-21 09:34:04 +00:00
|
|
|
maven {
|
2019-03-26 23:41:53 +00:00
|
|
|
url 'https://repository.apache.org/content/repositories/releases'
|
2019-03-21 09:34:04 +00:00
|
|
|
}
|
2016-10-07 19:33:11 +00:00
|
|
|
}
|
|
|
|
|
|
2021-01-03 18:19:55 +00:00
|
|
|
dependencies {
|
2021-03-14 20:43:43 +00:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
|
|
|
|
|
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
|
|
|
|
|
testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}"
|
|
|
|
|
testImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
|
2021-01-03 18:19:55 +00:00
|
|
|
}
|
|
|
|
|
|
2018-06-07 05:58:10 +00:00
|
|
|
jar {
|
|
|
|
|
manifest {
|
|
|
|
|
attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': version
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-07 19:33:11 +00:00
|
|
|
|
|
|
|
|
test {
|
2021-01-03 17:02:24 +00:00
|
|
|
// make XML test-results available for Jenkins CI
|
|
|
|
|
useJUnitPlatform()
|
|
|
|
|
reports {
|
|
|
|
|
junitXml.enabled = true
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-07 05:58:10 +00:00
|
|
|
// Exclude some tests that are not actually tests or do not run cleanly on purpose
|
|
|
|
|
exclude '**/BaseTestBorderStyle.class'
|
|
|
|
|
exclude '**/BaseTestCellUtil.class'
|
|
|
|
|
exclude '**/TestUnfixedBugs.class'
|
|
|
|
|
exclude '**/TestOneFile.class'
|
2020-09-09 07:05:56 +00:00
|
|
|
|
2018-08-23 20:23:30 +00:00
|
|
|
// Exclude Test Suites
|
|
|
|
|
exclude '**/All*Tests.class'
|
|
|
|
|
exclude '**/HSSFTests.class'
|
|
|
|
|
|
2016-10-07 19:33:11 +00:00
|
|
|
// set heap size for the test JVM(s)
|
|
|
|
|
minHeapSize = "128m"
|
|
|
|
|
maxHeapSize = "768m"
|
2018-02-08 19:34:22 +00:00
|
|
|
|
|
|
|
|
// Specifying the local via system properties did not work, so we set them this way
|
|
|
|
|
jvmArgs '-Duser.language=en -Duser.country=US'
|
2020-02-13 23:26:54 +00:00
|
|
|
|
2016-10-07 19:33:11 +00:00
|
|
|
// show standard out and standard error of the test JVM(s) on the console
|
|
|
|
|
//testLogging.showStandardStreams = true
|
|
|
|
|
|
|
|
|
|
// http://forums.gradle.org/gradle/topics/jacoco_related_failure_in_multiproject_build
|
|
|
|
|
systemProperties['user.dir'] = workingDir
|
2020-02-13 23:26:54 +00:00
|
|
|
|
2021-03-27 14:03:16 +00:00
|
|
|
systemProperties['POI.testdata.path'] = '../test-data'
|
2020-02-13 23:26:54 +00:00
|
|
|
|
2018-08-26 11:41:31 +00:00
|
|
|
// this is necessary for JDK 9+ to keep formatting dates the same way as in previous JDK-versions
|
|
|
|
|
systemProperties['java.locale.providers'] = 'JRE,CLDR'
|
2021-02-26 21:15:12 +00:00
|
|
|
|
2021-03-14 11:31:18 +00:00
|
|
|
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'false'
|
2016-10-07 19:33:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jacoco {
|
2020-09-25 19:39:49 +00:00
|
|
|
toolVersion = '0.8.6'
|
2016-10-07 19:33:11 +00:00
|
|
|
}
|
2020-02-13 23:26:54 +00:00
|
|
|
|
2020-10-25 16:07:44 +00:00
|
|
|
jacocoTestReport {
|
|
|
|
|
reports {
|
|
|
|
|
xml.enabled true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-14 20:46:30 +00:00
|
|
|
// ensure the build-dir exists
|
|
|
|
|
projectDir.mkdirs()
|
2017-03-13 13:20:51 +00:00
|
|
|
|
2018-06-07 05:58:10 +00:00
|
|
|
if (project.hasProperty('enableSonar')) {
|
2020-11-01 09:21:29 +00:00
|
|
|
// See https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-gradle/ and
|
|
|
|
|
// https://docs.sonarqube.org/display/SONARQUBE52/Analyzing+with+SonarQube+Scanner+for+Gradle
|
|
|
|
|
// for documentation of properties.
|
|
|
|
|
//
|
|
|
|
|
// Some additional properties are currently set in the Jenkins-DSL, see jenksin/create_jobs.groovy
|
|
|
|
|
//
|
2018-06-07 05:58:10 +00:00
|
|
|
sonarqube {
|
|
|
|
|
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
|
2021-03-27 14:03:16 +00:00
|
|
|
property "sonar.projectBaseDir", "$projectDir"
|
2020-11-01 09:21:29 +00:00
|
|
|
// currently supported providers on Jenkins: "hg,git": property "sonar.scm.provider", "svn"
|
2020-10-25 17:40:48 +00:00
|
|
|
|
|
|
|
|
// the plugin seems to not detect our non-standard build-layout
|
|
|
|
|
property "sonar.junit.reportPaths", "$projectDir/build/test-results/test"
|
2020-10-25 19:30:28 +00:00
|
|
|
property "sonar.coverage.jacoco.xmlReportPaths", "$projectDir/build/reports/jacoco/test/jacocoTestReport.xml"
|
2018-06-07 05:58:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-03-27 14:03:16 +00:00
|
|
|
}
|