-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (93 loc) · 2.72 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
plugins {
id "net.galacticraft.addon"
id "net.galacticraft.tokenizer" version "1.0.0"
}
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = "${minecraft_version}-${mod_version}"
group = "io.github.addonmod"
archivesBaseName = mod_id
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava {
options.encoding = "UTF-8"
}
galacticraft {
// Pulls the latest release version of Galacticraft from maven
latestRelease()
// Or use the latest snapshot version
// useLatestSnapshot()
// you can also specify the exact version to pull from maven
// NOTE: Make sure the version exists, you can view all available
// versions by running the 'listAvailableVersions' task
// gcVersion('4.0.2.284')
}
minecraft {
mappings channel: mappings_channel, version: mappings_version
runs {
client {
workingDirectory project.file('run/client')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
}
server {
workingDirectory project.file('run/server')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
}
jar {
manifest {
attributes([
'Specification-Title': mod_id,
'Specification-Vendor': "ExampleDev",
'Specification-Version': '1', // We are version 1 of ourselves
'Implementation-Title': project.name,
'Implementation-Version': mod_version,
'Implementation-Vendor': "ExampleDev",
'Implementation-Timestamp': new Date().format('yyyy-MM-dd\'T\'HH:mm:ssZ')
])
}
}
def infoMap = [
mod_id: mod_id,
mod_name: mod_name,
mod_version: mod_version,
mod_authors: mod_authors,
mod_description: mod_description.replace('\n', '\\n'),
minecraft_version: minecraft_version
]
def mcmetaMap = [mod_id: mod_id]
def javaMap = [
mod_id: mod_id,
mod_name: mod_name,
mod_version: mod_version,
forge_version: forge_version,
gc_version: extensions.galacticraft.getVersion()
]
tokens {
replaceIn("mcmod.info", infoMap)
replaceIn("pack.mcmeta", mcmetaMap)
replaceIn("Reference.java", javaMap)
}
jar.finalizedBy('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}