Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
105 lines (92 loc) · 3.14 KB
/
Copy pathbuild.gradle
File metadata and controls
105 lines (92 loc) · 3.14 KB
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
plugins {
id 'net.fabricmc.fabric-loom' version "+"
id 'maven-publish'
id "me.modmuss50.mod-publish-plugin" version "1.1.0"
}
repositories {
maven { url "https://maven.uuid.gg/releases" }
maven { url "https://maven.terraformersmc.com/releases/" }
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
implementation "net.fabricmc:fabric-loader:+"
implementation "net.fabricmc.fabric-api:fabric-api:+"
implementation "com.terraformersmc:modmenu:${project.modmenu_version}"
implementation include ("org.javassist:javassist:+")
implementation include ("org.reflections:reflections:+")
implementation include ("org.apache.commons:commons-text:+")
implementation include ("org.apache.commons:commons-collections4:+")
implementation include ("dev.upcraft.datasync:${project.datasync_version}")
}
publishMods {
file = jar.archiveFile
displayName = "${project.version.toString().split("\\+")[0]} for Fabric $minecraft_version"
changelog = ""
type = STABLE
modLoaders.addAll("fabric", "quilt")
dryRun = !providers.gradleProperty("modrinth_api_key").isPresent()
modrinth {
accessToken = providers.gradleProperty("modrinth_api_key")
projectId = modrinth_id
minecraftVersionRange {
start = minecraft_version
end = minecraft_version
includeSnapshots = true
}
announcementTitle = "Download from Modrinth"
}
}
version = project.mod_version
group = project.maven_group
base { archivesName = project.mod_id + "-" + project.minecraft_version }
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
//noinspection GroovyAssignabilityCheck, GrUnresolvedAccess
it.options.release.set(getProject().java_version.toInteger())
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(project.java_version)
withSourcesJar()
}
loom {
accessWidenerPath = file("src/main/resources/${project.mod_id}.classtweaker")
}
configurations.configureEach { resolutionStrategy { componentSelection {
withModule('net.fabricmc.fabric-api:fabric-api') { ComponentSelection selection ->
if (!selection.candidate.version.endsWith('+' + project.minecraft_version)) {
selection.reject("Version ${selection.candidate.version} does not end with +${project.minecraft_version}")
}
}
}}}
fabricApi {
configureDataGeneration {
modId = project.mod_id
client = true
}
}
processResources {
inputs.property "version", project.version
filteringCharset "UTF-8"
filesMatching("fabric.mod.json") { expand "version": project.version }
}
jar {
from("LICENSE.md") { rename { "${it}_${project.mod_id}" } }
}
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.mod_id
from components.java
}
}
repositories {
maven {
name = "willBlRepositoryReleases"
url = "https://maven.willbl.dev/releases"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}