build.gradle 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'org.jetbrains.kotlin.android'
  3. apply plugin: 'org.sirekanyan.version-checker'
  4. android {
  5. namespace 'org.sirekanyan.devtools'
  6. compileSdkVersion 33
  7. defaultConfig {
  8. applicationId "org.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. signingConfig debug.signingConfig
  22. }
  23. }
  24. compileOptions {
  25. sourceCompatibility JavaVersion.VERSION_1_8
  26. targetCompatibility JavaVersion.VERSION_1_8
  27. }
  28. kotlinOptions {
  29. jvmTarget = "1.8"
  30. }
  31. }
  32. dependencies {
  33. implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
  34. implementation 'androidx.appcompat:appcompat:1.6.1'
  35. }
  36. afterEvaluate {
  37. def grantSystemPermissions = {
  38. exec {
  39. def adbExecutable = android.properties['adbExecutable']
  40. def defaultPackage = android.defaultConfig.applicationId
  41. def debugSuffix = android.buildTypes['debug'].applicationIdSuffix
  42. commandLine('./grant.sh', adbExecutable, defaultPackage + debugSuffix)
  43. }
  44. }
  45. assembleDebug.doLast { grantSystemPermissions() }
  46. installDebug.doLast { grantSystemPermissions() }
  47. }