-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
51 lines (41 loc) · 1.92 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
group 'com.klniu.xiaoyi'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'application'
sourceCompatibility = 1.8
repositories {
maven { url 'http://maven.aliyun.com/mvn/repository/' }
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile "org.json:json:20160810"
compile "org.apache.logging.log4j:log4j-api:2.7"
compile "org.apache.logging.log4j:log4j-core:2.7"
compile "commons-io:commons-io:2.5"
compile "org.springframework:spring-core:4.3.5.RELEASE"
compile "org.springframework:spring-context:4.3.5.RELEASE"
compile fileTree(dir: 'libs', include: ['*.jar', '*/*.jar'])
}
tasks.withType(JavaExec) {
systemProperty "java.library.path", file("./libs/xunfei")
}
mainClassName = "com.klniu.xiaoyi.Main"
task compileJNIHeader(type: Exec) {
// speechrecognizer
workingDir 'src/main/java'
// commandLine 'javac', '-cp', '../../../libs/xunfei/Msc.jar:.', 'com/klniu/xiaoyi/XFJNI/SpeechRecognizer.java', '-d', './'
// commandLine 'javah', '-cp', '../../../libs/xunfei/Msc.jar:.', '-o', '../jni/SpeechRecognizer.h', 'com.klniu.xiaoyi.XFJNI.SpeechRecognizer'
// commandLine 'javac', '-cp', '../../../libs/xunfei/Msc.jar:.', 'com/klniu/xiaoyi/XFJNI/Iat.java', '-d', './'
// commandLine 'javah', '-cp', '../../../libs/xunfei/Msc.jar:.', '-o', '../jni/Iat.h', 'com.klniu.xiaoyi.XFJNI.Iat'
commandLine 'bash', '-e', '-c', """
javac -cp ../../../libs/xunfei/Msc.jar:. com/klniu/xiaoyi/XFJNI/SpeechRecognizer.java -d ./
javah -cp ../../../libs/xunfei/Msc.jar:. -o ../jni/SpeechRecognizer.h com.klniu.xiaoyi.XFJNI.SpeechRecognizer
javac -cp ../../../libs/xunfei/Msc.jar:. com/klniu/xiaoyi/XFJNI/Iat.java -d ./
javah -cp ../../../libs/xunfei/Msc.jar:. -o ../jni/Iat.h com.klniu.xiaoyi.XFJNI.Iat
rm com/klniu/xiaoyi/XFJNI/*.class
"""
}
run {
standardInput = System.in
standardOutput = System.out
}