-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild.gradle
106 lines (91 loc) · 2.92 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
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = "https://plugins.gradle.org/m2/" }
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
}
}
repositories {
maven {
url "https://cursemaven.com"
}
}
apply plugin: 'net.minecraftforge.gradle'
String LagGogglesVersion = "1.12.2-5.9"
ext.GetCommitCount = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--all', '--count'
standardOutput = stdout
}
return stdout.toString().trim()
}
version = LagGogglesVersion + "-" + GetCommitCount.call()
group= "com.github.terminatornl.laggoggles" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "LagGoggles"
sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = "1.8"
}
minecraft {
mappings channel: 'snapshot', version: '20171003-1.12'
runs {
client {
workingDirectory project.file('runClient')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
}
server {
workingDirectory project.file('runServer')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
}
}
}
processResources {
def minecraft_version = (minecraft.getMappingVersion() =~ /[\d.]+$/)[0]
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
filter { line -> line.replaceAll('@version',project.version).replaceAll('@mcversion',minecraft_version) }
}
}
configurations {
compileOnly.transitive = false
}
dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
compileOnly "curse.maven:tickcentral-377201:3140670"
}
jar {
manifest {
attributes([
"Specification-Title": project.name,
"Specification-Vendor": "Terminator_NL",
"Specification-Version": project.version,
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Vendor" :"Terminator_NL",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
task clearMods(type: Delete) {
delete fileTree('runServerObf/mods')
}
task installJar(type: Copy, dependsOn: [build, clearMods]) {
from("$buildDir/libs") {
include("${archivesBaseName}-${version}.jar")
}
into "runServerObf/mods"
}
task installObfMods(type: Copy, dependsOn: installJar) {
from configurations.compileOnly
into "runServerObf/mods"
}