-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
151 lines (134 loc) · 4.88 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
plugins {
id 'io.github.goooler.shadow' version '8.1.8' apply false
id 'de.undercouch.download' version '5.4.0'
id 'io.freefair.aspectj' version '8.4' apply false
id 'me.champeau.mrjar' version '0.1.1'
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
}
ext {
isSnapshot = version.endsWith('SNAPSHOT')
isReleaseVersion = !isSnapshot
starterProjects = subprojects.findAll { it.name.startsWith("today-starter") }
moduleProjects = subprojects.findAll { it.name.startsWith("today-") && !it.name.startsWith("today-starter") } + [
project(":infra-build:infra-annotation-config-processor"),
project(":infra-build:infra-configuration-processor"),
project(":infra-build:infra-app-loader"),
project(":infra-build:infra-app-loader-tools"),
project(":infra-build:infra-jarmode-layertools"),
project(":infra-build:infra-gradle-plugin"),
project(":infra-build:infra-maven-plugin")
]
javaProjects = subprojects - starterProjects - [
project(":infra-build:infra-code-coverage"),
project(":infra-bom"), project(":infra-build"), project(":infra-dependencies"),
]
testFixturesProjects = [
project(":today-core"),
project(":today-aop"),
project(":today-beans"),
project(":today-context"),
project(":today-jcache"),
project(":today-web"),
project(":today-test"),
project(":today-tx"),
project(":today-core-aot")
] as Set
}
configure(allprojects) {
group = "cn.taketoday"
if (it.hasProperty("skipDocs")) {
it.afterEvaluate {
it.getTasks().matching(task -> {
return JavaBasePlugin.DOCUMENTATION_GROUP == task.getGroup()
|| "distribution" == task.getGroup()
}).forEach(task -> task.setEnabled(false))
}
}
repositories {
mavenLocal()
// maven { url "https://maven.aliyun.com/repository/public" }
// maven { url "https://repo.huaweicloud.com/repository/maven" }
mavenCentral()
maven {
url "https://repo.spring.io/milestone"
content {
// Netty 5 optional support
includeGroup 'io.projectreactor.netty'
}
}
if (version.contains('-')) {
maven { url "https://repo.spring.io/milestone" }
}
if (version.endsWith('-SNAPSHOT')) {
maven { url "https://repo.spring.io/snapshot" }
}
}
configurations.configureEach {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
cacheDynamicVersionsFor 0, "seconds"
}
}
}
configure([rootProject] + javaProjects) {
apply plugin: "java"
apply plugin: 'jacoco'
apply plugin: 'infra.building.conventions'
apply plugin: 'infra.building.optional-dependencies'
apply from: "${rootDir}/gradle/toolchains.gradle"
if (testFixturesProjects.contains(it)) {
apply plugin: "java-test-fixtures"
}
jacocoTestReport {
enabled = false
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testImplementation("org.junit.platform:junit-platform-suite-api")
testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-junit-jupiter")
testImplementation("junit:junit")
testImplementation("org.assertj:assertj-core")
testImplementation 'org.projectlombok:lombok'
testAnnotationProcessor("org.projectlombok:lombok")
// Pull in the latest JUnit 5 Launcher API to ensure proper support in IDEs.
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly("org.junit.platform:junit-platform-suite-engine")
// JSR-305 only used for non-required meta-annotations
compileOnly("com.google.code.findbugs:jsr305")
compileOnly("com.google.code.findbugs:findbugs")
compileOnly('org.jboss.logging:jboss-logging:3.5.3.Final')
}
ext.javadocLinks = [
"https://docs.oracle.com/en/java/javase/17/docs/api/",
"https://jakarta.ee/specifications/platform/9/apidocs/",
"https://docs.jboss.org/hibernate/orm/5.6/javadocs/",
"https://eclipse.dev/aspectj/doc/released/aspectj5rt-api/",
"https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.15.2/",
"https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.15.2/",
"https://www.javadoc.io/doc/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.15.2/",
"https://hc.apache.org/httpcomponents-client-5.4.x/current/httpclient5/apidocs/"
] as String[]
}
configure(starterProjects) {
apply from: "${rootDir}/gradle/infra-starter.gradle"
}
configure(moduleProjects) {
apply from: "${rootDir}/gradle/infra-module.gradle"
}
configure(rootProject) {
description = "TODAY Infrastructure"
apply plugin: 'infra.building.api-diff'
}
if (isReleaseVersion) {
nexusPublishing {
repositories {
sonatype {
username = repoUsername
password = repoPassword
}
}
}
}