Skip to content

Commit a85cbaa

Browse files
authored
Merge pull request #517 from irealva/master
Adds support for tensorflowlite
2 parents bf6c762 + 1d0316e commit a85cbaa

File tree

7 files changed

+35
-5
lines changed

7 files changed

+35
-5
lines changed

mode/src/processing/mode/android/AndroidBuild.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ private void createAppModule(String moduleName)
400400

401401
// Copy any imported libraries (their libs and assets),
402402
// and anything in the code folder contents to the project.
403-
copyImportedLibs(libsFolder, assetsFolder);
403+
copyImportedLibs(libsFolder, mainFolder, assetsFolder);
404404
copyCodeFolder(libsFolder);
405405

406406
// Copy any system libraries needed by the project
@@ -915,7 +915,8 @@ protected boolean ignorableImport(String pkg) {
915915
* For each library, copy .jar and .zip files to the 'libs' folder,
916916
* and copy anything else to the 'assets' folder.
917917
*/
918-
private void copyImportedLibs(final File libsFolder,
918+
private void copyImportedLibs(final File libsFolder,
919+
final File mainFolder,
919920
final File assetsFolder) throws IOException {
920921
for (Library library : getImportedLibraries()) {
921922
// add each item from the library folder / export list to the output
@@ -937,7 +938,12 @@ private void copyImportedLibs(final File libsFolder,
937938
exportName.equals("armeabi-v7a") ||
938939
exportName.equals("x86")) {
939940
Util.copyDir(exportFile, new File(libsFolder, exportName));
940-
} else {
941+
}
942+
// Copy jni libraries (.so files) to the correct location
943+
else if (exportName.equals("jniLibs")) {
944+
Util.copyDir(exportFile, new File(mainFolder, exportName));
945+
}
946+
else {
941947
// Copy any other directory to the assets folder
942948
Util.copyDir(exportFile, new File(assetsFolder, exportName));
943949
}

mode/templates/AppBuild.gradle.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ android {
2626
}
2727
lintOptions {
2828
abortOnError false
29-
}
29+
}
30+
aaptOptions {
31+
noCompress "tflite"
32+
noCompress "lite"
33+
}
3034
}
3135

3236
dependencies {

mode/templates/AppBuildECJ.gradle.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ android {
2626
}
2727
lintOptions {
2828
abortOnError false
29-
}
29+
}
30+
aaptOptions {
31+
noCompress "tflite"
32+
noCompress "lite"
33+
}
3034

3135
// We create a variant of the compile task, where we use the Eclipse Compiler for Java
3236
// (ECJ) instead of the JDK (which would require the user to download and install

mode/templates/VRBuild.gradle.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ android {
2424
}
2525
lintOptions {
2626
abortOnError false
27+
}
28+
aaptOptions {
29+
noCompress "tflite"
30+
noCompress "lite"
2731
}
2832
}
2933

mode/templates/VRBuildECJ.gradle.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ android {
2424
}
2525
lintOptions {
2626
abortOnError false
27+
}
28+
aaptOptions {
29+
noCompress "tflite"
30+
noCompress "lite"
2731
}
2832

2933
// We create a variant of the compile task, where we use the Eclipse Compiler for Java

mode/templates/WearBuild.gradle.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ android {
2424
}
2525
lintOptions {
2626
abortOnError false
27+
}
28+
aaptOptions {
29+
noCompress "tflite"
30+
noCompress "lite"
2731
}
2832
}
2933

mode/templates/WearBuildECJ.gradle.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ android {
2424
}
2525
lintOptions {
2626
abortOnError false
27+
}
28+
aaptOptions {
29+
noCompress "tflite"
30+
noCompress "lite"
2731
}
2832

2933
// We create a variant of the compile task, where we use the Eclipse Compiler for Java

0 commit comments

Comments
 (0)