-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
144 lines (117 loc) · 4.37 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'application'
application {
mainClass = 'org.dstadler.poi.TestCloseBehavior'
}
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Reproduce some behavior of Apache POI against different versions', 'Implementation-Version': archiveVersion
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
maven { url 'https://repository.apache.org/content/groups/staging/'}
// for testing upcoming log4j versions: maven { url 'https://repository.apache.org/content/repositories/orgapachelogging-1308/'}
}
// this is the version of the jar-files of Apache POI that are used for testing
if (!project.hasProperty('poiVersion')) {
ext.poiVersion = '5.3.0'
}
if (!project.hasProperty('closeTest')) {
ext.closeTest = 'stream'
}
if (!project.hasProperty('poiDir')) {
ext.poiDir = '/opt/poi'
}
if (!project.hasProperty('compressTemp')) {
ext.compressTemp = 'true'
}
if (!project.hasProperty('sharedStringTable')) {
ext.sharedStringTable = 'true'
}
ext {
isWindows = org.gradle.internal.os.OperatingSystem.current().windows
}
/*
if (!project.hasProperty('log4jApi')) {
ext.log4jApi = '2.24.0'
}
if (!project.hasProperty('log4jCore')) {
ext.log4jCore = '2.24.0'
}
// use this if you want to force versions of some third party library for testing
configurations.configureEach {
resolutionStrategy {
force 'org.apache.logging.log4j:log4j-api:' + log4jApi
force 'org.apache.logging.log4j:log4j-core:' + log4jCore
}
}*/
dependencies {
implementation 'org.apache.poi:poi:' + poiVersion
implementation 'org.apache.poi:poi-ooxml:' + poiVersion
/* // Testing with latest trunk-POI
implementation files(poiDir + '/lib/main/commons-collections4-4.4.jar')
implementation files(poiDir + '/lib/main/commons-math3-3.6.1.jar')
implementation files(poiDir + '/lib/main/SparseBitSet-1.3.jar')
implementation files(poiDir + '/lib/ooxml/xmlbeans-5.1.1.jar')
implementation files(poiDir + '/build/dist/maven/poi/poi-' + poiVersion + '.jar')
implementation files(poiDir + '/build/dist/maven/poi-ooxml/poi-ooxml-' + poiVersion + '.jar')
//compile files(poiDir + '/build/dist/maven/poi-ooxml-lite/poi-ooxml-lite-' + poiVersion + '.jar')
implementation files(poiDir + '/build/dist/maven/poi-ooxml-full/poi-ooxml-full-' + poiVersion + '.jar')
implementation files(poiDir + '/build/dist/maven/poi-scratchpad/poi-scratchpad-' + poiVersion + '.jar')
implementation 'commons-io:commons-io:2.18.0'
implementation 'org.apache.commons:commons-compress:1.27.1'
*/
implementation 'org.apache.logging.log4j:log4j-core:2.24.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.4'
}
test {
useJUnitPlatform()
}
wrapper {
gradleVersion = '8.5'
}
jacoco {
toolVersion = '0.8.12'
}
tasks.register('runClose', JavaExec) {
dependsOn compileJava
description = 'Performs a check with file-leak-detector and the test application'
jvmArgs = [
'-Xmx512m',
//'-javaagent:/opt/file-leak-detector/target/file-leak-detector-1.19-SNAPSHOT-jar-with-dependencies.jar=http=0,strong,excludes=/opt/apache/poi/git-svn/file-leak-detector.exclude,dumpatshutdown',
'-XX:+HeapDumpOnOutOfMemoryError', '-XX:HeapDumpPath=/tmp'
]
mainClass = 'org.dstadler.poi.TestCloseBehavior'
args = [closeTest]
classpath = sourceSets.main.runtimeClasspath
}
tasks.register('runWriteFile', JavaExec) {
dependsOn compileJava
description = 'Writes a file via SXSSF, this allows to compare resulting files between versions'
jvmArgs = [
'-Xmx512m',
//'-javaagent:/opt/file-leak-detector/target/file-leak-detector-1.19-SNAPSHOT-jar-with-dependencies.jar=http=0,strong,excludes=/opt/apache/poi/git-svn/file-leak-detector.exclude,dumpatshutdown',
'-XX:+HeapDumpOnOutOfMemoryError', '-XX:HeapDumpPath=/tmp'
]
mainClass = 'org.dstadler.poi.TestSXSSFWorkbook'
args = [
(isWindows ? "C:/Temp/test-" : "/tmp/test-") + poiVersion + "-" + compressTemp + "-" + sharedStringTable + ".xlsx",
compressTemp,
sharedStringTable
]
classpath = sourceSets.main.runtimeClasspath
}