-
Notifications
You must be signed in to change notification settings - Fork 282
/
build.gradle
59 lines (51 loc) · 2.08 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
plugins {
id 'archunit.java-release-conventions'
}
ext.moduleName = 'com.tngtech.archunit.junit4'
dependencies {
api project(path: ':archunit', configuration: 'shadow')
api project(path: ':archunit-junit', configuration: 'archJunitApi')
api dependency.junit4
implementation project(path: ':archunit-junit', configuration: 'shadow')
dependency.addGuava { dependencyNotation, config -> implementation(dependencyNotation, config) }
implementation dependency.slf4j
testImplementation dependency.log4j_api
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
testImplementation dependency.junit4
testImplementation dependency.junit_dataprovider
testImplementation dependency.mockito
testImplementation dependency.assertj
testImplementation(dependency.assertj_guava) {
exclude module: 'assertj-core'
exclude module: 'guava'
}
testImplementation project(path: ':archunit', configuration: 'tests')
testImplementation project(path: ':archunit-junit', configuration: 'tests')
// This is a hack for running tests with IntelliJ instead of delegating to Gradle,
// because for some reason this dependency cannot be resolved otherwise :-(
testRuntimeOnly dependency.asm
}
javadoc {
source(['archJunitApi', 'main'].collect { project(':archunit-junit').sourceSets[it].allJava })
}
sourcesJar {
['archJunitApi', 'main'].each {
from project(':archunit-junit').sourceSets[it].allSource
}
}
shadowJar {
exclude 'META-INF/**'
dependencies {
exclude(project(':archunit'))
exclude(dependency(dependency.junit4))
exclude(dependency(dependency.slf4j))
exclude(dependency(dependency.hamcrest)) // Shadow doesn't respect transitive excludes :-(
}
}
def configureDependencies = { deps ->
deps.children().removeIf { dep ->
dep.scope.text() != 'compile' || !(dep.artifactId.text() in ['archunit', 'archunit-junit5-api', 'archunit-junit5-engine-api', 'junit'])
}
}
this.with project(':archunit-junit').configureJUnitArchive(configureDependencies)