forked from BiscuitDevelopment/SkyblockAddons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
113 lines (92 loc) · 3.31 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
plugins {
id 'java'
id 'net.minecraftforge.gradle.forge' version '2.1-SNAPSHOT'
id 'io.franzbecker.gradle-lombok' version '3.3.0'
id 'com.github.johnrengelman.shadow' version '4.0.4'
}
group = 'codes.biscuit'
// The below line is for version checkers <= 1.4.2
//version = "1.5.1"
// Java plugin settings
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'
minecraft {
version = "${project.minecraftVersion}-${project.forgeVersion}"
runDir = "run"
mappings = "${project.mappings}"
// Replace placeholders in source code
replace("@MOD_ID@": project.modId,
"@MOD_NAME@": project.modName,
"@VERSION@": project.version,
"@MOD_ACCEPTED@": project.acceptedMinecraftVersions,
"@UPDATE_JSON@": project.updateJSON)
replaceIn("${project.modName}.java")
}
repositories {
maven {
name 'JitPack'
url 'https://jitpack.io'
}
}
dependencies {
// Discord RPC for Java https://github.com/jagrosh/DiscordIPC
implementation('com.github.jagrosh:DiscordIPC:e29d6d8') {
exclude module: 'log4j'
}
}
jar {
// Set the archive name here instead of in shadowJar because ForgeGradle needs it when re-obfuscating the jar.
archiveName = project.modName + "-" + version + "-for-MC-1.8.9.jar"
// Disable the default jar task and use shadowJar instead to shade the libraries into the jar.
enabled = false
}
shadowJar {
archiveName = tasks.jar.archiveName
classifier = ''
manifest.attributes(
'Main-Class': 'SkyblockAddonsInstallerFrame',
'FMLCorePlugin': "${project.group}.${project.modId}.tweaker.${project.modName}LoadingPlugin",
'ForceLoadAsMod': true,
'FMLCorePluginContainsFMLMod': true,
'ModSide': 'CLIENT',
'FMLAT': "${project.modId}_at.cfg"
)
exclude('dummyThing')
exclude('META-INF/maven/')
exclude('META-INF/nar/')
exclude('module-info.class')
exclude('META-INF/versions/')
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
// If you're in a dev environment, you need to run this task before running Minecraft.
task processResourcesDev(type: Copy) {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
include 'data.json'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version, 'updatePullLink':project.updateJSON
}
// copy everything else that's not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
into sourceSets.main.java.outputDir
}
tasks.reobfJar.dependsOn(tasks.shadowJar)