SWIG failed to run

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SWIG failed to run

Julius Morandell
Hey guys,

in my current project I want to use Pocketsphinx (Speech recognition tool). To create an Android Studio Archive (aar) I have to build my application with gradle. 
I have downloaded the gradle script from cmu. In this script, SWIG is called to generate some resources. 
When I run the gradle scipt, SWIG failes to run and I don`t have any idea why. 

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 5
versionName "5prealpha"
setProperty("archivesBaseName", "pocketsphinx-android-$versionName")
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()
}
}

task swigSb(type: Exec) {
commandLine 'swig',
"-I../sphinxbase/include", "-I../sphinxbase/swig",
"-java", "-package", "edu.cmu.pocketsphinx",
"-outdir", "build/generated-src/java", "-o", "build/generated-src/cpp/sphinxbase_wrap.c",
"../sphinxbase/swig/sphinxbase.i"
}

task swigPs(type: Exec) {
commandLine 'swig',
"-I../sphinxbase/swig",
"-I../pocketsphinx/include",
"-I../pocketsphinx/swig",
"-java", "-package", "edu.cmu.pocketsphinx",
"-outdir", "build/generated-src/java", "-o", "build/generated-src/cpp/pocketsphinx_wrap.c",
"../pocketsphinx/swig/pocketsphinx.i"
}

preBuild.dependsOn mkdir, swigSb, swigPs
 
This is the piece of code. Did I missed something with the installation of SWIG?
SWIG is running in the CMD prompt. I´m using Windows 10 x64.

Thank you for any advice.

best regards,
Julius

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...