forked from DarkShadow44/SereneSeasons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
114 lines (94 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
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'maven'
// 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
}
group = "com.github.glitchfiend.biomesoplenty"
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}"
archivesBaseName = "SereneSeasons"
config.build_number = (System.getenv().BUILD_NUMBER) ? System.getenv().BUILD_NUMBER : ""
minecraft {
version = config.minecraft_version + "-" + config.forge_version
useDepAts = true
mappings = project.config.mappings_version
// gradle complains if this isn't set when setting up/using IDEA workspace
runDir = "run"
// set a full version string with appended build number to be used in mod registration
def buildnum = (config.build_number!="") ? '.' + config.build_number : ""
replace '@MOD_VERSION@', config.mod_version + buildnum
replace '1.0.0.0', config.forge_version
replaceIn 'SereneSeasons.java'
}
def commonManifest = {
attributes (
"FMLCorePlugin": 'sereneseasons.asm.SSLoadingPlugin',
"FMLCorePluginContainsFMLMod": 'true',
"ForceLoadAsMod": 'true',
"FMLAT": 'sereneseasons_at.cfg'
)
}
jar {
manifest commonManifest
classifier = 'universal'
}
processResources {
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
include '**/*.properties'
// replaces
expand ([
'modid': project.archivesBaseName,
'mod_version': project.config.mod_version,
'minecraft_version': project.config.minecraft_version,
'build_number': project.config.build_number
])
}
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
from (sourceSets.main.output) {
include 'LICENSE.txt'
}
classifier = 'sources'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
manifest commonManifest
classifier = 'deobf'
}
task apiJar(type: Jar) {
from(sourceSets.main.allJava) {
include 'sereneseasons/api/**'
}
from (sourceSets.main.output) {
include 'LICENSE.txt'
include 'sereneseasons/api/**'
}
classifier = 'api'
}
artifacts {
archives sourcesJar
archives deobfJar
archives apiJar
}