-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.gradle
166 lines (142 loc) · 5.54 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Credit for getting Mixins to work:
// https://github.com/Darkhax-Minecraft/Nautilus/blob/master/build.gradle
buildscript {
repositories {
jcenter()
maven {
name = "Forge"
url 'http://files.minecraftforge.net/maven'
}
maven {
url 'http://repo.spongepowered.org/maven'
}
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.4.0'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'com.matthewprenger.cursegradle'
apply plugin: 'maven-publish'
apply from: 'configuration.gradle'
if (file('secrets.properties').exists()) {
println "Loading parameters from secrets.properties"
ext.secrets = new Properties()
file('secrets.properties').withReader {ext.secrets.load(it)}
}
repositories {
maven { url "http://chickenbones.net/maven/" }
maven { url "http://dvs1.progwml6.com/files/maven" }
maven { url "http://maven.tterrag.com" }
maven { url "https://repo.elytradev.com/" }
maven { url 'http://repo.spongepowered.org/maven' }
maven { url 'https://maven.mcmoddev.com' }
maven { url "https://maven.blamejared.com/" }
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
minecraft {
if (project.ext.has('secrets')) {
if (project.ext.secrets.uuid != null)
clientRunArgs.AddAll(["--uuid ${project.ext.secrets.uuid}"])
if (project.ext.secrets.username != null)
clientRunArgs.AddAll(["--username ${project.ext.secrets.username}"])
if (project.ext.secrets.password != null)
clientRunArgs.AddAll(["--password ${project.ext.secrets.password}"])
if (project.ext.secrets.jvmArgs != null) {
clientJvmArgs.AddAll(project.ext.secrets.jvmArgs)
serverJvmArgs.AddAll(project.ext.secrets.jvmArgs)
}
}
runDir = "run"
replace '@VERSION@', project.ext.modVersion
replace '@FINGERPRINT@', project.ext.fingerprint
replace '@UPDATEURL@', project.ext.updateurl
mappings = project.ext.snapshot
}
configurations {
embed
implementation.extendsFrom(embed)
}
sourceSets {
main {
ext.refMap = "mixins.dsurround.refmap.json"
}
}
dependencies {
compile "craftstudio-api:CraftStudioAPI-universal-1.0.1.95:mc1.12:alpha"
compile "com.animania:animania-${project.mcVersion}-base:${project.animaniaBaseVersion}"
compile "com.animania:animania-${project.mcVersion}-farm:${project.animaniaFarmVersion}"
compile "com.animania:animania-${project.mcVersion}-extra:${project.animaniaExtraVersion}"
compile "serene-seasons:SereneSeasons-${project.mcVersion}:${project.ssVersion}:universal"
compile "codechicken-lib-1-8:CodeChickenLib-1.12.2:3.2.3.358:universal"
compile "forge-multipart-cbe:ForgeMultipart-1.12.2:2.6.2.83:universal"
compile "ctm:CTM:MC1.12.2:${project.ctmVersion}"
compile "cosmetic-armor-reworked:CosmeticArmorReworked:1.12.2:v3"
compile "littletiles:LittleTiles_v1.5.0:pre169_mc1.12.2"
compile "iron-chests:ironchest:1.12.2:7.0.72.847"
compile "biomes-o-plenty:BiomesOPlenty-1.12.2:7.0.1.2441:universal"
compile "org.spongepowered:mixin:0.8.2"
compile 'mcjty.theoneprobe:TheOneProbe-1.12:1.12-1.4.28-17'
//compile "creativecore:CreativeCore_v1.9.35_mc1.12.2"
deobfCompile "mezz.jei:jei_${project.mcVersion}:${project.jeiVersion}:api"
runtime "mezz.jei:jei_${project.mcVersion}:${project.jeiVersion}"
deobfCompile "team.chisel:Chisel:MC${project.mcVersion}-${project.chiselVersion}"
if (fileTree(dir: 'libs').filter { it.name.startsWith('OreLib') }.getFiles().size() == 0)
compile "orelib:OreLib:1.12.2:3.6.0.1"
}
processResources
{
// this will ensure that this task is redone when the versions change.
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 that's not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "LICENSE.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
}
// Add CREDITS.md
into('/') {
from('CREDITS.md')
}
manifest.attributes(
"FMLCorePluginContainsFMLMod": "true",
"ForceLoadAsMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"TweakOrder": 0,
"MixinConfigs": "mixins.dsurround.json",
"FMLCorePlugin": "org.orecruncher.dsurround.mixins.TransformLoader"
)
}
// https://gist.github.com/matthewprenger/9b2da059b89433a01c1c
task signJar(type: SignJar) {
onlyIf { // Skip the task if our secret data isn't available
project.hasProperty('keyStore')
}
keyStore = project.keyStore // This needs to be a path to the keystore file
alias = project.keyStoreAlias
storePass = project.keyStorePass
keyPass = project.keyStoreKeyPass
inputFile = jar.archivePath
outputFile = jar.archivePath
}
build.dependsOn signJar