build.gradle 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. apply plugin: 'com.android.application'
  2. def static getGitVersion() {
  3. try {
  4. return 'git rev-parse --short HEAD'.execute().text.trim()
  5. } catch (Throwable th) {
  6. return "";
  7. }
  8. }
  9. android {
  10. compileSdkVersion 25
  11. buildToolsVersion '25.0.3'
  12. defaultConfig {
  13. applicationId "com.sheishuo.app"
  14. minSdkVersion rootProject.ext.minSdkVersion
  15. targetSdkVersion rootProject.ext.targetSdkVersion
  16. buildConfigField "String", "GIT_REVISION", "\"${getGitVersion()}\""
  17. buildConfigField "String", "BUILD_DATE", "\"${new Date().toLocaleString()}\"";
  18. multiDexEnabled true
  19. ndk {
  20. abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
  21. }
  22. }
  23. signingConfigs {
  24. debug { storeFile file("debug.keystore") }
  25. release {
  26. storeFile file('release.keystore')
  27. storePassword 'thisiskeystorepassword'
  28. keyAlias 'nim_demo'
  29. keyPassword 'thisiskeypassword'
  30. }
  31. }
  32. buildTypes {
  33. debug {
  34. signingConfig signingConfigs.debug
  35. manifestPlaceholders = [AMAP_KEY: "09fd4efd3e28e9bf1f449ecec7d34bfe"]
  36. }
  37. release {
  38. shrinkResources true
  39. minifyEnabled true
  40. zipAlignEnabled true
  41. proguardFile('proguard.cfg')
  42. signingConfig signingConfigs.release
  43. manifestPlaceholders = [AMAP_KEY: "ee20324fba1c7f4ad7a4a207e7f08e8d"]
  44. }
  45. }
  46. sourceSets {
  47. main {
  48. manifest.srcFile 'AndroidManifest.xml'
  49. java.srcDirs = ['src']
  50. resources.srcDirs = ['src']
  51. aidl.srcDirs = ['src']
  52. renderscript.srcDirs = ['src']
  53. res.srcDirs = ['res', 'res-avchat', 'res-chatroom']
  54. assets.srcDirs = ['assets']
  55. jniLibs.srcDirs = ['libs', 'libs-sdk']
  56. }
  57. }
  58. lintOptions {
  59. checkReleaseBuilds false
  60. abortOnError false
  61. }
  62. dexOptions {
  63. preDexLibraries false
  64. jumboMode true
  65. javaMaxHeapSize "4g"
  66. }
  67. packagingOptions {
  68. exclude 'META-INF/LICENSE.txt'
  69. exclude 'META-INF/NOTICE.txt'
  70. exclude 'META-INF/rxjava.properties'
  71. }
  72. compileOptions {
  73. sourceCompatibility JavaVersion.VERSION_1_7
  74. targetCompatibility JavaVersion.VERSION_1_7
  75. }
  76. }
  77. repositories {
  78. flatDir {
  79. dirs 'aars'
  80. }
  81. }
  82. dependencies {
  83. compile fileTree(include: '*.jar', dir: 'libs')
  84. compile(name: 'HMS-SDK-2.4.0.300', ext: 'aar')
  85. compile project(path: ':uikit')
  86. compile 'com.netease.nimlib:jsbridge:1.3.1'
  87. compile 'com.android.support:multidex:1.0.1'
  88. compile 'com.android.support:support-annotations:25.3.1'
  89. //RxJava 2 & RxAndroid
  90. compile 'io.reactivex.rxjava2:rxjava:2.1.1'
  91. compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
  92. //Gson
  93. compile 'com.google.code.gson:gson:2.8.1'
  94. //Retrofit
  95. compile 'com.squareup.retrofit2:retrofit:2.3.0'
  96. compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
  97. compile 'com.squareup.retrofit2:converter-gson:2.3.0'
  98. //debugCompile project(':plugins:sf')
  99. //CardView
  100. compile 'com.android.support:cardview-v7:25.1.1'
  101. }