-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
143 lines (126 loc) · 3.87 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 { url = "https://files.minecraftforge.net/maven" }
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url = "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
classpath "com.wynprice.cursemaven:CurseMaven:2.1.5"
classpath "com.puppycrawl.tools:checkstyle:6.19"
}
}
apply plugin: "com.wynprice.cursemaven"
apply plugin: "com.matthewprenger.cursegradle"
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "idea"
apply plugin: "java"
apply plugin: "checkstyle"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
file "build.properties" withReader {
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
if (file("curse.properties").exists()) {
file "curse.properties" withReader {
def prop = new Properties()
prop.load(it)
ext.curse = new ConfigSlurper().parse prop
}
} else {
ext.curse = new Properties()
ext.curse.key = ''
}
version = config.mod.version
group = config.mod.group
archivesBaseName = config.mod.name
ext.simpleVersion = version
version = "${config.minecraft.version}-${project.version}"
minecraft {
version = "${config.minecraft.version}-${config.forge.version}"
runDir = "run"
useDepAts = true
mappings = config.minecraft.mappings
replace "@MCVERSION@", config.minecraft.version
replace "@FVERSION@", config.forge.version
replace "@MODID@", config.mod.id
replace "@MODNAME@", config.mod.name
replace "@MODDESC@", config.mod.desc
replace "@MODVERSION@", config.mod.version
replace "@MODAUTHOR@", config.mod.author
replace "@MODURL@", config.mod.url
}
configurations {
embedded
compile.extendsFrom provided, embedded
}
dependencies {
compile "curse.maven:OpenComputers:2828357"
compile "curse.maven:gregtech:2974205"
provided ("curse.maven:appliedenergistics2-api:2747063") {
transitive = false
}
}
extractRangemapReplacedMain {
sourceSets {
main {
java {
exclude "org/eientei/gtce2oc/reference"
}
}
}
}
processResources {
inputs.property "id", config.mod.id
inputs.property "name", config.mod.name
inputs.property "desc", config.mod.desc
inputs.property "version", config.mod.version
inputs.property "author", config.mod.author
inputs.property "url", config.mod.url
inputs.property "mcversion", config.minecraft.version
inputs.property "fversion", config.forge.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'id': config.mod.id,
'name': config.mod.name,
'desc': config.mod.desc,
'version': config.mod.version,
'author': config.mod.author,
'url': config.mod.url,
'mcversion': config.minecraft.version,
'fversion': config.forge.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
exclude "org/eientei/gtce2oc/reference"
}
def getGitComment = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'show', '-s', '--format=%B', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
curseforge {
apiKey = curse.key
project {
id = config.curse.id
changelog = getGitComment
releaseType = "release"
addGameVersion config.minecraft.version
mainArtifact(jar) {
relations {
requiredDependency "gregtechce"
requiredDependency "opencomputers"
}
}
}
}