Skip to content

Commit

Permalink
Update JavaCV-android-example with javacppExtract task for Android Ap…
Browse files Browse the repository at this point in the history
…p Bundles (AABs)
  • Loading branch information
saudet committed Dec 2, 2021
1 parent 6ede039 commit 2378afc
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions JavaCV-android-example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,28 @@ android {
dexOptions {
javaMaxHeapSize "2G"
}
packagingOptions {
exclude 'META-INF/native-image/**'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation group: 'org.bytedeco', name: 'javacv', version: '1.5.5'
configurations {
javacpp
}

implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.13-1.5.5', classifier: 'android-arm'
implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.13-1.5.5', classifier: 'android-arm64'
implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.13-1.5.5', classifier: 'android-x86_64'
implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.13-1.5.5', classifier: 'android-x86'
task javacppExtract(type: Copy) {
dependsOn configurations.javacpp

implementation group: 'org.bytedeco', name: 'opencv', version: '4.5.1-1.5.5', classifier: 'android-arm'
implementation group: 'org.bytedeco', name: 'opencv', version: '4.5.1-1.5.5', classifier: 'android-arm64'
implementation group: 'org.bytedeco', name: 'opencv', version: '4.5.1-1.5.5', classifier: 'android-x86_64'
implementation group: 'org.bytedeco', name: 'opencv', version: '4.5.1-1.5.5', classifier: 'android-x86'
from { configurations.javacpp.collect { zipTree(it) } }
include "lib/**"
into "$buildDir/javacpp/"
android.sourceSets.main.jniLibs.srcDirs += ["$buildDir/javacpp/lib/"]

implementation group: 'org.bytedeco', name: 'ffmpeg', version: '4.3.2-1.5.5', classifier: 'android-arm'
implementation group: 'org.bytedeco', name: 'ffmpeg', version: '4.3.2-1.5.5', classifier: 'android-arm64'
implementation group: 'org.bytedeco', name: 'ffmpeg', version: '4.3.2-1.5.5', classifier: 'android-x86_64'
implementation group: 'org.bytedeco', name: 'ffmpeg', version: '4.3.2-1.5.5', classifier: 'android-x86'
tasks.getByName('preBuild').dependsOn javacppExtract
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation group: 'org.bytedeco', name: 'javacv', version: '1.5.6'
javacpp group: 'org.bytedeco', name: 'openblas-platform', version: '0.3.17-1.5.6'
javacpp group: 'org.bytedeco', name: 'opencv-platform', version: '4.5.3-1.5.6'
javacpp group: 'org.bytedeco', name: 'ffmpeg-platform', version: '4.4-1.5.6'
}

0 comments on commit 2378afc

Please sign in to comment.