-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
142 lines (110 loc) · 4.17 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 'fabric-loom' version '0.10-SNAPSHOT'
id "com.matthewprenger.cursegradle" version '1.4.0'
id "com.modrinth.minotaur" version '2.4.0'
id 'maven-publish'
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = project.mod_version
def ENV = System.getenv()
def RELEASE_NAME = "${version}"
def RELEASE_FILE = "${buildDir}/libs/${archivesBaseName}-${version}.jar"
@SuppressWarnings('GrMethodMayBeStatic')
def getChangeLog() {
return ""
}
repositories {
mavenCentral()
maven { url 'https://maven.minecraftforge.net/' } // Terrablender
maven { url "https://maven.blamejared.com" } // Patchouli
maven { url "https://maven.shedaniel.me/" } // REI
maven { url "https://jitpack.io" } // Omega Config, Fabric Shield Lib
maven { url 'https://maven.terraformersmc.com/releases/' } // Mod Menu
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "com.github.glitchfiend:TerraBlender-fabric:${project.terrablender_version}"
modRuntimeOnly "com.github.glitchfiend:TerraBlender-fabric:${project.terrablender_version}"
modImplementation "vazkii.patchouli:Patchouli:${project.patchouli_version}"
modImplementation "com.github.Draylar.omega-config:omega-config-base:${project.omega_config_version}"
include "com.github.Draylar.omega-config:omega-config-base:${project.omega_config_version}"
modImplementation "com.github.Draylar.omega-config:omega-config-gui:${project.omega_config_version}"
include "com.github.Draylar.omega-config:omega-config-gui:${project.omega_config_version}"
modImplementation "com.github.CrimsonDawn45:Fabric-Shield-Lib:v${project.fabric_shield_lib_version}"
include "com.github.CrimsonDawn45:Fabric-Shield-Lib:v${project.fabric_shield_lib_version}"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
modRuntimeOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
}
processResources {
inputs.property "1.0", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
loom {
accessWidenerPath = file("src/main/resources/magicfungi.accesswidener")
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}
curseforge {
if (ENV.CURSEFORGE_API_KEY) {
apiKey = ENV.CURSEFORGE_API_KEY
}
project {
id = project.curseforge_id
changelog = getChangeLog()
releaseType = "beta"
addGameVersion project.minecraft_version
addGameVersion "Fabric"
mainArtifact(file(RELEASE_FILE)) {
displayName = RELEASE_NAME
relations {
requiredDependency 'fabric-api'
requiredDependency 'terrablender-fabric'
requiredDependency 'patchouli-fabric'
embeddedLibrary 'omega-config'
embeddedLibrary 'fabric-shield-lib'
optionalDependency 'roughly-enough-items'
}
}
afterEvaluate {
uploadTask.dependsOn("remapJar")
}
}
options {
forgeGradleIntegration = false
}
}
//Modrinth publishing
modrinth {
if (ENV.MODRINTH_TOKEN) {
token = ENV.MODRINTH_TOKEN
}
projectId = project.modrinth_id
versionNumber = project.mod_version
uploadFile = remapJar
gameVersions = [project.minecraft_version]
loaders = ['fabric']
versionType = "beta"
changelog = getChangeLog()
dependencies {
required.project("fabric-api")
required.project("patchouli")
optional.project("roughly-enough-items")
}
}