ktaglib: autobuild taglib on gradle build
This commit is contained in:
parent
1c85dc96e0
commit
a85acceed6
3 changed files with 21 additions and 10 deletions
|
@ -1,3 +1,5 @@
|
|||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
|
@ -41,12 +43,21 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.15.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
task assembleTaglib(type: Exec) {
|
||||
def jniDir = "$projectDir/src/main/cpp/"
|
||||
def libs = new File("$jniDir/taglib/pkg")
|
||||
if (libs.exists()) {
|
||||
commandLine "true"
|
||||
return
|
||||
}
|
||||
commandLine "sh", "-c", "$jniDir/build_taglib.sh $android.ndkDirectory"
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
preDebugBuild.dependsOn assembleTaglib
|
||||
preReleaseBuild.dependsOn assembleTaglib
|
||||
}
|
||||
|
||||
clean {
|
||||
delete "$projectDir/src/main/jni/ffmpeg/android-libs/"
|
||||
}
|
|
@ -25,7 +25,7 @@ project("ktaglib")
|
|||
# for GameActivity/NativeActivity derived applications, the same library name must be
|
||||
# used in the AndroidManifest.xml file.
|
||||
set(taglib_location "${CMAKE_CURRENT_SOURCE_DIR}/taglib")
|
||||
set(taglib_pkg "${taglib_location}/android-libs/${ANDROID_ABI}")
|
||||
set(taglib_pkg "${taglib_location}/pkg/${ANDROID_ABI}")
|
||||
set(taglib_lib "${taglib_pkg}/lib")
|
||||
set(taglib_include "${taglib_pkg}/include")
|
||||
|
||||
|
|
|
@ -11,4 +11,4 @@ object KTagLib {
|
|||
* which is packaged with this application.
|
||||
*/
|
||||
external fun stringFromJNI(): String
|
||||
}b
|
||||
}
|
Loading…
Reference in a new issue