/
build.gradle
143 lines (128 loc) · 3.68 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
plugins {
id 'java'
id 'idea'
id 'maven-publish'
id 'fabric-loom'
id 'com.matthewprenger.cursegradle'
id 'com.modrinth.minotaur'
}
base {
archivesName = "${mod_name}-fabric-${minecraft_version}"
}
repositories {
maven {
url "https://maven.shedaniel.me/"
}
maven {
url "https://maven.terraformersmc.com/"
content {
includeGroup "com.terraformersmc"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation project(":common")
modApi("me.shedaniel.cloth:cloth-config-fabric:${cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modImplementation "com.terraformersmc:modmenu:${mod_menu_version}"
}
loom {
if (project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()) {
accessWidenerPath.set(project(":common").file("src/main/resources/${mod_id}.accesswidener"))
}
mixin {
defaultRefmapName.set("${mod_id}.refmap.json")
}
runs {
client {
client()
setConfigName("Fabric Client")
ideConfigGenerated(true)
runDir("run")
}
server {
server()
setConfigName("Fabric Server")
ideConfigGenerated(true)
runDir("run")
}
}
}
tasks.withType(JavaCompile).configureEach {
source(project(":common").sourceSets.main.allSource)
}
tasks.withType(Javadoc).configureEach {
source(project(":common").sourceSets.main.allJava)
}
tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}
processResources {
from project(":common").sourceSets.main.resources
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId base.archivesName.get()
version project.version
from components.java
}
}
repositories {
if (System.getenv().SAP_SECRET) {
maven {
url "https://maven.saps.dev/releases"
credentials {
username = "mrbysco"
password = "${System.getenv().SAP_SECRET}"
}
}
}
}
}
if (System.getenv().CURSEFORGE_KEY) {
curseforge {
apiKey = System.getenv().CURSEFORGE_KEY
project {
id = project.curseforge_id
releaseType = "beta"
addGameVersion "Fabric"
addGameVersion "${minecraft_version}"
addGameVersion "Java 17"
mainArtifact(remapJar)
changelog = file("$project.rootDir/changelog.md")
changelogType = 'markdown'
relations {
requiredDependency "fabric-api"
requiredDependency "cloth-config"
}
}
options {
forgeGradleIntegration = false
}
}
}
if (System.getenv().MODRINTH_KEY) {
String fileContents = file("$project.rootDir/changelog.md").text
modrinth {
token = System.getenv().MODRINTH_KEY
projectId = project.modrinth_id
versionType = "beta"
versionName = "${mod_name} ${minecraft_version}"
versionNumber = project.version
uploadFile = remapJar
changelog = fileContents
gameVersions = ["${minecraft_version}"]
loaders = ["fabric"]
dependencies {
required.project "fabric-api"
required.project "cloth-config"
}
}
}