build.gradle 3.3 KB

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