build.gradle 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. implementation 'androidx.core:core-ktx:1.10.0'
  35. }
  36. afterEvaluate {
  37. def grantSystemPermissions = {
  38. exec {
  39. def defaultPackage = android.defaultConfig.applicationId
  40. def debugSuffix = android.buildTypes['debug'].applicationIdSuffix
  41. commandLine('./grant.sh', defaultPackage + debugSuffix)
  42. }
  43. }
  44. assembleDebug.doLast { grantSystemPermissions() }
  45. installDebug.doLast { grantSystemPermissions() }
  46. }