forked from Prospector/Blur
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
126 lines (101 loc) · 3.24 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
buildscript {
repositories {
mavenCentral()
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' }
}
plugins {
id 'com.matthewprenger.cursegradle' version '1.0.9'
}
apply plugin: 'net.minecraftforge.gradle.forge'
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
ext.buildnumber = System.getenv().BUILD_NUMBER ?: 'custom';
group = 'com.tterrag.blur'
archivesBaseName = "Blur"
version = "${mod_version}-${buildnumber}"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
minecraft {
version = "${minecraft_version}-${forge_version}"
mappings = 'stable_29'
runDir = 'run'
clientJvmArgs += '-Dfml.coreMods.load=com.tterrag.blur.BlurPlugin'
replace "@VERSION@", project.version
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
include '**/*.properties'
// replace version and mcversion
expand 'version': project.version, 'mcversion': project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
}
}
jar.manifest {
attributes 'FMLCorePlugin': 'com.tterrag.blur.BlurPlugin'
attributes 'FMLCorePluginContainsFMLMod': 'true'
}
import org.apache.tools.ant.filters.ReplaceTokens
import groovy.json.JsonSlurper
task createResourcePacks {
def inputFile = new File("resource_packs.json")
def json = new JsonSlurper().parseText(inputFile.text)
json.each {
def pack_id = it.key
def pack_name = it.value.name
def pack_desc = it.value.description
def pack_radius = it.value.radius
def taskName = "createPack" + pack_id.capitalize();
task "${taskName}" (type: Zip) {
from ('pack_template') {
filter(ReplaceTokens, tokens: [
mod_version: project.version.toString(),
pack_version: '3',
description: pack_desc.toString(),
radius: pack_radius.toString()
])
rename(/(.+)\.template/, '$1')
}
from ('pack_icons') {
include "${pack_id}.png"
rename '.+', 'pack.png'
}
baseName = "Blur " + pack_name
}
createResourcePacks.finalizedBy taskName
}
}
// Not necessary atm
// tasks.build.dependsOn createResourcePacks
tasks.curseforge.enabled = !dev && project.hasProperty('curseforge_key')
curseforge {
if (project.hasProperty('curseforge_key')) {
apiKey = project.curseforge_key
}
project {
id = project.project_id
changelogType = 'html'
changelog = System.getenv('CHANGELOG')
if (changelog == null || 'none'.equals(changelog)) {
changelog = getChangelog() ?: ''
changelogType = 'text'
}
releaseType = project.release_type
addGameVersion '1.9.4'
addGameVersion '1.11.2'
addGameVersion '1.12'
addGameVersion '1.12.1'
mainArtifact(jar) {
displayName = "Blur ${mod_version}"
}
}
}