-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
136 lines (111 loc) · 3.57 KB
/
build.gradle
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
plugins {
id "fabric-loom" version "1.9-SNAPSHOT"
id "io.freefair.lombok" version "8.11"
id "maven-publish"
id "com.modrinth.minotaur" version "2.8.7"
}
version = "${project.mod_version}+${project.minecraft_version}${getVersionMetadata()}"
group = project.maven_group
if (System.getenv("PUBLISH_RELEASE")) {
publish.finalizedBy "modrinth"
}
repositories {
maven {
url = uri("https://maven.uku3lig.net/releases")
}
maven {
url = uri("https://maven.terraformersmc.com/releases/")
}
}
dependencies {
// To change the versions see the gradle.properties file
minecraft("com.mojang:minecraft:${project.minecraft_version}")
mappings("net.fabricmc:yarn:${project.yarn_mappings}:v2")
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
include(implementation("com.moandjiezana.toml:toml4j:${project.toml4j_version}"))
include(modImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_version)))
include(modImplementation(fabricApi.module("fabric-command-api-v2", project.fabric_version)))
include(modImplementation(fabricApi.module("fabric-key-binding-api-v1", project.fabric_version)))
// optional deps
modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
}
loom {
accessWidenerPath = file("src/main/resources/ukulib.accesswidener")
}
tasks.processResources {
inputs.property("version", project.version)
filteringCharset = "UTF-8"
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
}
base {
archivesName = project.archives_base_name
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
withJavadocJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}" }
}
}
javadoc {
exclude("net/uku3lig/ukulib/config/impl/UkulibConfig.java")
}
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.base.archivesName.get()
from components.java
}
}
repositories {
maven {
name = "UkuReleases"
url "https://maven.uku3lig.net/releases"
credentials {
username = "uku"
password = System.getenv("MAVEN_PASSWORD")
}
}
maven {
name = "UkuSnapshots"
url = "https://maven.uku3lig.net/snapshots"
credentials {
username = "uku"
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
var release_type = "release"
if (version.containsIgnoreCase("alpha")) release_type = "alpha"
else if (version.containsIgnoreCase("beta")) release_type = "beta"
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "Y8uFrUil"
versionNumber = project.version
versionType = release_type
uploadFile = remapJar // With Loom, this MUST be set to `remapJar` instead of `jar`!
gameVersions = [project.minecraft_version] // Must be an array, even with only one version
loaders = ["fabric", "quilt"]
changelog = "See https://github.com/uku3lig/ukulib/releases/tag/${project.version}"
}
static def getVersionMetadata() {
def ENV = System.getenv()
if (ENV.PUBLISH_RELEASE) return ""
def build_id = ENV.GITHUB_RUN_NUMBER
// CI builds only
if (build_id != null) {
return "-build.${build_id}"
} else {
return "-local"
}
}