build.gradle 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. group 'com.example.flutter_plugin_mipush'
  2. version '1.0-SNAPSHOT'
  3. def localProperties = new Properties()
  4. def localPropertiesFile = rootProject.file('local.properties')
  5. if (localPropertiesFile.exists()) {
  6. localPropertiesFile.withReader('UTF-8') { reader ->
  7. localProperties.load(reader)
  8. }
  9. }
  10. def flutterRoot = localProperties.getProperty('flutter.sdk')
  11. if (flutterRoot == null) {
  12. throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  13. }
  14. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  15. if (flutterVersionCode == null) {
  16. flutterVersionCode = '1'
  17. }
  18. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  19. if (flutterVersionName == null) {
  20. flutterVersionName = '1.0'
  21. }
  22. buildscript {
  23. ext.kotlin_version = '1.3.50'
  24. repositories {
  25. google()
  26. mavenCentral()
  27. }
  28. dependencies {
  29. classpath 'com.android.tools.build:gradle:4.1.0'
  30. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  31. }
  32. }
  33. rootProject.allprojects {
  34. repositories {
  35. google()
  36. mavenCentral()
  37. }
  38. }
  39. apply plugin: 'com.android.library'
  40. apply plugin: 'kotlin-android'
  41. android {
  42. compileSdkVersion 30
  43. compileOptions {
  44. sourceCompatibility JavaVersion.VERSION_1_8
  45. targetCompatibility JavaVersion.VERSION_1_8
  46. }
  47. kotlinOptions {
  48. jvmTarget = '1.8'
  49. }
  50. sourceSets {
  51. main.java.srcDirs += 'src/main/kotlin'
  52. }
  53. defaultConfig {
  54. minSdkVersion 16
  55. }
  56. }
  57. dependencies {
  58. implementation fileTree(dir: 'libs', include: ['*.jar'])
  59. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  60. compileOnly files("$flutterRoot/bin/cache/artifacts/engine/android-arm64/flutter.jar")
  61. compileOnly "androidx.annotation:annotation:1.1.0"
  62. }