-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
150 lines (127 loc) · 3.01 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
plugins {
id 'maven-publish'
alias libs.plugins.quilt.loom
}
def javaVersion = 21
group = project.maven_group_id
def ENV = System.getenv()
def now = new Date()
version = ENV.TAG ?: "development-${now.format('YY.MMdd.HHmm', TimeZone.getTimeZone('UTC'))}+${libs.versions.minecraft.get()}${(!ENV.TAG && ENV.BUILD_NUMBER) ? "-build.${ENV.BUILD_NUMBER}" : ''}"
base {
archivesName = "${rootProject.name}-Fabric"
}
repositories {
mavenCentral()
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/releases'
}
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
content {
includeGroupByRegex 'org\\.parchmentmc(\\..*)?'
}
}
maven {
name = 'Modrinth'
url = 'https://api.modrinth.com/maven'
content {
includeGroup "maven.modrinth"
}
}
maven {
name = 'Up-Mods'
url = 'https://maven.uuid.gg/releases'
}
maven {
name = "Ladysnake"
url = 'https://maven.ladysnake.org/releases'
}
}
loom {
mods {
"${project.mod_id}" {
sourceSet('main')
}
}
// Mixin plugin needs this
mixin {
useLegacyMixinAp = true
}
}
// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work.
dependencies {
minecraft libs.minecraft
mappings loom.officialMojangMappings()
/*
mappings(loom.layered {
it.officialMojangMappings()
it.parchment libs.parchment
})
*/
modImplementation libs.quilt.loader
modImplementation libs.fabric.api
modCompileOnly libs.modmenu
modLocalRuntime libs.modmenu
modCompileOnly libs.wrench.wrapper
modCompileOnly libs.bundles.trinkets
modLocalRuntime libs.bundles.trinkets
include libs.wrench.wrapper
}
processResources {
filteringCharset 'UTF-8'
def expandProps = [
'version' : version,
'maven_group_id' : maven_group_id,
'mod_id' : mod_id,
'minecraft_version' : libs.versions.minecraft.get(),
'curseforge_id' : curseforge_id,
'modrinth_id' : modrinth_id,
]
filesMatching(['*.mod.json', '*.mixins.json']) {
expand expandProps
}
inputs.properties(expandProps)
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
withSourcesJar()
// withJavadocJar()
}
jar {
from('LICENSE.md') {
rename { "LICENSE_${base.archivesName.get()}.md" }
}
}
sourcesJar {
from('LICENSE.md') {
rename { "LICENSE_${base.archivesName.get()}.md" }
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release.set(javaVersion)
}
// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
artifactId "${rootProject.name}-Fabric"
from components.java
}
}
repositories {
if (ENV.MAVEN_UPLOAD_URL) {
maven {
url = ENV.MAVEN_UPLOAD_URL
credentials {
username = ENV.MAVEN_UPLOAD_USERNAME
password = ENV.MAVEN_UPLOAD_PASSWORD
}
}
}
}
}