build.gradle 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. static String safePackageName(String prop) {
  2. prop.replace("-lts", "")
  3. }
  4. static String safePackageVersion(String prop, String version, String ltsVersion) {
  5. prop.contains("-lts") ? ltsVersion + ".LTS" : version
  6. }
  7. String safeExtGet(String prop, String fallback) {
  8. rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
  9. }
  10. group 'com.arthenica.flutter.ffmpeg'
  11. version '0.2.10'
  12. buildscript {
  13. repositories {
  14. google()
  15. jcenter()
  16. }
  17. dependencies {
  18. classpath 'com.android.tools.build:gradle:3.5.3'
  19. }
  20. }
  21. rootProject.allprojects {
  22. repositories {
  23. google()
  24. jcenter()
  25. }
  26. }
  27. apply plugin: 'com.android.library'
  28. android {
  29. compileSdkVersion 29
  30. defaultConfig {
  31. minSdkVersion safeExtGet('flutterFFmpegPackage', 'https').contains("-lts") ? 16 : 24
  32. }
  33. lintOptions {
  34. disable 'InvalidPackage'
  35. }
  36. }
  37. dependencies {
  38. implementation 'com.arthenica:mobile-ffmpeg-' + safePackageName(safeExtGet('flutterFFmpegPackage', 'https')) + ':' + safePackageVersion(safeExtGet('flutterFFmpegPackage', 'https'), '4.3.1', '4.3.1')
  39. }