forked from cesine/pocketsphinx-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
128 lines (112 loc) · 3.48 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
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}
version = 'v0.9-rc1'
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 6
versionName version
setProperty("archivesBaseName", "pocketsphinx-android")
externalNativeBuild {
cmake {
}
}
ndk {
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
}
}
sourceSets {
main {
java.srcDirs = ['src/main/java', 'build/generated-src']
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
task mkdir {
doLast {
new File('build/generated-src/java').mkdirs()
new File('build/generated-src/cpp').mkdirs()
}
}
def sphinxbase_home = "$System.env.SPINXBASE_HOME"
def pocketsphinx_home = "$System.env.POCKETSPHINX_HOME"
task swigSb(type: Exec) {
commandLine 'swig',
"-I$sphinxbase_home/include", "-I$sphinxbase_home/swig",
"-java", "-package", "edu.cmu.pocketsphinx",
"-outdir", "build/generated-src/java", "-o", "build/generated-src/cpp/sphinxbase_wrap.c",
"$sphinxbase_home/swig/sphinxbase.i"
}
task swigPs(type: Exec) {
commandLine 'swig',
"-I$sphinxbase_home/swig",
"-I$pocketsphinx_home/include",
"-I$pocketsphinx_home/swig",
"-java", "-package", "edu.cmu.pocketsphinx",
"-outdir", "build/generated-src/java", "-o", "build/generated-src/cpp/pocketsphinx_wrap.c",
"$pocketsphinx_home/swig/pocketsphinx.i"
}
// preBuild.dependsOn mkdir, swigSb, swigPs
task generateSourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier 'sources'
}
task generateJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath()
.join(File.pathSeparator))
classpath += configurations.compile
failOnError false
}
task generateJavadocsJar(type: Jar) {
from generateJavadocs.destinationDir
classifier 'javadoc'
}
generateJavadocsJar.dependsOn generateJavadocs
artifacts.add("archives", file('build/libs/pocketsphinx-android-' + version + '-javadoc.jar'))
artifacts.add("archives", file('build/libs/pocketsphinx-android-' + version + '-sources.jar'))
// artifacts {
// archives generateJavaDocsJar,
// archives generateSourcesJar
// }
//
System.print System.getenv('BINTRAY_USER')
group = 'edu.cmu.pocketsphinx'
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
pkg {
repo = 'maven'
name = group
userOrg = 'fielddb'
version {
name = version
desc = 'fork of pocketsphinx build for Android which can save raw audio to disk'
released = new Date()
vcsTag = version
}
licenses = ['BSD 2-Clause']
vcsUrl = 'https://github.com/batumi/pocketsphinx-android.git'
websiteUrl = 'https://github.com/batumi/pocketsphinx-android'
}
configurations = ['archives']
}