-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
105 lines (92 loc) · 2.7 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
plugins {
id 'java'
id 'maven-publish'
id "de.undercouch.download" version "5.0.2"
id 'com.github.breadmoirai.github-release' version '2.3.7'
}
apply from: rootProject.file('specialSource.gradle')
apply from: rootProject.file('buildtools.gradle')
group 'fr.sunderia'
version '1.6.1-SNAPSHOT'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
repositories {
mavenCentral()
maven {
name = "Spigot-Repo"
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
mavenLocal()
}
dependencies {
compileOnly('org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT')
compileOnly 'org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT:remapped-mojang'
compileOnly('org.jetbrains:annotations:23.0.0')
}
compileJava {
options.encoding('UTF-8')
}
java {
withJavadocJar()
withSourcesJar()
}
afterEvaluate {
jar {
doLast {
def outputFiles = outputs.files.files
for (inputFile in outputFiles) {
File intermediateFile = new File(temporaryDir, inputFile.name.replace('.jar', '-obf.jar'))
File outputFile = inputFile
remapMojangToSpigot(inputFile, intermediateFile, outputFile, "1.18.1-R0.1-SNAPSHOT")
}
}
}
}
test {
useJUnitPlatform()
}
javadoc {
options.addBooleanOption('html5', true)
}
githubRelease {
setToken(System.getenv("GITHUB_TOKEN") ?: GITHUB_TOKEN)
releaseAssets(jar.archiveFile, sourcesJar.archiveFile, javadocJar.archiveFile)
}
if(System.getenv("GITHUB_TOKEN") != null || hasProperty("GITHUB_TOKEN")) {
publish.dependsOn(tasks.named('githubRelease'))
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = project.name
from components.java
pom {
name = project.name
description = project.description
url = "https://github.com/Sunderia/SunderiaUtils"
licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'minemobs'
name = 'minemobs'
}
}
}
}
}
repositories {
maven {
name 'sunderiaRepo'
def extension = version.toString().endsWith('-SNAPSHOT') ? 'snapshots' : 'releases'
url 'https://maven.thesimpleteam.net/' + extension
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}