build.gradle 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'kotlin-android'
  3. apply plugin: 'org.sirekanyan.version-checker'
  4. android {
  5. namespace 'com.sirekanyan.devtools'
  6. compileSdkVersion 33
  7. defaultConfig {
  8. applicationId "com.sirekanyan.devtools"
  9. minSdkVersion 17
  10. targetSdkVersion 33
  11. versionCode 1
  12. versionName "1.0"
  13. }
  14. buildTypes {
  15. debug {
  16. applicationIdSuffix ".debug"
  17. }
  18. release {
  19. minifyEnabled false
  20. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
  21. }
  22. }
  23. compileOptions {
  24. sourceCompatibility JavaVersion.VERSION_1_8
  25. targetCompatibility JavaVersion.VERSION_1_8
  26. }
  27. kotlinOptions {
  28. jvmTarget = "1.8"
  29. }
  30. }
  31. dependencies {
  32. implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
  33. implementation 'androidx.appcompat:appcompat:1.6.1'
  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. }