-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
115 lines (103 loc) · 3.53 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
115
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java'
id "io.freefair.lombok" version "6.3.0" apply false
id "com.github.johnrengelman.shadow" version "7.1.0" apply false
id "com.sidneysimmons.gradle-plugin-external-properties" version "2.0.0"
}
externalProperties { propertiesFileResolver project.file("secrets.properties") }
dependencies {
compileOnly 'org.jetbrains:annotations:23.0.0'
annotationProcessor 'org.jetbrains:annotations:23.0.0'
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven { url = uri('https://papermc.io/repo/repository/maven-public/') }
maven { url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/') }
maven { url = uri('https://jitpack.io') }
maven { url = uri('https://repo.extendedclip.com/content/repositories/placeholderapi/') }
maven { url = uri('https://repo.maven.apache.org/maven2/') }
maven {
url = "https://nexus.mooncraft.dev/repository/spigots/"
credentials.username = props.get("nexus-username", properties.get("nexus-username") as String)
credentials.password = props.get("nexus-password", properties.get("nexus-password") as String)
}
maven {
url = "https://nexus.mooncraft.dev/repository/mooncraft-releases/"
credentials.username = props.get("nexus-username", properties.get("nexus-username") as String)
credentials.password = props.get("nexus-password", properties.get("nexus-password") as String)
}
}
}
subprojects {
apply plugin: "java"
apply plugin: "io.freefair.lombok"
apply plugin: "com.github.johnrengelman.shadow"
lombok { version = "1.18.22" }
sourceSets {
main.java.srcDirs = ['src']
main.resources.srcDirs = ['resources']
}
java {
withSourcesJar()
withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_16
}
processResources {
filter ReplaceTokens, tokens: [
"plugin-author" : project.property("plugin-author"),
"plugin-version" : project.property("plugin-version"),
"plugin-api-version": project.property("plugin-api-version")
]
}
dependencies {
compileOnly 'org.jetbrains:annotations:23.0.0'
annotationProcessor 'org.jetbrains:annotations:23.0.0'
}
jar {
archiveClassifier.set("base")
}
sourcesJar {
archiveClassifier.set("sources")
}
javadocJar {
archiveClassifier.set("javadocs")
}
shadowJar {
archiveClassifier.set("")
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
}
task buildBase(type: Copy) {
from subprojects.collect { it.tasks.withType(Jar).named("jar") }
into "/COMPILED-JARS/base"
}
task buildSources(type: Copy) {
from subprojects.collect { it.tasks.withType(Jar).named("sourcesJar") }
into "/COMPILED-JARS/sources"
}
task buildJavadoc(type: Copy) {
from subprojects.collect { it.tasks.withType(Jar).named("javadocJar") }
into "/COMPILED-JARS/javadocs"
}
task buildShadowjar(type: Copy) {
from subprojects.collect { it.tasks.withType(Jar).named("shadowJar") }
exclude 'Bukkit.jar'
exclude 'Bungee.jar'
exclude 'Core.jar'
into "/COMPILED-JARS"
}
task buildAll(type: Copy) {
dependsOn clean
dependsOn buildBase
dependsOn buildJavadoc
dependsOn buildSources
dependsOn buildShadowjar
}