generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
108 lines (92 loc) · 3.27 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
import com.modrinth.minotaur.dependencies.ModDependency
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false
id "com.modrinth.minotaur" version "2.+" apply false
// id 'io.github.CDAGaming.cursegradle' version '1.6.0'
}
architectury {
minecraft = rootProject.minecraft_version
}
subprojects {
apply plugin: "dev.architectury.loom"
if (it.path != ':common') {
apply plugin: "com.modrinth.minotaur"
String platform = it.properties.getOrDefault("loom.platform", "fabric")
modrinth {
projectId = 'ghf7OqIS'
versionNumber = "${rootProject.mod_version}-${platform}-${rootProject.minecraft_version}"
uploadFile = remapJar
gameVersions = (project.supported_minecraft_versions as String).split(',') as List<String>
loaders = [platform]
var list = [new ModDependency('9s6osm5g', 'required')]
if (platform == 'fabric') list.add new ModDependency('P7dR8mSH', 'required')
if (platform == 'quilt') list.add new ModDependency('qvIfYCYJ', 'required')
dependencies = list
}
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2"
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name
version = rootProject.mod_version + "-mc" + rootProject.minecraft_version
group = rootProject.maven_group
repositories {
maven {
url 'https://maven.aliyun.com/nexus/content/groups/public'
}
maven { url "https://maven.quiltmc.org/repository/release/" }
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
java {
withSourcesJar()
}
}
/*
The CurseGradle plugin does not works well. Therefore, it has been ignored.
curseforge {
apiKey = '7218fa74-4a01-4ed1-a8d1-19b6d1e979ee'
project {
id = '520169'
releaseType = 'release'
(project.supported_minecraft_versions as String).split(',').each {
addGameVersion it
}
addGameVersion 'fabric'
mainArtifact(project(':fabric').remapJar) {
it.displayName = "$project.version-fabric"
relations {
// requiredDependency 'cloth-config'
// optionalDependency 'modmenu'
}
}
}
}*/
/*
The following section is just intended for debugging.
task mytest {
doLast {
def apiKey = '7218fa74-4a01-4ed1-a8d1-19b6d1e979ee'
def url = 'https://minecraft.curseforge.com/api/game/version-types'
// println com.matthewprenger.cursegradle.Util.httpGet(apiKey, url)
HttpClient client = HttpClientBuilder.create()
// .setDefaultRequestConfig(RequestConfig.custom()
//// .setCookieSpec(CookieSpecs.IGNORE_COOKIES)
// .build())
.build()
HttpGet get = new HttpGet(new URI(url))
get.setHeader('X-Api-Token', apiKey)
def response = client.execute(get)
println response
}
}
*/