forked from airbreather/YAFM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
68 lines (57 loc) · 1.63 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
defaultTasks 'setupDevWorkspace', 'build'
buildscript
{
repositories
{
jcenter()
maven
{
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
}
dependencies
{
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
}
apply plugin: "eclipse"
apply plugin: 'net.minecraftforge.gradle.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
}
archivesBaseName = 'yafm'
version = config.mod_version
group = 'airbreather.mods.yafm'
minecraft.version = config.minecraft_version + '-' + config.forge_version
minecraft.runDir = 'eclipse'
minecraft.mappings = 'stable_20'
minecraft.makeObfSourceJar = false
processResources
{
// replace stuff in the files we want.
from(sourceSets.main.resources.srcDirs)
{
include '**/*.info'
include '**/*.properties'
// replaces
expand(['mod_version': config.mod_version,
'minecraft_version': config.minecraft_version,
'forge_version': config.forge_version])
}
// copy everything else (what we didn't do before)
from(sourceSets.main.resources.srcDirs)
{
exclude '**/*.info'
exclude '**/*.properties'
}
}
// Exclude the core from the package.
// I should start keeping these separate, because updates can screw with things.
jar.exclude 'airbreather/mods/airbreathercore'