build.gradle 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. apply from: rootProject.file('gradle/build_library.gradle')
  2. apply plugin: 'kotlin-android'
  3. apply plugin: 'kotlin-android-extensions'
  4. android {
  5. def miniAppPluginConfig = rootProject.ext.miniAppPluginConfig
  6. defaultConfig {
  7. buildConfigField "String", "PLUGIN_ID", "\"$miniAppPluginConfig.pluginId\""
  8. }
  9. }
  10. repositories {
  11. flatDir {
  12. dirs 'libs'
  13. }
  14. maven {
  15. url "https://maven.oa.com/nexus/content/repositories/google-maven/"
  16. }
  17. maven { url 'https://repo1.maven.org/maven2/' }
  18. }
  19. def saaaSDKVersionDepend = rootProject.ext.saaaSDKVersionDepend
  20. def libsDir = file("./libs")
  21. if (!file("$libsDir/com/tencent/luggage/wxa-standalone-open-runtime-SaaA-plugin-sdk/${saaaSDKVersionDepend}").exists()) {
  22. libsDir.mkdir()
  23. apply plugin: 'de.undercouch.download'
  24. def zipFileName = "wxa-standalone-open-runtime-SaaA-sdk-all-${saaaSDKVersionDepend}.zip"
  25. download.run {
  26. src "https://dldir1.qq.com/WechatWebDev/donut/android/pluginsdk/${zipFileName}"
  27. dest libsDir
  28. }
  29. def zipFilePath = "$libsDir/$zipFileName"
  30. copy {
  31. def subDir = 'localAar'
  32. from {
  33. zipTree(zipFilePath).matching { include "$subDir/**" }
  34. }
  35. into libsDir
  36. eachFile { fcp ->
  37. fcp.path = fcp.path.replaceFirst("^$subDir", '')
  38. }
  39. includeEmptyDirs false
  40. }
  41. file(zipFilePath).delete()
  42. }
  43. dependencies {
  44. implementation "androidx.exifinterface:exifinterface:1.1.0"
  45. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  46. implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  47. api "androidx.constraintlayout:constraintlayout:1.1.3"
  48. api 'com.google.android.material:material:1.0.0'
  49. compileOnly("com.tencent.luggage:wxa-standalone-open-runtime-SaaA-plugin-sdk:$saaaSDKVersionDepend") {}
  50. implementation('io.github.jeremyliao:live-event-bus-x:1.8.0')
  51. implementation 'com.umeng.umsdk:common:9.6.3'// 必选
  52. implementation 'com.umeng.umsdk:asms:1.8.0'// 必选
  53. }
  54. clearDuplicatedJniLibs([
  55. '**/jni/x86/**',
  56. '**/jni/x86_64/**',
  57. '**/jni/armeabi/**',
  58. '**/jni/**/libc++_shared.so'
  59. ])
  60. project.ext.pomDeps = [
  61. 'io.github.jeremyliao:live-event-bus-x' : '1.8.0',
  62. 'com.umeng.umsdk:common' : '9.6.3',
  63. 'com.umeng.umsdk:asms' : '1.8.0',
  64. ]