-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
187 lines (165 loc) · 6.34 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
plugins {
id "de.abas.esdk" version "1.2.6"
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'idea'
}
repositories {
exclusiveContent {
forRepository {
flatDir {
// mapped directory containing homedir libs
dirs 'erpsync/homedir/lib'
}
}
filter {
// restrict this repository to lookup homedir libs only
includeGroup('de.abas.homedir')
}
}
exclusiveContent {
forRepository {
flatDir {
// mapped directory containing clientdir libs
dirs 'erpsync/clientdir/lib'
}
}
filter {
// restrict this repository to lookup clientdir libs only
includeGroup('de.abas.clientdir')
}
}
maven {
url "https://registry.abas.sh/artifactory/abas.maven-public/"
}
}
task instrument(dependsOn: [classes, project.configurations.jacocoAnt]) {
inputs.files classes.outputs.files
File outputDir = new File(project.buildDir, 'instrumentedClasses')
outputs.dir outputDir
doFirst {
project.delete(outputDir)
ant.taskdef(
resource: 'org/jacoco/ant/antlib.xml',
classpath: project.configurations.jacocoAnt.asPath,
uri: 'jacoco'
)
def instrumented = false
if (file(sourceSets.main.java.outputDir).exists()) {
def instrumentedClassedDir = "${outputDir}/${sourceSets.main.java}"
ant.'jacoco:instrument'(destdir: instrumentedClassedDir) {
fileset(dir: sourceSets.main.java.outputDir, includes: '**/*.class')
}
//Replace the classes dir in the test classpath with the instrumented one
sourceSets.test.runtimeClasspath -= files(sourceSets.main.java.outputDir)
sourceSets.test.runtimeClasspath += files(instrumentedClassedDir)
instrumented = true
}
if (instrumented) {
//Disable class verification based on https://github.com/jayway/powermock/issues/375
test.jvmArgs += '-noverify'
}
}
}
test.dependsOn instrument
test {
jacoco {
excludes += ['**/*']
}
}
coveralls {
jacocoReportPath 'build/reports/jacoco/calculateCodeCoverage/calculateCodeCoverage.xml'
}
calculateCodeCoverage {
reports {
xml.enabled true
}
finalizedBy tasks.coveralls
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
testLogging {
events('passed', 'skipped', 'failed')
}
}
group = 'de.abas.esdk.g30l0'
configurations { compile.extendsFrom provided }
// Create flag to simplify ERP version specific configuration settings below.
// Useful to select different AJO libraries or 'esdk.app.essentialsVersions'.
// 'targetErpVersion' can be provided in 'gradle.properties' or as command line parameter.
// Default is a version below '2101' (i.e. before ERP 21 SP).
Boolean useErp21SPLibs = targetErpVersion.majorVersion >= 2101
group = 'myap'
// Always generate code for Java 8
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
dependencies {
constraints {
implementation("org.apache.logging.log4j:log4j-core") {
version {
strictly("[2.17, 3[")
prefer("2.17.1")
}
because("CVE-2021-44228, CVE-2021-45046, CVE-2021-45105: " +
"Log4j vulnerable to remote code execution and other critical security vulnerabilities")
}
}
if (useErp21SPLibs) {
// Some libraries have been renamed in ERP 21 SP - here we use the new names
// AJO interfaces
provided 'erpsync.homedir.lib:abas-ajo-db:1.0.0'
provided 'erpsync.homedir.lib:abas-ajo-common-type-enums-base:1.0.0'
provided 'erpsync.homedir.lib:abas-ajo-common-type-enums-standard:1.0.0'
provided 'erpsync.homedir.lib:abas-ajo-common:1.0.0'
provided 'erpsync.homedir.lib:abas-jfop-rt-api:1.0.0'
implementation 'erpsync.homedir.lib:abas-ajo-axi2:1.0.0'
// AJO-AXI classes
implementation 'erpsync.homedir.lib:abas-ajo-axi:1.0.0'
// AJO interface implementation
implementation 'erpsync.homedir.lib:abas-ajo-db-internal:1.0.0'
// Helper classes for AJO framework an generator
//implementation 'erpsync.homedir.lib:abas-ajo-db-common:1.0.0'
// Helper classes to handle selections, fields, meta data, buffers, and contexts
implementation 'erpsync.homedir.lib:abas-ajo-db-util:1.0.0'
} else {
provided "de.abas.homedir:abas-db-base:1.0.0"
provided "de.abas.homedir:abas-jfop-runtime-api:1.0.0"
provided "de.abas.homedir:abas-erp-common:1.0.0"
provided "de.abas.homedir:abas-enums:1.0.0"
implementation "de.abas.homedir:abas-axi2:1.0.0"
implementation "de.abas.homedir:abas-axi:1.0.0"
implementation "de.abas.homedir:abas-db-internal:1.0.0"
implementation "de.abas.homedir:abas-db-util:1.0.0"
}
provided "de.abas.homedir:jedp:1.0.0"
provided("de.abas.homedir:log4j:1.0.0")
implementation "de.abas.clientdir:abas-db:1.0.0-SNAPSHOT"
implementation "de.abas.clientdir:abas-db-index:1.0.0-SNAPSHOT"
implementation "de.abas.clientdir:abas-db-infosys:1.0.0-SNAPSHOT"
implementation "fr.dudie:nominatim-api:3.4"
runtimeOnly "de.abas.homedir:abas-jfop-base:1.0.0"
runtimeOnly "de.abas.homedir:commons-collections:1.0.0"
runtimeOnly "de.abas.homedir:jcl-over-slf4j:1.0.0"
runtimeOnly "de.abas.homedir:slf4j-api:1.0.0"
implementation(platform('org.junit:junit-bom:5.9.0')) {
because("Platform, Jupiter, and Vintage versions should match")
}
// JUnit Vintage
testImplementation("junit:junit:4.13.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine") {
because("allows JUnit 3 and JUnit 4 tests to run")
}
testImplementation "org.hamcrest:hamcrest-all:1.3"
testImplementation "de.abas.esdk.test.util:esdk-test-utils:0.0.9"
testImplementation "org.mockito:mockito-all:1.10.19"
testImplementation "org.powermock:powermock-module-junit4:1.6.2"
testImplementation "org.powermock:powermock-api-mockito:1.6.2"
}
idea {
module {
testSourceDirs += project.sourceSets.integTest.allSource.srcDirs
testSourceDirs += project.sourceSets.integTest.resources.srcDirs
}
}