2021-04-07 17:40:33 -04: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.
|
|
|
|
==================================================================== */
|
|
|
|
|
|
|
|
import java.util.regex.Pattern
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
2022-02-21 17:57:03 -05:00
|
|
|
if (jdkVersion > 8) {
|
2021-04-07 17:40:33 -04:00
|
|
|
output.dir(JAVA9_OUT, builtBy: 'cacheJava9')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
api project(':poi-ooxml')
|
2021-09-05 09:56:30 -04:00
|
|
|
implementation project(path: ':poi', configuration: 'archives')
|
2021-09-05 11:02:44 -04:00
|
|
|
compileOnly project(path: ':poi-ooxml', configuration: 'archives')
|
2021-09-05 10:00:21 -04:00
|
|
|
compileOnly project(path: ':poi-ooxml-full', configuration: 'archives')
|
2021-09-01 18:32:48 -04:00
|
|
|
|
|
|
|
if (NO_SCRATCHPAD) {
|
|
|
|
compileOnly project(path: ':poi-scratchpad', configuration: 'archives')
|
|
|
|
} else {
|
|
|
|
implementation project(path: ':poi-scratchpad', configuration: 'archives')
|
|
|
|
}
|
2021-04-07 17:40:33 -04:00
|
|
|
|
2021-12-20 14:38:23 -05:00
|
|
|
implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
|
2021-04-07 17:40:33 -04:00
|
|
|
|
2021-09-23 15:03:06 -04:00
|
|
|
testImplementation(project(path: ':poi-ooxml', configuration: 'tests')) {
|
2021-09-01 18:32:48 -04:00
|
|
|
if (NO_SCRATCHPAD) {
|
|
|
|
exclude group: 'org.apache.poi', module: 'poi-scratchpad'
|
|
|
|
}
|
|
|
|
}
|
2021-09-23 15:03:06 -04:00
|
|
|
testImplementation project(path: ':poi', configuration: 'tests')
|
2021-11-25 05:05:00 -05:00
|
|
|
|
|
|
|
if (SAXON_TEST) {
|
2021-11-25 05:31:50 -05:00
|
|
|
testRuntimeOnly "net.sf.saxon:Saxon-HE:${saxonVersion}"
|
2021-11-25 05:05:00 -05:00
|
|
|
}
|
2021-04-07 17:40:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
final String MODULE_NAME = 'org.apache.poi.examples'
|
|
|
|
final Pattern MODULE_REGEX = ~'\\.jar$'
|
2021-09-01 18:32:48 -04:00
|
|
|
final List MODULE_COMPILE_PATH = sourceSets.main.compileClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
|
2021-04-07 17:40:33 -04:00
|
|
|
|
|
|
|
task compileJava9(type: JavaCompile) {
|
|
|
|
dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
|
|
|
|
|
2022-02-21 17:57:03 -05:00
|
|
|
javaCompiler = javaToolchains.compilerFor {
|
|
|
|
languageVersion = JavaLanguageVersion.of(jdkVersion)
|
|
|
|
if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor)
|
|
|
|
}
|
|
|
|
|
2021-04-07 17:40:33 -04:00
|
|
|
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
|
|
|
source = file(JAVA9_SRC)
|
|
|
|
classpath = files()
|
|
|
|
options.compilerArgs = [
|
|
|
|
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
|
2021-09-01 18:32:48 -04:00
|
|
|
'--module-path', files(MODULE_COMPILE_PATH).asPath
|
2021-04-07 17:40:33 -04:00
|
|
|
]
|
2022-02-21 17:57:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
onlyIf {
|
|
|
|
jdkVersion > 8
|
|
|
|
}
|
2021-04-07 17:40:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
task cacheJava9(type: Copy) {
|
|
|
|
dependsOn 'compileJava9'
|
|
|
|
|
|
|
|
from(file(JAVA9_OUT + VERSIONS9))
|
|
|
|
into(JAVA9_SRC)
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
2021-08-28 19:48:48 -04:00
|
|
|
dependsOn cacheJava9
|
|
|
|
|
2021-04-07 17:40:33 -04:00
|
|
|
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
|
|
|
|
2022-02-21 17:57:03 -05:00
|
|
|
if (jdkVersion == 8) {
|
2021-04-07 17:40:33 -04:00
|
|
|
into('META-INF/versions/9') {
|
|
|
|
from JAVA9_SRC include '*.class'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
|
|
|
}
|
|
|
|
}
|
2021-10-25 18:29:10 -04:00
|
|
|
|
|
|
|
javadocJar {
|
|
|
|
metaInf {
|
|
|
|
from("$projectDir/../legal/LICENSE")
|
|
|
|
from("$projectDir/../legal/NOTICE")
|
|
|
|
}
|
|
|
|
}
|
2021-10-25 18:50:03 -04:00
|
|
|
|
|
|
|
sourcesJar {
|
|
|
|
metaInf {
|
|
|
|
from("$projectDir/../legal/LICENSE")
|
|
|
|
from("$projectDir/../legal/NOTICE")
|
|
|
|
}
|
|
|
|
}
|