This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
73 lines (56 loc) · 1.95 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
import org.gradle.internal.os.OperatingSystem;
plugins {
id 'java'
id 'application'
id "de.undercouch.download" version "4.0.1"
}
group 'fr.griffon'
version '0.1-SNAPSHOT'
applicationName = 'KissSimulator'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'org.scream3r:jssc:2.8.0'
compile group: 'net.java.jinput', name: 'jinput', version: '2.0.9'
compile group: 'net.java.jinput', name: 'jinput', version: '2.0.9', classifier: 'natives-all'
implementation 'com.google.code.gson:gson:2.8.6'
}
application {
mainClassName 'fr.griffon.KissSimulator'
}
task deleteNativeLib (type: Delete){
delete 'nativeLib'
followSymlinks = true
}
task downloadJInputNativeLib(dependsOn: deleteNativeLib,type: Download) {
src 'https://search.maven.org/remotecontent?filepath=net/java/jinput/jinput/2.0.9/jinput-2.0.9-natives-all.jar'
dest new File(buildDir, '/jinputNativeLib/jinputNativeLib.zip')
}
task downloadAndUnzipJInputNativeLib(dependsOn: downloadJInputNativeLib, type: Copy) {
def outputDir = file("${buildDir}/jinputNativeLib")
from zipTree(downloadJInputNativeLib.dest)
into outputDir
}
task buildNativeLibDir(dependsOn: downloadAndUnzipJInputNativeLib, type: Copy) {
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
from file("$buildDir/jinputNativeLib/libjinput-linux64.so")
into file("nativeLib")
break ;
case OperatingSystem.MAC_OS:
from file("$buildDir/jinputNativeLib/libjinput-osx.jnilib")
into file("nativeLib")
rename 'libjinput-osx.jnilib', 'libjinput-osx.dylib'
break ;
case OperatingSystem.WINDOWS:
from("$buildDir/jinputNativeLib") {
include '**/*.dll'
exclude 'META-INF'
}
into "nativeLib"
break ;
}
}