-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbuild.gradle.kts
139 lines (124 loc) · 3.73 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import net.fabricmc.loom.api.LoomGradleExtensionAPI
plugins {
id("architectury-plugin")
id("dev.architectury.loom").apply(false)
id("com.github.johnrengelman.shadow").apply(false)
}
architectury {
minecraft = minecraft_version
}
subprojects {
apply(plugin = "dev.architectury.loom")
apply(plugin = "maven-publish")
val loom = extensions.getByType<LoomGradleExtensionAPI>()
loom.run {
silentMojangMappingsLicense()
this.runConfigs.forEach { setting ->
setting.property("mixin.debug=true")
setting.property("mixin.debug.export=true")
setting.property("mixin.dumpTargetOnFailure=true")
setting.property("mixin.checks.interfaces=true")
setting.property("mixin.hotSwap=true")
}
}
repositories {
flatDir {
dir("libs")
}
maven("https://jitpack.io")
maven {
url = uri("https://maven.parchmentmc.org/")
content {
includeGroup("org.parchmentmc.data")
}
}
maven {
url = uri("https://cursemaven.com")
content {
includeGroup("curse.maven")
}
}
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
maven {
name = "IzzelAliz Maven"
url = uri("https://maven.izzel.io/releases/")
content {
includeGroup("icyllis.modernui")
}
}
maven {
name = "tterrag maven"
url = uri("https://maven.tterrag.com/")
content {
includeGroup("com.jozufozu.flywheel")
}
}
}
dependencies {
minecraft("com.mojang:minecraft:$minecraft_version")
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-$parchment_version@zip")
})
"implementation"(mixinExtras)
"annotationProcessor"(mixinExtras)
"implementation"("org.jetbrains:annotations:24.0.1")
}
extensions.getByType<BasePluginExtension>().apply {
archivesName.set(archiveBaseName)
}
extensions.getByType<PublishingExtension>().apply {
val platformName = project.name.lowercase()
publications {
create<MavenPublication>(name = platformName) {
groupId = maven_group
artifactId = archiveBaseName
version = semantics_version
from(components.getByName<SoftwareComponent>("java"))
}
repositories {
maven {
setUrl("https://maven.firstdarkdev.xyz/$maven_path")
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}
}
}
tasks.create("checkMixinPlugin"){
val jarTask = tasks.withType<Jar> {
finalizedBy(this@create)
}
dependsOn(jarTask)
doLast {
this.inputs.files.files.forEach(::check)
}
}
tasks.withType<Jar>{
doFirst{
this.inputs.files.files.forEach(::check)
}
}
}
allprojects {
apply(plugin = "java")
apply(plugin = "architectury-plugin")
apply(plugin = "maven-publish")
version = semantics_version
group = maven_group
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
}
extensions.getByType<JavaPluginExtension>().apply {
withSourcesJar()
}
}