This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (107 loc) · 4.04 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
/*
* Adapted from the Wizardry License
*
* Copyright (c) 2018-2020 DaPorkchop_ and contributors
*
* Permission is hereby granted to any persons and/or organizations using this software to copy, modify, merge, publish, and distribute it. Said persons and/or organizations are not allowed to use the software or any derivatives of the work for commercial use or any other means to generate income, nor are they allowed to claim this software as their own.
*
* The persons and/or organizations are also disallowed from sub-licensing and/or trademarking this software without explicit permission from DaPorkchop_.
*
* Any persons and/or organizations using this software must disclose their source code and have it publicly available, include this license, provide sufficient credit to the original authors of the project (IE: DaPorkchop_), as well as provide a link to the original project.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
buildscript {
repositories {
jcenter()
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"
ext {
//general things
javaVersion = "1.8"
flatearthVersion = "0.0.1." + ('git rev-list --count HEAD'.execute().text.trim())
//minecraft things
mcpmappingsVersion = "stable_39"
minecraftforgeVersion = "14.23.5.2847"
minecraftVersion = "1.12.2"
//dependency things
junitVersion = "4.12"
leveldbVersion = "0.0.10-SNAPSHOT"
lombokVersion = "1.16.20"
porklibVersion = "0.5.5-SNAPSHOT"
}
version = "$flatearthVersion"
group = "net.daporkchop"
compileJava {
sourceCompatibility = targetCompatibility = "$javaVersion"
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
repositories {
maven {
name = "DaPorkchop_"
url = "https://maven.daporkchop.net/"
}
maven {
name = "SpongePowered"
url = "http://repo.spongepowered.org/maven/"
}
maven { //contains Jankson, used by CubicWorldGen
name = "elytradev"
url = "https://repo.elytradev.com/"
}
}
configurations {
shade
compile.extendsFrom shade
}
dependencies {
deobfCompile "io.github.opencubicchunks:cubicchunks:1.12.2-0.0-SNAPSHOT"
deobfCompile "io.github.opencubicchunks:cubicworldgen:1.12.2-0.0-SNAPSHOT"
testCompile "junit:junit:$junitVersion"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
}
minecraft {
version = "$minecraftVersion-$minecraftforgeVersion"
runDir = "run"
mappings = "$mcpmappingsVersion"
makeObfSourceJar = false
}
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
}
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
rename '(.+_at.cfg)', 'META-INF/$1'
}
shadowJar {
classifier = null
configurations = [ project.configurations.shade ]
}
build.dependsOn shadowJar
reobf {
shadowJar {}
}
task relocateShadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = "net.daporkchop.flatearth.dep"
}
shadowJar.dependsOn relocateShadowJar