build.gradle 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'kotlin-android'
  3. apply plugin: 'kotlin-android-extensions'
  4. androidExtensions {
  5. experimental = true
  6. }
  7. android {
  8. compileSdkVersion 28
  9. buildToolsVersion '28.0.3'
  10. defaultConfig {
  11. applicationId 'com.sirekanyan.knigopis'
  12. minSdkVersion 16
  13. targetSdkVersion 28
  14. versionCode 23
  15. versionName '0.2.1'
  16. archivesBaseName = "$applicationId-$versionName-$versionCode"
  17. vectorDrawables.useSupportLibrary = true
  18. }
  19. buildTypes {
  20. release {
  21. minifyEnabled true
  22. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard'
  23. }
  24. debug {
  25. applicationIdSuffix '.debug'
  26. }
  27. }
  28. afterEvaluate {
  29. assembleRelease.doLast {
  30. applicationVariants.find { it.name == 'release' }.outputs.each { output ->
  31. if (output.outputFile.exists()) {
  32. def apkSize = (output.outputFile.size().toFloat() / 1024 / 1024).round(2)
  33. rootProject.file('README.md').text = rootProject.file('readme.md').text
  34. .replaceAll('::versionName::', output.apkData.versionName.toString())
  35. .replaceAll('::versionCode::', output.apkData.versionCode.toString())
  36. .replaceAll('::apkSize::', apkSize.toString())
  37. }
  38. }
  39. }
  40. }
  41. }
  42. dependencies {
  43. // kotlin standard library
  44. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  45. // support libraries
  46. implementation 'com.android.support:appcompat-v7:28.0.0'
  47. implementation 'com.android.support:design:28.0.0'
  48. implementation 'com.android.support:support-vector-drawable:28.0.0'
  49. implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  50. // rxjava
  51. implementation 'io.reactivex.rxjava2:rxjava:2.1.11'
  52. implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0'
  53. implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
  54. implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
  55. // retrofit & okhttp
  56. implementation 'com.squareup.retrofit2:retrofit:2.3.0'
  57. implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
  58. implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
  59. implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
  60. // etc
  61. implementation 'com.github.bumptech.glide:glide:4.7.1'
  62. implementation(name: 'ulogin-sdk-v1.1', ext: 'aar')
  63. }
  64. clean {
  65. delete 'release'
  66. }