-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
103 lines (87 loc) · 3.55 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
import net.fabricmc.loom.api.LoomGradleExtensionAPI
plugins {
id("architectury-plugin") version "3.4-SNAPSHOT"
id("dev.architectury.loom") version "1.9-SNAPSHOT" apply false
id("com.gradleup.shadow") version "8.3.5" apply false
kotlin("jvm") version ("2.0.10")
java
idea
`maven-publish`
}
val minecraftVersion = project.properties["minecraft_version"] as String
architectury.minecraft = minecraftVersion
allprojects {
version = project.properties["mod_version"] as String
group = project.properties["maven_group"] as String
}
subprojects {
apply(plugin = "dev.architectury.loom")
apply(plugin = "architectury-plugin")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.kotlin.jvm")
base.archivesName.set(project.properties["archives_base_name"] as String + "-${project.name}")
val loom = project.extensions.getByName<LoomGradleExtensionAPI>("loom")
loom.silentMojangMappingsLicense()
loom.mixin.useLegacyMixinAp.set(false)
repositories {
mavenCentral()
mavenLocal()
maven("https://repo1.maven.org/maven2")
maven("https://jitpack.io")
maven("https://maven.generations.gg/snapshots")
maven("https://maven.generations.gg/releases")
maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1")
maven("https://cursemaven.com").content { includeGroup("curse.maven") }
maven("https://maven.impactdev.net/repository/development/")
maven("https://maven.parchmentmc.org")
maven("https://maven2.bai.lol").content {
includeGroup("lol.bai")
includeGroup("mcp.mobius.waila")
}
maven("https://maven.tterrag.com/")
maven("https://nexus.resourcefulbees.com/repository/maven-public/")
maven("https://maven.neoforged.net/releases")
}
@Suppress("UnstableApiUsage")
dependencies {
"minecraft"("com.mojang:minecraft:$minecraftVersion")
"mappings"(loom.layered{
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-$minecraftVersion:${project.properties["parchment"]}@zip")
})
compileOnly("org.jetbrains:annotations:26.0.1")
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<JavaCompile>().configureEach {
options.release.set(17)
}
kotlin.jvmToolchain(17)
publishing {
publications.create<MavenPublication>("mavenJava") {
artifactId = base.archivesName.get()
from(components["java"])
}
repositories {
mavenLocal()
maven {
val releasesRepoUrl = "https://maven.generations.gg/releases"
val snapshotsRepoUrl = "https://maven.generations.gg/snapshots"
url = uri(if (project.version.toString().endsWith("SNAPSHOT") || project.version.toString().startsWith("0")) snapshotsRepoUrl else releasesRepoUrl)
name = "Generations-Repo"
credentials {
username = getGensCredentials().first
password = getGensCredentials().second
}
}
}
}
}
private fun getGensCredentials(): Pair<String?, String?> {
val username = (project.findProperty("gensUsername") ?: System.getenv("GENS_USERNAME") ?: "") as String?
val password = (project.findProperty("gensPassword") ?: System.getenv("GENS_PASSWORD") ?: "") as String?
return Pair(username, password)
}