forked from ErdbeerbaerLP/DiscordIntegration-Fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (123 loc) · 4.22 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
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
id 'fabric-loom' version '0.12-SNAPSHOT'
id "com.modrinth.minotaur" version "2.+"
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = "${project.mod_version}-${project.minecraft_version}"
group = project.maven_group
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 5, 'minutes'
}
}
repositories {
mavenCentral()
maven {
name = "sonatype-oss-snapshots"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven { url 'https://jitpack.io' }
maven {
url 'https://maven.bymartrixx.me'
}
maven { url "https://repo.erdbeerbaerlp.de/repository/maven-public/" }
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
maven { url "https://maven.nucleoid.xyz/" }
flatDir {
dirs "libs"
}
}
task release {
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation include("eu.pb4:placeholder-api:2.0.0-beta.7+1.19")
modCompileOnly "maven.modrinth:styled-chat:1.4.0+1.19.1"
// ========= Common =====================
modImplementation include('de.erdbeerbaerlp:dcintegration.common:2.4.7-SNAPSHOT') {
changing = true
}
// KiloEssentials
modImplementation name: "kilo_essentials-1.21.3-ModernTimes-1.19.1"
}
processResources {
inputs.property "version", project.version
filteringCharset "UTF-8"
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
archivesBaseName = project.archives_base_name
// 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.
}
remapJar{
classifier = project.minecraft_version
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
//Curseforge publishing
curseforge {
if (project.hasProperty('curseforge.apikey')) { // $GRADLE_USER_HOME/gradle.properties
apiKey = project.getProperty("curseforge.apikey")
project {
id = '493679'
changelog = project.changelog
releaseType = project.releaseType.toLowerCase()
addGameVersion '1.19.1'
mainArtifact(remapJar) {
displayName = "DiscordIntegration-Fabric $version (MC ${project.minecraft_version})"
}
relations {
requiredDependency 'fabric-api'
tool 'no-chat-reports'
}
}
}
}
modrinth{
if (project.hasProperty('modrinth.apikey')) { // $GRADLE_USER_HOME/gradle.properties
token = project.getProperty("modrinth.apikey") // Use an environment property!
projectId = 'rbJ7eS5V'
versionNumber = version+"-${project.minecraft_version}"
versionName = "DiscordIntegration-Fabric $version (MC ${project.minecraft_version})"
uploadFile = remapJar
changelog = project.changelog
gameVersions = ["${project.minecraft_version}"]
loaders = ['fabric']
dependencies {
required.project "fabric-api"
optional.project "no-chat-reports"
}
versionType = project.releaseType.toUpperCase()
}
}
tasks.release.dependsOn(tasks.build, tasks.curseforge,tasks.modrinth)