-
Notifications
You must be signed in to change notification settings - Fork 298
/
build.gradle
120 lines (105 loc) · 6.45 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
plugins {
id 'archunit.base-conventions'
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
id 'com.github.spotbugs' version '6.0.26' apply false
id "io.github.gradle-nexus.publish-plugin" version "2.0.0" apply false
id "com.diffplug.spotless" version "6.25.0" apply false
id 'com.github.ben-manes.versions' version '0.51.0' apply false
}
def appAndSourceUrl = 'https://github.com/TNG/ArchUnit'
ext {
year = "${Calendar.getInstance().get(Calendar.YEAR)}"
app = [
name : 'ArchUnit',
urls : [
entry : appAndSourceUrl,
doc : appAndSourceUrl,
issues: "${appAndSourceUrl}/issues",
source: appAndSourceUrl
],
gitRepo: '[email protected]:TNG/ArchUnit.git',
license: [
name: 'The Apache Software License, Version 2.0',
url : 'http://www.apache.org/licenses/LICENSE-2.0.txt'
]
]
company = [
name: 'TNG Technology Consulting GmbH',
url : 'https://www.tngtech.com/'
]
thirdPartyRelocationPackage = 'com.tngtech.archunit.thirdparty'
asmRelocationPackage = "${thirdPartyRelocationPackage}.org.objectweb.asm"
googleRelocationPackage = "${thirdPartyRelocationPackage}.com.google"
dependency = [
asm : [group: 'org.ow2.asm', name: 'asm', version: '9.7.1'],
guava : [group: 'com.google.guava', name: 'guava', version: '33.3.1-jre'],
addGuava : { dependencyHandler ->
dependencyHandler(dependency.guava) {
exclude module: 'listenablefuture'
exclude module: 'jsr305'
exclude module: 'checker-qual'
exclude module: 'error_prone_annotations'
exclude module: 'j2objc-annotations'
}
},
slf4j : [group: 'org.slf4j', name: 'slf4j-api', version: '2.0.16'],
log4j_api : [group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.24.1'],
log4j_core : [group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.24.1'],
log4j_slf4j : [group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: '2.24.1'],
junit4 : [group: 'junit', name: 'junit', version: '4.13.2'],
junit5JupiterApi : [group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.11.2'],
junit5JupiterEngine : [group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.11.2'],
junit5VintageEngine : [group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.11.2'],
junitPlatform : [group: 'org.junit.platform', name: 'junit-platform-runner', version: '1.11.2'],
junitPlatformCommons: [group: 'org.junit.platform', name: 'junit-platform-commons', version: '1.11.2'],
junitPlatformEngine : [group: 'org.junit.platform', name: 'junit-platform-engine', version: '1.11.2'],
hamcrest : [group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'],
junit_dataprovider : [group: 'com.tngtech.java', name: 'junit-dataprovider', version: '1.11.0'],
mockito : [group: 'org.mockito', name: 'mockito-core', version: '4.11.0'], // mockito 5 requires Java 11
mockito_junit5 : [group: 'org.mockito', name: 'mockito-junit-jupiter', version: '4.6.1'],
assertj : [group: 'org.assertj', name: 'assertj-core', version: '3.26.3'],
assertj_guava : [group: 'org.assertj', name: 'assertj-guava', version: '3.26.3'],
// Dependencies for example projects / tests
javaxAnnotationApi : [group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'],
springBeans : [group: 'org.springframework', name: 'spring-beans', version: '5.3.23'],
springBootLoader : [group: 'org.springframework.boot', name: 'spring-boot-loader', version: '2.7.13'],
jakartaInject : [group: 'jakarta.inject', name: 'jakarta.inject-api', version: '2.0.1'],
jakartaAnnotations : [group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '2.1.1'],
guice : [group: 'com.google.inject', name: 'guice', version: '5.1.0'],
// NOTE: The pure javaee-api dependencies are crippled, so to run any test we need to choose a full implementation provider
geronimoEjb : [group: 'org.apache.geronimo.specs', name: 'geronimo-ejb_3.1_spec', version: '1.0.2'],
geronimoJpa : [group: 'org.apache.geronimo.specs', name: 'geronimo-jpa_2.0_spec', version: '1.1'],
jodaTime : [group: 'joda-time', name: 'joda-time', version: '2.12.7'],
joox : [group: 'org.jooq', name: 'joox-java-6', version: '1.6.0']
]
minSupportedJavaVersion = JavaVersion.VERSION_1_8
maxSupportedJavaVersion = JavaVersion.VERSION_17
isTestBuild = project.hasProperty('testJavaVersion')
configuredTestJavaVersion = project.findProperty('testJavaVersion')?.toString()?.with { JavaVersion.toVersion(it) }
assert configuredTestJavaVersion <= maxSupportedJavaVersion:
"Cannot test with ${configuredTestJavaVersion} because it is higher than max supported version ${maxSupportedJavaVersion}"
postfixedJar = { File jarFile, String postfix ->
new File(jarFile.parentFile, jarFile.name.replaceAll(/\.jar$/, "-${postfix}.jar"))
}
tempJar = { File jarFile -> postfixedJar(jarFile, 'tmp') }
productionProjects = [
project(':archunit'),
project(':archunit-junit'),
project(':archunit-junit4'),
project(':archunit-junit5-api'),
project(':archunit-junit5-engine-api'),
project(':archunit-junit5-engine'),
project(':archunit-junit5')]
currentScriptRootOf = { it.buildscript.sourceFile.parentFile }
scriptRelativePath = { context, fileName -> new File(currentScriptRootOf(context), fileName) }
}
description = 'A Java architecture test library, to specify and assert architecture rules in plain Java'
task showJdkVersion {
println "Configured JDK: ${JavaVersion.current()}"
}
task clean {
doLast {
project.buildDir.deleteDir()
}
}
apply from: 'build-steps/build-steps.gradle'