-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
131 lines (117 loc) · 3.84 KB
/
build.gradle
File metadata and controls
131 lines (117 loc) · 3.84 KB
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
plugins {
id 'java'
id 'idea'
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
group 'fybug.nulll'
version = '0.1.4'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(23)
}
}
repositories {
mavenLocal()
mavenCentral()
google()
maven { url 'https://maven.aliyun.com/repository/releases' }
maven { url "https://maven.aliyun.com/repository/jcenter" }
maven { url "https://maven.aliyun.com/repository/mapr-public" }
maven { url "https://maven.aliyun.com/repository/staging-alpha" }
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/public/" }
maven { url "https://maven.aliyun.com/repository/google" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://maven.aliyun.com/repository/spring" }
maven { url "https://maven.aliyun.com/repository/spring-plugin" }
maven { url "https://maven.aliyun.com/repository/grails-core" }
maven { url "https://maven.aliyun.com/repository/snapshots" }
maven { url "https://maven.aliyun.com/repository/apache-snapshots" }
maven { url "https://maven.aliyun.com/repository/staging-alpha-group" }
}
dependencies {
// 本地依赖
implementation fileTree(dir: 'lib', includes: ['*.jar'])
// 注释包
compileOnly "jakarta.validation:jakarta.validation-api:+"
compileOnly "jakarta.annotation:jakarta.annotation-api:+"
// lombok
compileOnly 'org.projectlombok:lombok:+'
annotationProcessor 'org.projectlombok:lombok:+'
// 注释包
testCompileOnly "jakarta.validation:jakarta.validation-api:+"
testCompileOnly "jakarta.annotation:jakarta.annotation-api:+"
// lombok
testCompileOnly "org.projectlombok:lombok:+"
testAnnotationProcessor "org.projectlombok:lombok:+"
testImplementation platform('org.junit:junit-bom:5.10.0')
testRuntimeOnly "org.junit.jupiter:junit-jupiter:5.12.0-RC2"
}
test {
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:5.12.0-RC2"
}
useJUnitPlatform()
}
/** 清单文件内容 */
tasks.withType(Jar).configureEach {
destinationDirectory = file('jar')
manifest {
attributes('Manifest-Version': '1.0',
'Built-By': 'fybug/风雨bu改',
'Build-Jdk-Spec': 23,
'Bundle-Description': 'java并发控制工具',
'Bundle-Name': 'PDConcurrent',
// 'Bundle-DocURL': 'https://apidoc.gitee.com/fybug/PDConcurrent/',
'Bundle-Vendor': 'IntelliJ IDEA',
'Bundle-Version': version,
'Bundle-License': 'https://www.apache.org/licenses/LICENSE-2.0',
'Created-By': 'Gradle 8.10.2')
}
}
/** 编译包 */
tasks.register('build_by', Jar) {
archiveFileName = 'PDConcurrent.jar'
archiveClassifier = 'bin'
// 打包编译输出
from sourceSets.main.output
}
/** 编译包 */
tasks.register('build_bin', Jar) {
archiveFileName = 'PDConcurrent_bin.jar'
archiveClassifier = 'bin'
// 打包编译输出
from sourceSets.main.output
from {
// implementation 相关的引入解压并打包入新的jar中
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
/** 源码包 */
tasks.register('build_all', Jar) {
archiveFileName = 'PDConcurrent_all.jar'
archiveClassifier = 'all'
// 打包编译输出
from sourceSets.main.output
// 打包源码
from sourceSets.main.allSource
from {
// implementation 相关的引入解压并打包入新的jar中
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
/** 源码包 */
tasks.register('build_sources', Jar) {
archiveFileName = 'PDConcurrent_sources.jar'
archiveClassifier = 'sources'
// 打包源码
from sourceSets.main.allSource
}
tasks.register('release') {
dependsOn build_by
dependsOn build_all
dependsOn build_bin
dependsOn build_sources
}