Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
143 lines (119 loc) · 4.08 KB
/
Copy pathbuild.gradle
File metadata and controls
143 lines (119 loc) · 4.08 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
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
plugins {
id 'net.fabricmc.fabric-loom' version '1.17-SNAPSHOT'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.9.0"
}
defaultTasks('clean', 'build', 'publishToMavenLocal')
version = project.mod_version
group = project.maven_group
repositories {
// maven {url "https://maven.terraformersmc.com/releases"}
// maven {url "https://maven.shedaniel.me/"}
maven {url "https://plugins.gradle.org/m2/"}
// maven {url "https://masa.dy.fi/maven"}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
// maven {
// name = 'Ladysnake Mods'
// url = 'https://maven.ladysnake.org/releases'
// }
// maven {url "https://minecraft.guntram.de/maven/"}
maven { url = "https://plugins.gradle.org/m2/" }
mavenCentral()
mavenLocal()
}
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
compileOnly("maven.modrinth:modmenu:${project.modmenu_version}")
// implementation "de.cubeside.cubesideutils.fabric:CubesideUtilsFabricClient:${project.cubeside_utils_version}"
implementation "maven.modrinth:cubesideutilsfabricclient:${project.cubeside_utils_version}"
// implementation "net.caffeinemc:sodium-fabric:0.8.7-SNAPSHOT+mc26.1-rc-3-local"
implementation "maven.modrinth:sodium:${project.sodium_version}"
testImplementation "org.junit.jupiter:junit-jupiter:5.10.3"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
}
processResources {
inputs.property "version", project.version
filteringCharset "UTF-8"
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
loom {
accessWidenerPath = file("src/main/resources/cubeside.accesswidener")
mixin {
setUseLegacyMixinAp(false)
}
}
def targetJavaVersion = 25
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 21 || JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) {
it.options.release = targetJavaVersion
}
}
base {
archivesName = project.archives_base_name
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
jar {
from("LICENSE") {
rename { "${it}_${project.archives_base_name}" }
}
}
tasks.publish.dependsOn build
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.archives_base_name
// add all the jars that should be included when publishing to maven
//artifact(jar) { builtBy remapJar }
from components.java
}
}
repositories {
maven {
url "$projectDir/../../CommonMaven"
}
}
}
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = project.modrinth_id
versionNumber = project.mod_version
versionName = "CubesideMod ${project.minecraft_version}-${project.mod_version}"
versionType = isMCVersionNonRelease() ? "beta" : "release"
changelog = file("changelog.md").text
uploadFile = jar
gameVersions = [ project.minecraft_version ]
loaders = [ "fabric" ]
dependencies {
required.project 'fabric-api'
required.project 'cubesideutilsfabricclient'
}
}
boolean isMCVersionNonRelease() {
return project.minecraft_version.matches('^\\d\\dw\\d\\d[a-z]$') || project.minecraft_version.matches('\\d+\\.\\d+-(pre|rc)-\\d+')
}
tasks.test {
useJUnitPlatform()
workingDir = layout.buildDirectory.dir("test-run").get().asFile
doFirst {
getWorkingDir().mkdirs()
}
}