This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
120 lines (106 loc) · 4.33 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import groovy.lang.Closure
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
import net.minecrell.pluginyml.bungee.BungeePluginDescription
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.5.0"
id("com.github.johnrengelman.shadow") version "7.0.0" apply false
id("net.minecrell.plugin-yml.bukkit") version "0.4.0" apply false
id("net.minecrell.plugin-yml.bungee") version "0.4.0" apply false
id("org.jmailen.kotlinter") version "3.4.4"
id("com.palantir.git-version") version "0.12.3"
}
val gitVersion: Closure<String> by extra
allprojects {
apply(plugin = "org.jmailen.kotlinter")
repositories {
mavenCentral()
}
}
subprojects {
apply(plugin = "kotlin")
apply(plugin = "com.github.johnrengelman.shadow")
val shadowImplementation by configurations.creating
val shadowApi by configurations.creating
configurations["implementation"].extendsFrom(shadowImplementation)
configurations["api"].extendsFrom(shadowApi)
if (project.name != "common") {
val project = Project.get(project.name) ?: error("Not Found Project ${project.name}")
repositories {
if (project.isProxyPlugin) {
maven("https://papermc.io/repo/repository/maven-public/")
} else {
maven("https://repo.codemc.io/repository/maven-public/")
}
}
dependencies {
when (project) {
Project.Core -> {
shadowImplementation(kotlin("stdlib-jdk8"))
shadowApi(project(":common"))
shadowApi("com.github.sya-ri:EasySpigotAPI:2.3.1") {
exclude(group = "org.spigotmc", module = "spigot-api")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
}
api("org.yatopiamc:yatopia-api:1.16.5-R0.1-SNAPSHOT") {
exclude("org.codehaus.plexus", "plexus-compiler-eclipse")
}
}
Project.WCore -> {
shadowImplementation(kotlin("stdlib-jdk8"))
shadowApi(project(":common"))
api("io.github.waterfallmc:waterfall-api:1.16-R0.4-SNAPSHOT")
}
Project.WDiscord -> {
implementation("com.google.code.gson:gson:2.8.6")
testImplementation("org.slf4j:slf4j-simple:1.7.30")
}
Project.WVotifier -> {
implementation("io.netty:netty-handler:4.1.53.Final")
implementation("io.netty", "netty-transport-native-epoll", "4.1.53.Final", classifier = "linux-x86_64")
}
else -> {
implementation(kotlin("stdlib-jdk8"))
}
}
project.implementationProjects.forEach { implementation(project(":$it")) }
project.dependJarFile.forEach { api(files("../dependJars/$it.jar")) }
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
}
}
if (project.isProxyPlugin) {
apply(plugin = "net.minecrell.plugin-yml.bungee")
configure<BungeePluginDescription> {
name = project.name
version = gitVersion()
main = project.main
author = project.author
depends = project.allDependPlugin.toSet()
}
} else {
apply(plugin = "net.minecrell.plugin-yml.bukkit")
configure<BukkitPluginDescription> {
name = project.name
version = gitVersion()
main = project.main
author = project.author
apiVersion = "1.16"
depend = project.allDependPlugin
}
}
tasks.withType<ShadowJar> {
configurations = listOf(shadowImplementation, shadowApi)
archiveClassifier.set("")
destinationDirectory.set(file("../jars"))
}
} else {
dependencies {
implementation("com.google.guava:guava:21.0")
}
}
}