From 5c6493a5fc76f2e11441d39af05e3f3208283896 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Wed, 1 Sep 2021 22:32:48 +0000 Subject: try to fix no-scratchpad build remove or set-to-static scratchpad dependency from modules git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892795 13f79535-47bb-0310-9956-ffa450edef68 --- poi-examples/build.gradle | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'poi-examples/build.gradle') diff --git a/poi-examples/build.gradle b/poi-examples/build.gradle index fe8feea87f..4aff0b8a6b 100644 --- a/poi-examples/build.gradle +++ b/poi-examples/build.gradle @@ -28,20 +28,29 @@ sourceSets { dependencies { api project(':poi-ooxml') - api project(':poi-scratchpad') +// api project(':poi-scratchpad') implementation project(path: ':poi-ooxml', configuration: 'archives') implementation project(path: ':poi-ooxml-full', configuration: 'archives') - implementation project(path: ':poi-scratchpad', configuration: 'archives') + + if (NO_SCRATCHPAD) { + compileOnly project(path: ':poi-scratchpad', configuration: 'archives') + } else { + implementation project(path: ':poi-scratchpad', configuration: 'archives') + } implementation "org.apache.logging.log4j:log4j-core:${log4jVersion}" - testImplementation project(path: ':poi-ooxml', configuration: 'tests') + testImplementation(project(path: ':poi-ooxml', configuration: 'tests')) { + if (NO_SCRATCHPAD) { + exclude group: 'org.apache.poi', module: 'poi-scratchpad' + } + } testImplementation project(path: ':poi', configuration: 'tests') } final String MODULE_NAME = 'org.apache.poi.examples' final Pattern MODULE_REGEX = ~'\\.jar$' -final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique() +final List MODULE_COMPILE_PATH = sourceSets.main.compileClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique() task compileJava9(type: JavaCompile) { dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar' @@ -53,7 +62,7 @@ task compileJava9(type: JavaCompile) { classpath = files() options.compilerArgs = [ '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}", - '--module-path', files(MAIN_MODULE_PATH).asPath + '--module-path', files(MODULE_COMPILE_PATH).asPath ] } -- cgit v1.2.3