forked from ZelGimi/industrialupgrade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
178 lines (155 loc) · 5.17 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
buildscript {
repositories {
maven {
name = ":forge"
url = 'https://files.minecraftforge.net/maven'
}
maven {
url 'https://plugins.gradle.org/m2/'
}
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.+', changing: true
classpath "gradle.plugin.net.kyori:blossom:1.1.0"
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: "net.kyori.blossom"
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = modVersion
group = modGroup
archivesBaseName = modBaseName
//noinspection GroovyAssignabilityCheck
project.ic2_range = "[${project.ic2_min_ver},${project.ic2_max_ver}]"
blossom {
replaceToken '%VERSION%', modVersion
replaceToken "%IC2_RANGE%", ic2_range
replaceToken "%CERTIFICATE%", fingerprint
}
sourceSets {
main {
java {
srcDirs = ["src/main/java"]
}
resources {
srcDirs = ["src/main/resources"]
}
}
}
minecraft {
//noinspection GroovyAssignabilityCheck
mappings channel: "snapshot", version: mcp_version
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
}
server {
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
}
data {
property 'forge.logging.console.level', 'debug'
workingDirectory project.file('run')
args '--mod', 'supersolarpanels', '--all',
'--output', file('src/generated/resources/'),
'--existing', file('src/main/resources/')
}
}
}
repositories {
maven {
name 'IC2'
url 'http://maven.ic2.player.to'
content {
includeGroup 'net.industrial-craft'
}
}
maven {
name 'progwml6'
url 'https://dvs1.progwml6.com/files/maven'
content {
includeGroup 'mezz.jei'
}
}
maven {
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}
dependencies {
minecraft([
group : "net.minecraftforge",
name : "forge",
version: "${minecraft_version}-${forge_version}"
])
compileOnly "curse.maven:thaumcraft-223628:2629023"
compileOnly "curse.maven:wireless-solar-panels-377164:2954663"
compileOnly "curse.maven:botania-225643:2846950"
compileOnly "mezz.jei:jei_1.12.2:4.16.1.302:api"
runtimeOnly "net.industrial-craft:industrialcraft-2:${project.ic2_max_ver}"
compileOnly "net.industrial-craft:industrialcraft-2:2.8.193-ex112:dev"
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft_version
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"
expand "version": project.version, "mcversion": project.minecraft_version,
"ic2_range": project.ic2_range
}
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
}
jar {
manifest {
attributes([
"Specification-Title" : project.name,
"Specification-Vendor" : "ijo42",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.version,
"Implementation-Vendor" : "Denfop",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Git-Commit-Hash" : getGitHash()
])
}
from 'LICENSE'
from sourceSets.main.output.classesDirs
from sourceSets.main.output.resourcesDir
}
apply from: 'https://gist.github.com/ijo42/6b215e76269a72f37194b924ddda038e/raw/d782226840813ae6703044c51e98b61eb4675875/signjar.groovy'
build.dependsOn signJar
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
options.incremental = true // one flag, and things will get so MUCH faster
sourceCompatibility = targetCompatibility = '1.8'
}
jar.archiveFileName = "${project.archivesBaseName}-${project.minecraft_version}-${project.version}.jar"
jar.finalizedBy('reobfJar')
defaultTasks 'build'
static def getGitHash() {
try {
def process = 'git rev-parse --short HEAD'.execute()
process.waitFor()
return (process.exitValue() ? 'unknown' : process.text.trim())
} catch (IOException ignored) {
return 'unknown'
}
}
// Hack to include resources for Forge 1.12.2 using FG3
sourceSets { main { output.resourcesDir = output.classesDirs[0] } }