-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
151 lines (130 loc) · 4.53 KB
/
build.gradle.kts
File metadata and controls
151 lines (130 loc) · 4.53 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
kotlin("jvm") version "2.3.0"
id("java")
id("idea")
id("com.gradleup.shadow") version "9.2.0"
id("com.gradle.plugin-publish") version "1.2.1"
id("com.diffplug.spotless") version "6.13.0"
}
apply(plugin = "maven-publish")
kotlin {
jvmToolchain(17)
}
val shadeMe by configurations.creating
configurations {
implementation {
extendsFrom(shadeMe)
}
}
val version_major: String by project
val version_minor: String by project
val version_patch: String by project
val okhttp: String by project
val gson: String by project
val diffpatch: String by project
val jgit: String by project
val commons_io: String by project
val lombok: String by project
group = "com.hypherionmc.modutils"
version = "$version_major.$version_minor.$version_patch"
description = "Gradle Utilities for First Dark Development"
repositories {
mavenCentral()
maven("https://mcentral.firstdark.dev/releases")
maven("https://maven.firstdark.dev/releases")
maven("https://maven.firstdark.dev/snapshots")
maven("https://maven.covers1624.net")
gradlePluginPortal()
}
dependencies {
implementation(gradleApi())
shadeMe("com.squareup.okhttp3:okhttp:${okhttp}")
shadeMe("com.google.code.gson:gson:${gson}")
shadeMe("codechicken:DiffPatch:${diffpatch}:all")
shadeMe("org.apache.commons:commons-compress:1.26.2")
shadeMe("org.eclipse.jgit:org.eclipse.jgit:${jgit}")
shadeMe("commons-io:commons-io:${commons_io}")
shadeMe("com.hypherionmc:jarmanager:1.0.5") {
exclude(group = "org.ow2.asm")
}
shadeMe("org.tomlj:tomlj:1.1.1")
shadeMe("org.apache.maven:maven-artifact:4.0.0-rc-3")
// Lombok
compileOnly("org.projectlombok:lombok:${lombok}")
annotationProcessor("org.projectlombok:lombok:${lombok}")
testCompileOnly("org.projectlombok:lombok:${lombok}")
testAnnotationProcessor("org.projectlombok:lombok:${lombok}")
// Unimined
compileOnly("dev.firstdark.unimined:unimined:1.0.2+1.4.2-SNAPSHOT")
compileOnly("xyz.wagyourtail.unimined.mapping:unimined-mapping-library-jvm:1.2.1") {
exclude(group = "org.ow2.asm")
}
compileOnly("com.gradleup.shadow:shadow-gradle-plugin:9.3.0")
compileOnly("io.sigpipe:jbsdiff:1.0")
}
tasks.named<ShadowJar>("shadowJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations = listOf(shadeMe)
archiveClassifier.set("")
relocate("org.objectweb", "com.hypherionmc.orion.libs")
mergeServiceFiles()
}
tasks.withType<Jar>().configureEach {
manifest {
attributes["Implementation-Version"] = project.version.toString()
}
}
gradlePlugin {
plugins {
create("orionPlugin") {
id = "com.hypherionmc.modutils.orion"
description = project.description
displayName = "Orion"
version = project.version
implementationClass = "com.hypherionmc.orion.plugin.OrionPlugin"
tags.set(listOf("gradle", "utils", "fdd"))
}
create("orionPortingPlugin") {
id = "com.hypherionmc.modutils.orion.porting"
description = project.description
displayName = "OrionPorting"
version = project.version
implementationClass = "com.hypherionmc.orion.plugin.porting.OrionPortingPlugin"
tags.set(listOf("gradle", "utils", "fdd"))
}
create("orionMultiminedPlugin") {
id = "com.hypherionmc.modutils.orion.multimined"
description = project.description
displayName = "OrionMultimined"
version = project.version
implementationClass = "com.hypherionmc.orion.plugin.multimined.MultiminedPlugin"
tags.set(listOf("gradle", "utils", "fdd"))
}
create("origamiPlugin") {
id = "com.hypherionmc.modutils.orion.origami"
description = project.description
displayName = "OrionOrigami"
version = project.version
implementationClass = "com.hypherionmc.orion.plugin.paper.OrigamiPlugin"
tags.set(listOf("gradle", "utils", "fdd"))
}
}
}
spotless {
kotlin {
targetExclude("src/test/**")
licenseHeaderFile(rootProject.file("HEADER")).yearSeparator("-")
}
}
publishing {
repositories {
maven {
url = uri(System.getenv("MAVEN_URL"))
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}
}