This repository has been archived by the owner on Sep 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 238
/
build.gradle.kts
96 lines (80 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
val taboolibVersion: String by project
plugins {
id("org.gradle.java")
id("org.gradle.maven-publish")
kotlin("jvm") version "1.8.0" apply false
id("io.izzel.taboolib") version "1.56" apply false
}
description = "Modern & Advanced Menu-Plugin for Minecraft Servers"
repositories {
mavenCentral()
maven("https://repo.tabooproject.org/repository/releases")
maven("https://jitpack.io")
}
tasks.jar {
onlyIf { false }
}
tasks.build {
doLast {
val plugin = project(":plugin")
val file = file("${plugin.buildDir}/libs").listFiles()?.find { it.endsWith("plugin-$version.jar") }
file?.copyTo(file("$buildDir/libs/${project.name}-$version.jar"), true)
}
dependsOn(project(":plugin").tasks.build)
}
subprojects {
apply<JavaPlugin>()
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "maven-publish")
repositories {
mavenCentral()
}
dependencies {
"compileOnly"(kotlin("stdlib"))
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
val archiveName = if (project == rootProject)
rootProject.name.toLowerCase()
else
"${rootProject.name.toLowerCase()}-${project.name.toLowerCase()}"
val sourceSets = extensions.getByName("sourceSets") as SourceSetContainer
task<Jar>("sourcesJar") {
from(sourceSets.named("main").get().allSource)
archiveClassifier.set("sources")
}
tasks.jar {
exclude("taboolib")
}
publishing {
repositories {
maven {
url = uri("https://repo.mcage.cn/repository/trplugins/")
credentials {
username = project.findProperty("user").toString()
password = project.findProperty("password").toString()
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("library") {
from(components["java"])
artifactId = archiveName
artifact(tasks["sourcesJar"])
pom {
allprojects.forEach {
repositories.addAll(it.repositories)
}
}
}
}
}
}