This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
generated from KettleMC-Network/GradleBase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (111 loc) · 3.62 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
136
137
138
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java-library'
apply plugin: 'java'
libsDirName = System.getenv('libsDirName') == null ? libsDirName : System.getenv('libsDirName')
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'
version = 1.3
sourceSets {
main {
java {
srcDirs 'src'
}
resources {
srcDirs 'resources'
}
}
test {
java {
srcDirs 'test'
}
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
maven {
url 'https://repo.destroystokyo.com/repository/maven-public/'
}
maven {
url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url 'https://jitpack.io'
}
maven {
url 'https://repo.varoplugin.de/repository/maven-public/'
}
maven {
url 'https://nexus.velocitypowered.com/repository/maven-public/'
}
}
configurations {
internalLibs
implementation.extendsFrom(internalLibs)
}
dependencies {
testImplementation('org.junit.jupiter:junit-jupiter-api:5.7.2')
testImplementation('org.junit.jupiter:junit-jupiter-engine:5.7.2')
this.addModularCompile('com.velocitypowered:velocity-api:3.0.1', 'velocity', false)
this.addModularCompile('org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT', 'spigot', false)
annotationProcessor 'com.velocitypowered:velocity-api:3.0.1'
this.addModularCompile('com.github.SkriptLang:Skript:2.6.1', 'skript', false)
this.addModularCompile('net.kyori:adventure-text-minimessage:4.11.0', 'minimessages', false)
this.addModularCompile('com.github.KettleMC-Network:Konfiguration:2.0.1', 'konfiguration', true)
this.addModularCompile('com.github.almighty-satan:jo2sql:1.2.2', 'jo2sql', true)
this.addModularCompile('com.oracle.ojdbc:ojdbc8:19.3.0.0', 'ojdbc', false)
this.addModularCompile('mysql:mysql-connector-java:8.0.28', 'mysql-connector', false)
this.addModularCompile('com.googlecode.json-simple:json-simple:1.1.1', 'gson', false)
}
boolean checkLib(String filePath) {
return file('libs/' + filePath + '.jar').exists()
}
void addModularCompile(String repoName, String fileName, boolean changingB) {
if (this.checkLib(fileName))
this.dependencies.implementation name: fileName
else
this.dependencies.implementation (repoName) { changing = changingB }
}
void addModularInternal(String repoName, String fileName, boolean changingB) {
if (this.checkLib(fileName))
this.dependencies.internalLibs name: fileName
else
this.dependencies.internalLibs (repoName) { changing = changingB }
}
jar {
manifest {
attributes(
'Manifest-Version': version,
'Class-Path': '.',
'Main-Class': 'net.kettlemc.language.MainLauncher',
)
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
configurations.internalLibs.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from (sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [name: project.name]
filter ReplaceTokens, tokens: [version: String.valueOf(version)]
filter ReplaceTokens, tokens: [author: 'KettleMC']
}
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
outputs.upToDateWhen { false }
showStandardStreams = true
}
}