提交 5e7406f0 authored 作者: caoyongfeng's avatar caoyongfeng

android 依赖完善

上级 084ba457
configurations.maybeCreate("default")
artifacts.add("default", file("ffmpeg-kit-https-5.1.aar"))
\ No newline at end of file
// 应用本地依赖配置
//apply from: 'local-dependencies.gradle'
buildscript { buildscript {
repositories { repositories {
...@@ -12,20 +11,22 @@ buildscript { ...@@ -12,20 +11,22 @@ buildscript {
} }
} }
//// 配置Gradle解决AAR-in-AAR问题 // 应用本地依赖配置
//allprojects { apply from: 'local-dependencies.gradle'
// configurations.all { // 配置Gradle解决AAR-in-AAR问题
// // 允许本地AAR作为库文件 allprojects {
// resolutionStrategy.dependencySubstitution.all { DependencySubstitution dependency -> configurations.all {
// if (dependency.requested instanceof ModuleComponentSelector) { // 允许本地AAR作为库文件
// def module = dependency.requested as ModuleComponentSelector resolutionStrategy.dependencySubstitution.all { DependencySubstitution dependency ->
// if (module.group == 'com.arthenica' && module.module == 'ffmpeg-kit-https') { if (dependency.requested instanceof ModuleComponentSelector) {
// dependency.useTarget(files(rootProject.ext.ffmpegDependency).singleFile) def module = dependency.requested as ModuleComponentSelector
// } if (module.group == 'com.arthenica' && module.module == 'ffmpeg-kit-https') {
// } dependency.useTarget(files(rootProject.ext.ffmpegDependency).singleFile)
// } }
// } }
//} }
}
}
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
...@@ -65,6 +66,9 @@ dependencies { ...@@ -65,6 +66,9 @@ dependencies {
// implementation 'com.arthenica:ffmpeg-kit-https:4.5.1-1' // implementation 'com.arthenica:ffmpeg-kit-https:4.5.1-1'
// implementation files('libs/ffmpeg-kit-https-5.1.aar') // implementation files('libs/ffmpeg-kit-https-5.1.aar')
// api(project(":cabinet_aar")) // api(project(":cabinet_aar"))
api project(':android_aar') // api project(':android_aar')
} }
apply from: 'dependency-resolution.gradle'
afterEvaluate {
// 在打包前将本地AAR添加到运行时依赖
tasks.whenTaskAdded { task ->
if (task.name.contains('bundle') && task.name.contains('Aar')) {
task.doFirst {
copy {
from rootProject.ext.ffmpegDependency
into temporaryDir
rename { 'ffmpeg-kit-https-local.aar' }
}
project.dependencies.add(
'api',
fileTree(dir: temporaryDir, include: '*.aar')
)
}
}
}
}
\ No newline at end of file
rootProject.name = 'ffmpeg-kit-flutter-android' rootProject.name = 'ffmpeg-kit-flutter-android'
include(":android_aar") // 覆盖插件对FFmpeg的依赖配置
\ No newline at end of file gradle.projectsEvaluated {
project(':ffmpeg_kit_flutter').afterEvaluate {
it.configurations.implementation.dependencies.removeAll {
it.group == 'com.arthenica' && it.name == 'ffmpeg-kit-https'
}
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论