build.gradle 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'kotlin-android'
  3. android {
  4. namespace 'com.sirekanyan.devtools'
  5. compileSdkVersion 33
  6. defaultConfig {
  7. applicationId "com.sirekanyan.devtools"
  8. minSdkVersion 17
  9. targetSdkVersion 33
  10. versionCode 1
  11. versionName "1.0"
  12. }
  13. buildTypes {
  14. debug {
  15. applicationIdSuffix ".debug"
  16. }
  17. release {
  18. minifyEnabled false
  19. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
  20. }
  21. }
  22. compileOptions {
  23. sourceCompatibility JavaVersion.VERSION_1_8
  24. targetCompatibility JavaVersion.VERSION_1_8
  25. }
  26. kotlinOptions {
  27. jvmTarget = "1.8"
  28. }
  29. }
  30. dependencies {
  31. implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
  32. implementation 'androidx.appcompat:appcompat:1.5.1'
  33. implementation 'androidx.core:core-ktx:1.9.0'
  34. }
  35. afterEvaluate {
  36. def grantSystemPermissions = {
  37. exec {
  38. def defaultPackage = android.defaultConfig.applicationId
  39. def debugSuffix = android.buildTypes['debug'].applicationIdSuffix
  40. commandLine('./grant.sh', defaultPackage + debugSuffix)
  41. }
  42. }
  43. assembleDebug.doLast { grantSystemPermissions() }
  44. installDebug.doLast { grantSystemPermissions() }
  45. }