-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
119 lines (99 loc) · 3.03 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
import java.net.URI
plugins {
kotlin("jvm") version "1.8.21"
`java-gradle-plugin`
`maven-publish`
}
version = if (project.hasProperty("version_snapshot")) project.properties["version"] as String + "-SNAPSHOT" else project.properties["version"] as String
group = project.properties["maven_group"] as String
base {
archivesName.set(project.properties["archives_base_name"] as String)
}
val installer by sourceSets.creating
sourceSets {
main {
compileClasspath += installer.output
runtimeClasspath += installer.output
}
}
repositories {
maven("https://maven.wagyourtail.xyz/releases")
maven("https://maven.wagyourtail.xyz/snapshots")
maven("https://maven.jemnetworks.com/snapshots")
mavenCentral()
}
configurations {
implementation {
extendsFrom(configurations.named("installerImplementation").get())
}
}
dependencies {
testImplementation(kotlin("test"))
runtimeOnly(gradleApi())
implementation("xyz.wagyourtail.unimined:unimined:1.3.9")
"installerImplementation"("io.github.java-diff-utils:java-diff-utils:4.12")
"installerImplementation"("io.github.prcraftmc:class-diff:1.0-SNAPSHOT")
"installerImplementation"("org.jetbrains:annotations:24.0.1")
}
gradlePlugin {
plugins {
create("xyz.wagyourtail.patchbase") {
id = "xyz.wagyourtail.patchbase"
implementationClass = "xyz.wagyourtail.patchbase.gradle.PatchPlugin"
}
}
}
gradlePlugin {
plugins {
create("xyz.wagyourtail.patchbase-creator") {
id = "xyz.wagyourtail.patchbase-creator"
implementationClass = "xyz.wagyourtail.patchbase.gradle.PatchCreatorPlugin"
}
}
}
tasks.jar {
from(sourceSets.main.get().output, installer.output)
manifest {
attributes(
"Implementation-Version" to project.version
)
}
}
project.evaluationDependsOnChildren()
val installerJar by tasks.registering(Jar::class) {
group = "build"
archiveClassifier.set("installer")
from(installer.output)
}
tasks.test {
useJUnitPlatform()
}
tasks.build {
dependsOn(installerJar)
}
publishing {
repositories {
maven {
name = "WagYourMaven"
url = if (project.hasProperty("version_snapshot")) {
URI.create("https://maven.wagyourtail.xyz/snapshots/")
} else {
URI.create("https://maven.wagyourtail.xyz/releases/")
}
credentials {
username = project.findProperty("mvn.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("mvn.key") as String? ?: System.getenv("TOKEN")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = project.group as String
artifactId = project.properties["archives_base_name"] as String? ?: project.name
version = project.version as String
artifact(installerJar.get()) {
classifier = "installer"
}
}
}
}