-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
113 lines (94 loc) · 2.93 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
`maven-publish`
kotlin("jvm") version "1.9.20"
kotlin("kapt") version "1.9.20"
id("com.github.johnrengelman.shadow") version "7.1.2"
}
allprojects {
group = "gg.tropic.practice"
version = "1.0.0"
repositories {
configureScalaRepository()
mavenCentral()
maven {
url = uri("https://repo.dmulloy2.net/repository/public/")
}
}
}
subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.kapt")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "maven-publish")
dependencies {
compileOnly(kotlin("stdlib"))
kapt("gg.scala.commons:bukkit:3.5.2")
compileOnly("gg.scala.commons:bukkit:3.5.2")
compileOnly("gg.scala.cgs:parties:1.4.3")
compileOnly("gg.scala.store:spigot:0.1.8")
compileOnly("gg.scala.staff:scala-scstaff-plugin:1.0.6")
compileOnly("gg.scala.friends:scala-friends:2.1.0")
compileOnly("gg.scala.basics.plugin:scala-basics-plugin:1.0.7")
compileOnly("gg.scala.spigot:server:1.1.3")
compileOnly("gg.scala.lemon:bukkit:1.7.0")
compileOnly("gg.scala.cloudsync:spigot:1.0.1")
}
tasks.withType<JavaCompile> {
options.compilerArgs.add("-parameters")
options.fork()
options.encoding = "UTF-8"
}
kotlin {
jvmToolchain(jdkVersion = 17)
}
tasks {
withType<ShadowJar> {
archiveClassifier.set("")
exclude(
"**/*.kotlin_metadata",
"**/*.kotlin_builtins"
)
archiveFileName.set(
"TropicPractice-${project.name}.jar"
)
}
withType<JavaCompile> {
options.compilerArgs.add("-parameters")
options.fork()
options.encoding = "UTF-8"
}
withType<KotlinCompile> {
kotlinOptions.javaParameters = true
kotlinOptions.jvmTarget = "17"
}
getByName("build") {
dependsOn(
"shadowJar",
"publishMavenJavaPublicationToScalaRepository"
)
}
}
publishing {
repositories.configureScalaRepository(dev = false)
publications {
register(
name = "mavenJava",
type = MavenPublication::class,
configurationAction = shadow::component
)
}
}
}
fun RepositoryHandler.configureScalaRepository(dev: Boolean = false)
{
maven("${property("artifactory_contextUrl")}/gradle-${if (dev) "dev" else "release"}") {
name = "scala"
credentials {
username = property("artifactory_user").toString()
password = property("artifactory_password").toString()
}
}
}