forked from asiekierka/FoamFix17
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
128 lines (109 loc) · 2.79 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://maven.minecraftforge.net/"
}
maven {
name = "gt"
url = "https://gregtech.overminddl1.com/"
}
maven {
url = "https://jitpack.io"
}
maven {
url = "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.11'
}
}
apply plugin: 'forge'
// define the properties file
ext.configFile = file "build.properties"
configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
idea {
module {
inheritOutputDirs = true
}
}
group = config.group_name
version = config.mod_version
archivesBaseName = "${config.mod_id}-${config.minecraft_version}"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
}
}
minecraft {
version = config.minecraft_version + "-" + config.forge_version
runDir = "run/assets"
replaceIn "FoamFixCoreContainer.java"
replace "@VERSION@", "${config.mod_version}"
}
// add some stuff to the version
version = "${config.mod_version}"
processResources {
// replace stuff in the files we want.
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
include '**/*.properties'
// replaces
expand ([
'mod_version': version,
'minecraft_version': project.config.minecraft_version,
'build_number': project.config.build_number,
])
}
// copy everything else, thats we didnt do before
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
}
}
/* license {
sourceSets = [project.sourceSets.main]
header = project.file("docs/LICENSE")
ignoreFailures = true
exclude '***.info'
exclude '***.mcmeta'
} */
sourceSets {
main {
resources {
srcDirs += 'docs'
}
}
}
// change the name of my obfuscated jar
jar {
appendix = 'universal'
manifest {
attributes 'FMLCorePlugin': 'pl.asie.foamfix.coremod.FoamFixCore'
attributes 'FMLCorePluginContainsFMLMod': 'true'
}
}
// add a source jar
task sourceJar(type: Jar) {
from sourceSets.main.allSource
appendix = 'src'
}
// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
from sourceSets.main.output
appendix = 'deobf'
}
artifacts {
archives sourceJar
archives deobfJar
}