-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
48 lines (37 loc) · 1.13 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
apply plugin:'application'
sourceCompatibility = 1.8
targetCompatibility = 1.8
defaultTasks = ["jar", "jfbxlib"]
jar {
archiveName "JFbxViewer.jar"
manifest.attributes("Main-Class": "de.tesis.dynaware.javafx.graphics.viewer.FbxViewer")
}
task javah {
def inputClass = "de.tesis.dynaware.javafx.graphics.importers.fbx.JFbxLib";
def inputClassPath = inputClass.replaceAll('\\.', '/')+".class"
def outputFile = "${buildDir}/generated/de_tesis_dynaware_javafx_graphics_importers_fbx_JFbxLib.h"
inputs.file sourceSets.main.output.asFileTree.matching {
include inputClassPath
}
outputs.file outputFile
doLast {
ant.javah(class: inputClass, outputFile: outputFile, classpath:sourceSets.main.output.asPath)
}
}
task jfbxlib(type: Exec, dependsOn: javah) {
if (!System.getProperty("os.name").toLowerCase().contains("windows")) {
ant.fail("This build script supports Windows only")
}
def osArch = getOsArch()
workingDir "${projectDir}"
executable "vcmake.bat"
environment OS_ARCH: osArch
}
String getOsArch() {
if (System.getProperty("os.arch").toLowerCase().contains("64")) {
return "x86_amd64";
}
else {
return "x86";
}
}