-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
114 lines (97 loc) · 2.91 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
group("com.tabuyos.bluray")
version("0.1.0-SNAPSHOT")
def projectVersion = version
def groupId = group
def junitJupiterVersion = "5.7.0"
def hutoolVersion = "5.5.1"
def mariadbVersion = "2.6.0"
def mybatisSpringVersion = "2.1.4"
def mybatisPlusVersion = "3.4.1"
def springCloudVersion = "2020.0.1"
def springBootVersion = "2.4.3"
def removeParentSrc = true
static def deleteDirectory(File file) {
if (file.isFile()) {
return file.delete()
} else {
file.listFiles().each {
deleteDirectory(it)
}
}
return file.delete()
}
allprojects {
group(groupId)
version(projectVersion)
repositories {
mavenLocal()
maven {
url "https://maven.aliyun.com/repository/public"
name "AliyunPublic"
}
mavenCentral()
}
}
subprojects {
apply plugin: "java"
repositories {
mavenCentral()
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
implementation(platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}"))
implementation(platform("org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"))
testImplementation("org.junit.jupiter:junit-jupiter:${junitJupiterVersion}")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
developmentOnly("org.springframework.boot:spring-boot-devtools:${springBootVersion}")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}")
}
configurations {
all {
implementation.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
}
}
compileJava.inputs.files(processResources)
test {
useJUnitPlatform()
jvmArgs("--illegal-access=deny")
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
java {
sourceCompatibility = JavaVersion.VERSION_15
targetCompatibility = JavaVersion.VERSION_15
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
task createSrcDirs {
sourceSets*.java.srcDirs*.each {
it.mkdirs()
}
sourceSets*.resources.srcDirs*.each {
it.mkdirs()
}
}
task createBuildScript {
dependsOn(createSrcDirs)
File file = new File("${projectDir}${File.separator}build.gradle")
if (!file.exists()) {
file.createNewFile()
}
if (removeParentSrc) {
file = new File("${file.getParentFile().getParent()}${File.separator}src")
if (file.exists()) {
deleteDirectory(file)
}
}
}
}