forked from maruohon/tweakeroo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
143 lines (117 loc) · 3.78 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
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = 'sponge'
url = 'http://repo.spongepowered.org/maven'
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
repositories {
maven {
url 'https://masa.dy.fi/maven'
}
}
apply plugin: 'net.minecraftforge.gradle.liteloader'
apply plugin: 'org.spongepowered.mixin'
ext.configFile = file "build.properties"
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = 'UTF-8'
}
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
minecraft {
version = config.minecraft_version
mappings = config.mappings_version
runDir = 'minecraft'
makeObfSourceJar = false
ext.mod_version = config.mod_version
if (mod_version.endsWith('-dev')) {
mod_version = mod_version + "." + new Date().format('yyyyMMdd.HHmmss')
}
replaceIn "Reference.java"
replace "@MOD_VERSION@", mod_version
}
dependencies {
deobfCompile "fi.dy.masa.malilib:malilib-" + config.minecraft_version_out + ":" + config.malilib_version + ":deobf"
}
sourceSets {
main {
ext.refMap = 'mixins.' + config.mod_id + '.refmap.json'
}
}
group = config.group + "." + config.mod_id // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = config.mod_id + '-' + config.minecraft_version_out
version = project.minecraft.mod_version
/**
* This section allows you to customise the generated litemod.json file
*/
litemod {
json {
name = config.mod_id
displayName = config.mod_name
mcversion = config.minecraft_version
version = config.mod_version
author = config.author
// Uncomment any of the following lines and fill in your own details as required
//requiredAPIs = [ 'someapi' ]
//tweakClass = 'name.of.tweaker.here'
dependsOn = [ 'malilib' ]
mixinConfigs = [ 'mixins.' + config.mod_id + '.json' ]
}
}
/**
* This section allows you to customise your generated jar (litemod) file. By
* default it includes the generated litemod.json file, however if you prefer to
* include your own file from resources, simply remove the line below.
*/
jar {
// Remove the "-mc1.12" suffix from the file name
classifier = ""
// Don't append a 'mod-' filename prefix >_>
baseName = archivesBaseName
from litemod.outputs
/*
manifest.mainAttributes (
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
'Implementation-Title': config.mod_id,
'Implementation-Version': project.version
)
*/
}
mixin {
defaultObfuscationEnv notch
}
//tasks.withType(Jar)*.baseName = archivesBaseName
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "mod_version", project.minecraft.mod_version
inputs.property "minecraft_version", project.config.minecraft_version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'mod_version': project.minecraft.mod_version, 'minecraft_version': project.config.minecraft_version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}