forked from Crazy-Crew/CrazyCrates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
102 lines (76 loc) · 2.46 KB
/
build.gradle.kts
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
plugins {
`maven-publish`
`java-library`
}
defaultTasks("build")
rootProject.group = "com.badbones69.crazycrates"
rootProject.description = "Add unlimited crates to your server with 10 different crate types to choose from!"
rootProject.version = "1.14"
subprojects {
apply(plugin = "maven-publish")
apply(plugin = "java-library")
repositories {
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://repo.codemc.org/repository/maven-public/")
maven("https://repo.aikar.co/content/groups/aikar/")
maven("https://repo.triumphteam.dev/snapshots/")
maven("https://repo.crazycrew.us/first-party/")
maven("https://repo.crazycrew.us/third-party/")
maven("https://repo.crazycrew.us/releases/")
maven("https://jitpack.io/")
mavenCentral()
}
listOf(
":core",
":paper"
).forEach {
project(it) {
group = "${rootProject.group}.${this.name}"
version = rootProject.version
}
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of("17"))
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
}
}
tasks {
assemble {
val jarsDir = File("$rootDir/jars")
if (jarsDir.exists()) jarsDir.delete()
subprojects.forEach { project ->
dependsOn(":${project.name}:build")
doLast {
if (!jarsDir.exists()) jarsDir.mkdirs()
if (project.name == "core") return@doLast
val projectName = "${rootProject.name}-${project.name.substring(0, 1).uppercase() + project.name.substring(1)}"
val file = file("${project.buildDir}/libs/$projectName-${project.version}.jar")
copy {
from(file)
into(jarsDir)
}
}
}
}
}
val isSnapshot = rootProject.version.toString().contains("snapshot")
publishing {
repositories {
maven {
credentials {
this.username = System.getenv("gradle_username")
this.password = System.getenv("gradle_password")
}
if (isSnapshot) {
url = uri("https://repo.crazycrew.us/snapshots/")
return@maven
}
url = uri("https://repo.crazycrew.us/releases/")
}
}
}