-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
144 lines (121 loc) · 4.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
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "1.2.1"
id 'maven-publish'
alias libs.plugins.quilt.loom
}
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
repositories {
maven {
url = "https://maven.fabricmc.net"
}
maven {
url = "https://maven.terraformersmc.com/releases"
}
maven {
url = "https://maven.shedaniel.me"
}
}
project.configurations.configureEach {
exclude(group: "net.fabricmc", module: "fabric-loader")
exclude(group: "net.fabricmc.fabric-api")
}
dependencies {
// To change the versions see the gradle.properties file
minecraft libs.minecraft
mappings variantOf(libs.quilt.mappings) { classifier 'intermediary-v2' }
modImplementation libs.quilt.loader
modImplementation libs.quilted.fabric.api
// Mod Menu integration
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
// REI integration
modImplementation "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
}
loom {
mods {
"alaskanativecraft"
}
accessWidenerPath = file("src/main/resources/alaskanativecraft.accesswidener")
}
processResources {
inputs.property "version", project.mod_version
filesMatching('quilt.mod.json') {
expand "version": project.mod_version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
}
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()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// Select the repositories you want to publish to
// To publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`.
repositories {
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
}
}
import com.modrinth.minotaur.TaskModrinthUpload
import com.modrinth.minotaur.request.Dependency
task publishModrinth (type: TaskModrinthUpload) {
onlyIf {
System.getenv("MODRINTH")
}
token = System.getenv("MODRINTH")
projectId = 'iFnEtHsI'
versionName = "Alaska Native Craft v${project.mod_version}"
versionNumber = "${project.mod_version}"
uploadFile = remapJar
changelog = new File("markdown/versions/${project.mod_version}.md").getText('UTF-8')
addGameVersion("${libs.versions.minecraft}")
addDependency('qsl', Dependency.DependencyType.REQUIRED)
addDependency('cloth-config', Dependency.DependencyType.REQUIRED)
addLoader('quilt')
}
curseforge {
if (project.hasProperty("curse_api_key") || System.getenv("curse_api_key") != null) {
apiKey = project.hasProperty("curse_api_key") ? project.property("curse_api_key") : System.getenv("curse_api_key")
project {
id = '435197'
changelogType = 'markdown'
changelog = file("markdown/versions/${project.mod_version}.md")
releaseType = 'release'
addGameVersion "${libs.versions.minecraft}"
addGameVersion "Java 17"
addGameVersion "Quilt"
relations {
requiredDependency 'cloth-config'
requiredDependency 'qsl'
optionalDependency 'modmenu'
}
mainArtifact(remapJar.archivePath) {
displayName = "Alaska Native Craft v${project.mod_version}"
}
afterEvaluate {
uploadTask.dependsOn(remapJar)
}
}
options {
javaVersionAutoDetect = false
forgeGradleIntegration = false
}
}
}