-
Notifications
You must be signed in to change notification settings - Fork 48
/
build.gradle
66 lines (56 loc) · 2.13 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
buildscript {
repositories {
jcenter()
maven { url = 'https://files.minecraftforge.net/maven' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath 'org.ajoberstar:grgit:1.1.0'
}
}
apply plugin: 'net.minecraftforge.gradle'
compileJava.options.encoding = 'UTF-8'
// VERSION
def git = org.ajoberstar.grgit.Grgit.open(file('..'))
def git_head = git.head()
def git_tags = git.tag.list().findAll {
it.commit == git_head
}
version = git_tags.size() > 0 ? git_tags[0].getName() : git_head.abbreviatedId;
println "Compiling version ${version}"
group = "de.michaelzangl.minebot"
archivesBaseName = 'Minebot'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
// mappings channel: 'snapshot', version: '20200225-1.15.1'
mappings channel: 'snapshot', version: '20200514-1.16'
runs {
client {
workingDirectory project.file('run')
}
}
}
dependencies {
// minecraft 'net.minecraftforge:forge:1.15.2-31.1.43'
minecraft 'net.minecraftforge:forge:1.16.3-34.0.17'
}
jar {
manifest {
attributes([
"Specification-Title": "minebot",
"Specification-Vendor": "Michael Zangl",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"Michael Zangl",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
jar.finalizedBy('reobfJar')