generated from CorgiTaco-Archive/Corgis-MultiLoader-Template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
86 lines (72 loc) · 2.89 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
import net.fabricmc.loom.api.LoomGradleExtensionAPI
plugins {
id("architectury-plugin") version "3.4-SNAPSHOT"
id("dev.architectury.loom") version "1.7-SNAPSHOT" apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
java
idea
`maven-publish`
}
val minecraftVersion = project.properties["minecraft_version"] as String
architectury.minecraft = minecraftVersion
allprojects {
version = project.properties["version"] as String
group = project.properties["group"] as String
}
subprojects {
apply(plugin = "dev.architectury.loom")
apply(plugin = "architectury-plugin")
apply(plugin = "maven-publish")
base.archivesName.set(project.properties["archives_base_name"] as String + "-${project.name}-$minecraftVersion")
val loom = project.extensions.getByName<LoomGradleExtensionAPI>("loom")
loom.silentMojangMappingsLicense()
loom.mixin.useLegacyMixinAp.set(false)
repositories {
mavenCentral()
mavenLocal()
maven("https://maven.parchmentmc.org")
maven("https://maven.fabricmc.net/")
maven("https://maven.minecraftforge.net/")
maven("https://maven.neoforged.net/releases/")
maven("https://maven.architectury.dev/")
}
@Suppress("UnstableApiUsage")
dependencies {
"minecraft"("com.mojang:minecraft:$minecraftVersion")
"mappings"(loom.layered{
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${project.properties["parchment"]}@zip")
})
compileOnly("org.jetbrains:annotations:24.1.0")
compileOnly("com.google.auto.service:auto-service:1.1.1")
annotationProcessor("com.google.auto.service:auto-service:1.1.1")
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType<JavaCompile>().configureEach {
options.release.set(21)
}
publishing {
publications.create<MavenPublication>("mavenJava") {
artifactId = project.properties["archives_base_name"] as String + "-${project.name}"
version = minecraftVersion + "-" + project.version.toString()
from(components["java"])
}
repositories {
mavenLocal()
maven {
val releasesRepoUrl = "https://maven.jt-dev.tech/releases"
val snapshotsRepoUrl = "https://maven.jt-dev.tech/snapshots"
url = uri(if (project.version.toString().endsWith("SNAPSHOT") || project.version.toString().startsWith("0")) snapshotsRepoUrl else releasesRepoUrl)
name = "JTDev-Maven-Repository"
credentials {
username = project.properties["repoLogin"]?.toString()
password = project.properties["repoPassword"]?.toString()
}
}
}
}
}