-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
44 lines (35 loc) · 1.22 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
apply plugin: 'java'
group 'net.cakelancelot'
version '1.0-SNAPSHOT'
ext.getSFS2XPath = {
// TODO make sure this works for OSes other than Windows
if (System.getenv('SFS2X_HOME') == null) {
return new File(System.getProperty('user.home'), 'SmartFoxServer_2X/SFS2X')
} else {
return new File(System.getenv('SFS2X_HOME'))
}
}
tasks.register('copySFS2XLibs', Copy) {
if (getSFS2XPath() == null) {
throw new FileNotFoundException('Unable to find SFS2X - please install it or set up SFS2X_HOME environment variable.')
}
def SFS2XLibPath = new File(getSFS2XPath(), 'lib')
duplicatesStrategy= DuplicatesStrategy.EXCLUDE
from new File(SFS2XLibPath, 'sfs2x.jar'), new File(SFS2XLibPath, 'sfs2x-core.jar')
into layout.projectDirectory.dir("lib")
}
tasks.register('deploy', Copy) {
duplicatesStrategy= DuplicatesStrategy.INCLUDE
from layout.buildDirectory.file('libs/HeroesZoneExtension.jar')
into new File(getSFS2XPath(), 'extensions/Heroes/')
}
tasks.withType(JavaCompile) {
options.release = 11
}
jar {
archiveFileName = "HeroesZoneExtension.jar"
}
dependencies {
implementation files('lib/sfs2x-core.jar', 'lib/sfs2x.jar')
}
assemble.dependsOn copySFS2XLibs