-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
135 lines (112 loc) · 3.42 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
buildscript {
repositories {
maven {
name = "Gradle Plugins"
url = "https://plugins.gradle.org/m2/"
}
maven {
name = "Minecraft Forge"
url = "https://files.minecraftforge.net/maven"
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.0"
}
}
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "maven-publish"
version = "1.1.0." + ('git rev-list --count HEAD'.execute().text.trim()) + "-1.12.2"
group = "net.buildtheearth"
archivesBaseName = "terraplusplus"
compileJava {
sourceCompatibility = targetCompatibility = "1.8"
}
minecraft {
version = "1.12.2-14.23.5.2847"
runDir = "run"
mappings = "stable_39"
makeObfSourceJar = false
}
configurations {
shade
compile.extendsFrom shade
}
repositories {
maven {
name = "JitPack"
url = "https://jitpack.io/"
}
maven { //used for leveldb
name = "DaPorkchop_"
url = "https://maven.daporkchop.net/"
}
maven { //used for leveldb
name = "OpenCollab Snapshots"
url = "https://repo.opencollab.dev/snapshot/"
}
}
dependencies {
deobfProvided ("com.github.OpenCubicChunks.CubicChunks:cubicchunks:f71aafb9854466ac5ffa0ccd2796921684f1d8b1") {
transitive = false
}
deobfProvided ("com.github.OpenCubicChunks:CubicWorldGen:27de56d2f792513873584b2f8fd9f3082fb259ec") {
transitive = false
}
shade "com.github.DaMatrix:commons-imaging:4c6c5dfe6401a884cb4cf53fb838c99e1dfb104c"
shade "com.fasterxml.jackson.core:jackson-databind:2.11.2"
shade("net.daporkchop.lib:binary:0.5.7-SNAPSHOT") {
exclude group: "io.netty"
}
testCompile "junit:junit:4.12"
compile "org.projectlombok:lombok:1.18.16"
annotationProcessor "org.projectlombok:lombok:1.18.16"
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version': project.version, 'mcversion': project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
shadowJar {
classifier = null
configurations = [project.configurations.shade]
exclude 'module-info.class'
}
build.dependsOn shadowJar
reobf { //reobfuscate the shaded JAR
shadowJar {}
}
//relocate all shaded dependencies
task relocateShadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = "net.buildtheearth.terraplusplus.dep"
}
shadowJar.dependsOn relocateShadowJar
publishing {
publications {
maven(MavenPublication) {
groupId = "net.buildtheearth"
artifactId = "terraplusplus"
version = project.version
from components.java
artifacts.clear()
artifact(shadowJar) {
classifier = ""
}
artifact sourceJar {
classifier "sources"
}
}
}
}