-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
96 lines (73 loc) · 1.95 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
plugins {
id 'java'
id 'maven-publish'
id 'com.github.gmazzo.buildconfig' version '4.1.2'
}
static Closure mavenRepository (@DelegatesTo(MavenArtifactRepository.class) Closure closure) { closure }
static Action<? extends PasswordCredentials> credentials (Action<? extends PasswordCredentials> action) { action }
var workshopCredentials = credentials { it ->
it.username = publishMvnRepoUsername
it.password = publishMvnRepoPassword
}
var workshopReleases = mavenRepository({
name 'wsReleases'
url "https://mvn.sukazyo.cc/releases"
credentials workshopCredentials
})
var workshopSnapshots = mavenRepository({
name "wsSnapshots"
url "https://mvn.sukazyo.cc/snapshots"
credentials workshopCredentials
})
final String proj_group = "cc.sukazyo"
final String proj_archive_name = archive_name
final String proj_package_name = proj_archive_name
final boolean proj_is_snapshot = Boolean.parseBoolean(snapshot)
final String proj_version = version + (proj_is_snapshot ? "-SNAPSHOT" : "")
group proj_group
version proj_version
repositories {
mavenCentral()
maven workshopReleases
}
dependencies {
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.4'
testImplementation platform("org.junit:junit-bom:5.10.3")
testImplementation "cc.sukazyo:morny-coeur:1.3.4"
}
java {
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
options.encoding = "UTF-8"
}
tasks.withType(Javadoc).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(Jar).configureEach {
archiveBaseName.set proj_archive_name
}
publishing {
publications {
release (MavenPublication) {
artifactId = proj_package_name
from components.java
}
}
repositories {
maven {
name 'localArchives'
url publishMavenLocalDirectory
}
if (!proj_is_snapshot)
maven workshopReleases
else
maven workshopSnapshots
}
}