This repository has been archived by the owner on Dec 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
92 lines (77 loc) · 2.78 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
buildscript {
ext.kotlin_version = '1.1.2-5'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: "maven"
apply plugin: "java"
apply plugin: "kotlin"
ext.minecraft_version = "1.12"
ext.bukkit_version = "$minecraft_version-R0.1-SNAPSHOT"
group = 'org.fountainmc'
version = "$minecraft_version-R0.1-SNAPSHOT"
apply from: project(":api").file("utils.gradle")
ext.versionSignature = ext.rawComputeVersionSignature(version)
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.techcable.net/content/groups/public/" }
maven { url "https://repo.destroystokyo.com/repository/maven-public/" }
maven { url "https://oss.sonatype.org/content/groups/public/" }
maven { url "https://libraries.minecraft.net/" }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" // Include kotlin reflection too
/*
* NOTE: Override guava version to mojang's version
* TODO: Figure out how to reconcile this with FountainAPI's modern version.
*/
compile "com.google.guava:guava:17.0"
compile "it.unimi.dsi:fastutil:7.2.0" // NOTE: Include the entire fastutil jar
// Use log4j as the underlying logging implementation, instead of bukkit's hacky java.util.Logger emulation.
compile "org.slf4j:slf4j-log4j12:$slf4j_version"
compile project(":api")
// CraftBukkit dependencies
compile "com.destroystokyo.paper:paper-api:$bukkit_version" // NOTE: Compile against Paper API since they stay more up to date
compile "jline:jline:2.12.1"
compile "net.sf.trove4j:trove4j:3.0.3" // Why do they still use trove?
}
sourceSets {
main {
java.srcDir("patched") // Include the patched sources too
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
jar {
inputs.property("versionSignature", versionSignature) // Recompute manifest when signature changes
manifest {
attributes(
"Implementation-Title": "TacoFountain",
"Implementation-Version": versionSignature,
"Implementation-Vendor": "FountainMC Team",
)
}
}
ext.includedServerLibraries = [
// Server libraries
]
for (library in determineServerLibraries(minecraft_version)) {
dependencies.add("compile", library)
}
import groovy.json.JsonSlurper
Set<String> determineServerLibraries(String version) {
def prog = "fountain.sh print-server-classpath ${ext.minecraft_version}".exec()
assert prog.waitFor() == 0, "Failed to execute print-server-classpath!"
def slurper = new JsonSlurper()
return slurper.parseText(prog.text.trim())
}