forked from CuukyOfficial/VaroPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
171 lines (139 loc) · 4.38 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java-library'
apply plugin: 'maven-publish'
group 'de.varoplugin'
version '4.9.3-BETA-1'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'
sourceSets {
main {
java {
srcDirs 'src'
}
resources {
srcDirs 'resources'
}
}
test {
java {
srcDirs 'test'
}
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
maven {
url 'https://repo.varoplugin.de/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://maven.sk89q.com/repo/'
}
maven {
url 'https://m2.dv8tion.net/releases'
}
maven {
url 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
}
}
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.addModularImplementation('org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT', 'spigot', false)
this.addModularCompile('com.googlecode.json-simple:json-simple:1.1.1', 'gson', false)
this.addModularCompile('com.sk89q.worldedit:worldedit-bukkit:6.1.3-SNAPSHOT', 'worldedit', true)
this.addModularCompile('com.github.labymod:legacy-labymod-server-api:1.0', 'labymodapi', true)
this.addModularCompile('net.dv8tion:JDA:4.4.0_351', 'jda', false)
this.addModularCompile('com.github.pengrad:java-telegram-bot-api:5.4.0', 'telegramapi', false)
this.addModularCompile('me.clip:placeholderapi:2.10.10', 'placeholderapi', false)
this.addModularInternal('de.varoplugin:CFW:0.6.8', 'CFW', true)
}
boolean checkLib(String filePath) {
return file('libs/' + filePath + '.jar').exists()
}
void addModularCompile(String repoName, String fileName, boolean changingB) {
if (this.checkLib(fileName))
this.dependencies.compileOnly name: fileName
else
this.dependencies.compileOnly (repoName) { changing = changingB }
}
void addModularImplementation(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 {
if (project.hasProperty('destinationDir'))
destinationDir = file(project.property('destinationDir').toString())
if (project.hasProperty('fileName'))
archiveFileName = project.property('fileName').toString()
manifest {
attributes(
'Manifest-Version': '1.0',
'Class-Path': '.',
'Main-Class': 'de.cuuky.varo.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: 'Varo']
filter ReplaceTokens, tokens: [version: project.version]
filter ReplaceTokens, tokens: [author: 'Cuuky']
}
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
outputs.upToDateWhen { false }
showStandardStreams = true
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'VaroPlugin'
url = 'https://varoplugin.de'
}
}
}
repositories {
maven {
url 'https://repo.varoplugin.de/repository/maven-releases/'
credentials {
username project.hasProperty('repouser') ? project.property('repouser').toString() : null
password project.hasProperty('repopassword') ? project.property('repopassword').toString() : null
}
}
}
}