forked from Elikill58/Negativity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (92 loc) · 2.86 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'java-library'
id 'io.github.goooler.shadow' version '8.1.7'
id 'fabric-loom' version '1.7-SNAPSHOT' apply false
id 'org.spongepowered.gradle.plugin' version '2.2.0' apply false
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' apply false
}
shadowJar {
archiveBaseName.set('Negativity')
archiveClassifier.set(null)
mergeServiceFiles()
}
task prepareServer(type: Copy) {
from shadowJar.outputs
def pluginRename = System.getProperty('plugins.rename')
if(pluginRename == null || pluginRename.toBoolean()) {
rename { 'Negativity.jar' }
}
def pluginDir = System.getProperty('plugins.dir')
if (pluginDir == null) {
enabled(false)
} else {
into pluginDir
}
}
build.dependsOn shadowJar
tasks.named('javadoc') {
enabled false
}
subprojects {
apply plugin: 'java-library'
group = 'com.elikill58'
repositories {
mavenCentral()
maven {
name 'jitpack'
url 'https://jitpack.io/'
}
maven {
name 'codemc'
url 'https://repo.codemc.org/repository/maven-public/'
}
maven {
name 'Sonatype'
url 'https://oss.sonatype.org/content/groups/public/'
}
maven {
name 'eliapp'
url 'https://repo.eliapp.fr:8081/repository/internal/'
}
maven {
name = "ViaVersion"
url = "https://repo.viaversion.com"
}
}
dependencies {
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
compileOnly 'org.checkerframework:checker-qual:3.7.0'
compileOnly 'io.netty:netty-all:4.1.85.Final'
}
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
if (project.name != 'common') {
dependsOn ':common:javadoc'
}
options.encoding = 'UTF-8'
setFailOnError(false) // TODO fix all javadoc errors
destinationDir = file("${rootProject.buildDir}/docs/javadoc/${project.path.substring(1).replace(':', '-')}")
options {
if (project.name != 'common') {
links '../common'
}
links "https://docs.oracle.com/javase/${java.toolchain.languageVersion.get().asInt()}/docs/api/"
}
}
tasks.withType(ProcessResources) {
filteringCharset = 'UTF-8'
}
if (project.name != "common") {
tasks.withType(ShadowJar).configureEach {
dependencies {
exclude(dependency("com.viaversion:opennbt:.*"))
exclude(dependency("org.yaml:snakeyaml:.*"))
exclude(dependency("it.unimi.dsi:fastutil:.*"))
}
}
}
}