build.gradle 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. group 'dev.steenbakker.nordicdfu'
  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.6.21'
  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:1.7.0"
  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 32
  43. sourceSets {
  44. main.java.srcDirs += 'src/main/kotlin'
  45. }
  46. defaultConfig {
  47. minSdkVersion 18
  48. }
  49. compileOptions {
  50. sourceCompatibility JavaVersion.VERSION_1_8
  51. targetCompatibility JavaVersion.VERSION_1_8
  52. }
  53. }
  54. dependencies {
  55. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  56. compileOnly files("$flutterRoot/bin/cache/artifacts/engine/android-arm64/flutter.jar")
  57. // compileOnly 'androidx.annotation:annotation:1.3.0'
  58. implementation 'androidx.core:core:1.7.0'
  59. implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
  60. implementation 'androidx.annotation:annotation:1.3.0'
  61. implementation 'com.google.code.gson:gson:2.8.9'
  62. }
  63. repositories {
  64. mavenCentral()
  65. }