forked from SpongePowered/SpongeForge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
117 lines (94 loc) · 3.23 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
// Gradle plugins
buildscript {
repositories {
maven {
name = 'gradle-plugins'
url = 'https://plugins.gradle.org/m2'
}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'gradle.plugin.net.minecrell:licenser:0.3'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'gradle.plugin.org.spongepowered:spongegradle:0.7'
classpath 'org.spongepowered:mixingradle:0.4-SNAPSHOT'
}
}
// On Forge, we use the Forge build number as Minecraft version for ForgeGradle
ext.minecraftVersion = forgeBuild
// Apply shared implementation Gradle config
apply from: project(':SpongeCommon').file('gradle/implementation.gradle')
minecraft {
coreMod = 'org.spongepowered.mod.SpongeCoremod'
}
version = "$minecraft.version-$forgeBuild-$apiSuffix-$buildNumber"
compileJava {
options.compilerArgs += [ "-Atokens=FORGE=$forgeBuild;FML=$forgeBuild" ]
}
jar {
exclude 'log4j2.xml' // log4j2 configuration is for the development workspace only
manifest {
attributes(
'Main-Class': 'org.spongepowered.launch.Main',
'TargetForgeBuild': forgeBuild,
'TargetForgeVersion': minecraft.forgeVersion,
'FMLCorePlugin': 'org.spongepowered.mod.SpongeCoremod',
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': 0
)
}
}
processResources {
from('src/main/resources') {
include 'mcmod.info'
expand(
version: project.version,
url: project.url,
minecraftVersion: minecraft.version,
forgeVersion: minecraft.forgeVersion
)
}
}
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
task shadowDevJar(type: ShadowJar) {
classifier = 'dev-shaded'
from sourceSets.main.output
from sourceSets.java6.output
// Default settings for shadow tasks
configurations = [project.configurations.runtime]
manifest.inheritFrom tasks.jar.manifest
exclude 'META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA'
}
shadowDevJar shadowConfiguration
// Upload shadowDevJar to Maven repository
artifacts {
archives shadowDevJar
}
allprojects {
// Re-obfuscate only after creating the shadowDevJar
tasks.findByName('reobfJar')?.mustRunAfter rootProject.tasks.shadowDevJar
}
tasks.withType(ShadowJar) {
exclude 'log4j2*.xml' // log4j2 configuration is for the development workspace only
// Temporarily relocate and shade to avoid confict with forge. TODO: Remove when Forge updates to 1.3.0
relocate('com.typesafe.config', 'configurate.typesafe.config')
dependencies {
include dependency('com.typesafe:config')
// This is not available on the client so we need to shade it
include dependency('com.google.code.findbugs:jsr305')
}
}
reobf {
jar {
extraFiles 'extraSrg.srg'
}
}
apply from: 'changelog.gradle'