-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
140 lines (118 loc) · 3.25 KB
/
build.gradle
File metadata and controls
140 lines (118 loc) · 3.25 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
132
133
134
135
136
137
138
139
140
plugins {
id 'java-library'
id 'maven-publish'
}
group = 'com.cleanroommc'
version = '1.1.5'
base.archivesName = 'java-utils'
java {
toolchain {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
languageVersion = JavaLanguageVersion.of(8)
}
withSourcesJar()
}
sourceSets {
api
checker
main {
compileClasspath += api.output
runtimeClasspath += api.output
compileClasspath += checker.output
runtimeClasspath += checker.output
}
test {
compileClasspath += api.output
runtimeClasspath += api.output
compileClasspath += checker.output
runtimeClasspath += checker.output
}
}
repositories {
maven {
name 'CleanroomMC'
url 'https://maven.cleanroommc.com'
}
mavenCentral()
}
dependencies {
api 'org.slf4j:slf4j-api:2.0.17'
api 'com.cleanroommc:platform-utils:2.0.0'
runtimeOnly 'org.slf4j:slf4j-simple:2.0.17'
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
test {
useJUnitPlatform()
}
tasks.named('compileCheckerJava', JavaCompile).configure {
sourceCompatibility = JavaVersion.VERSION_1_2
targetCompatibility = JavaVersion.VERSION_1_1
options.compilerArgs << '-Xlint:-options'
}
jar {
from sourceSets.api.output.classesDirs
from sourceSets.checker.output.classesDirs
}
tasks.register('apiJar', Jar).configure {
group 'build'
archiveClassifier = 'api'
from sourceSets.api.output.classesDirs
}
tasks.register('apiSourceJar', Jar).configure {
group 'build'
archiveClassifier = 'api-source'
from sourceSets.api.allSource
}
tasks.register('checkerJar', Jar).configure {
group 'build'
archiveClassifier = 'checker'
from sourceSets.checker.output.classesDirs
from sourceSets.checker.output.resourcesDir
manifest {
attributes('Main-Class': 'com.cleanroommc.javautils.checker.JavaChecker')
}
}
tasks.register('nolocatorJar', Jar).configure {
group 'build'
archiveClassifier = 'nolocator'
from (sourceSets.main.output.classesDirs) {
exclude 'com/cleanroommc/javautils/locators/**'
}
from (sourceSets.api.output.classesDirs) {
exclude 'com/cleanroommc/javautils/spi/**'
}
from sourceSets.checker.output.classesDirs
}
tasks.register('nolocatorSourceJar', Jar).configure {
group 'build'
archiveClassifier = 'nolocator-source'
from (sourceSets.main.allSource) {
exclude 'com/cleanroommc/javautils/locators/**'
}
from (sourceSets.api.allSource) {
exclude 'com/cleanroommc/javautils/spi/**'
}
from sourceSets.checker.allSource
}
publishing {
repositories {
maven {
name 'CleanroomMaven'
url 'https://repo.cleanroommc.com/releases'
credentials(PasswordCredentials)
}
}
publications {
mavenJava(MavenPublication) {
artifactId 'java-utils'
from components.java
artifact tasks.apiJar
artifact tasks.apiSourceJar
artifact tasks.checkerJar
artifact tasks.nolocatorJar
artifact tasks.nolocatorSourceJar
}
}
}