-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
93 lines (79 loc) · 2.59 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
plugins {
id("fabric-loom") version "1.5-SNAPSHOT"
id("io.github.ladysnake.chenille") version "0.12.0"
id("io.github.juuxel.loom-quiltflower") version "1.6.0"
}
version = providers.gradleProperty("mod_version").get()
group = providers.gradleProperty("maven_group").get()
chenille {
configurePublishing {
withLadysnakeMaven()
withGithubRelease()
}
configureTestmod {
withDependencyConfiguration()
}
javaVersion = providers.gradleProperty("java_version").get().toInt()
license = "MIT"
}
val dummy: SourceSet by sourceSets.creating {}
repositories {
mavenLocal()
mavenCentral()
chenille.repositories {
ladysnake()
}
}
dependencies {
val minecraftVersion: String = providers.gradleProperty("minecraft_version").get()
val yarnVersion: String = providers.gradleProperty("yarn_mappings").get()
val loaderVersion: String = providers.gradleProperty("loader_version").get()
val fabricApiVersion: String = providers.gradleProperty("fabric_version").get()
val ccaVersion: String = providers.gradleProperty("cca_version").get()
// To change the versions see the gradle.properties file
minecraft("com.mojang:minecraft:${minecraftVersion}")
mappings("net.fabricmc:yarn:${yarnVersion}:v2")
modImplementation("net.fabricmc:fabric-loader:${loaderVersion}")
modApi(fabricApi.module("fabric-gametest-api-v1", fabricApiVersion))
modLocalImplementation(fabricApi.module("fabric-networking-api-v1", fabricApiVersion))
modCompileOnly("org.ladysnake.cardinal-components-api:cardinal-components-base:${ccaVersion}")
modCompileOnly("org.ladysnake.cardinal-components-api:cardinal-components-entity:${ccaVersion}")
api("junit:junit:4.13.2")
"testmodImplementation"(sourceSets.main.get().output)
annotationProcessor(dummy.output)
}
tasks.processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand("version" to project.version)
}
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
tasks.jar {
from("LICENSE") {
val archivesBaseName = providers.gradleProperty("archives_base_name").get()
rename { "${it}_$archivesBaseName"}
}
}
extensions.configure(PublishingExtension::class.java) {
publications {
create("relocation", MavenPublication::class.java) {
pom {
// Old artifact coordinates
groupId = "io.github.ladysnake"
distributionManagement {
relocation {
// New artifact coordinates
groupId = "org.ladysnake"
message = "groupId has been changed"
}
}
}
}
}
}