build.gradle 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. apply plugin: 'com.android.library'
  2. android {
  3. compileSdkVersion 25
  4. buildToolsVersion "26.0.0"
  5. defaultConfig {
  6. minSdkVersion 15
  7. targetSdkVersion 25
  8. versionCode 1
  9. versionName "1.0"
  10. multiDexEnabled true
  11. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  12. }
  13. buildTypes {
  14. release {
  15. minifyEnabled false
  16. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  17. }
  18. }
  19. packagingOptions {
  20. //打包时的相关配置
  21. exclude 'META-INF/DEPENDENCIES'
  22. exclude 'META-INF/NOTICE'
  23. exclude 'META-INF/LICENSE'
  24. exclude 'META-INF/LICENSE.txt'
  25. exclude 'META-INF/NOTICE.txt'
  26. }
  27. dexOptions {
  28. javaMaxHeapSize "4g"
  29. }
  30. android {
  31. lintOptions {
  32. abortOnError false
  33. }
  34. }
  35. }
  36. repositories {
  37. mavenCentral()
  38. flatDir {
  39. dirs 'libs'
  40. }
  41. }
  42. dependencies {
  43. compile fileTree(include: ['*.jar'], dir: 'libs')
  44. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  45. exclude group: 'com.android.support', module: 'support-annotations'
  46. })
  47. compile 'com.android.support:appcompat-v7:25.3.1'
  48. testCompile 'junit:junit:4.12'
  49. compile(name: 'peb-lib', ext: 'aar')
  50. compile 'com.android.support:cardview-v7:25.3.1'
  51. compile 'com.android.support:recyclerview-v7:25.3.1'
  52. compile 'com.squareup.picasso:picasso:2.4.0'
  53. compile 'com.squareup.okhttp:okhttp:2.4.0'
  54. compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
  55. compile 'com.github.bumptech.glide:glide:3.5.2'
  56. compile 'com.squareup.retrofit2:retrofit:2.3.0'
  57. compile 'com.squareup.retrofit2:converter-gson:2.3.0'
  58. compile 'com.google.android.gms:play-services-auth:8.3.0'
  59. compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
  60. //微信
  61. compile files('libs/UPPayAssistEx.jar')
  62. compile files('libs/UPPayPluginExPro.jar')
  63. compile files('libs/alipaySdk-20180601.jar')
  64. }
  65. task makeJar(type: Copy) {
  66. //删除存在的
  67. delete 'build/libs/AllPaySDK.jar'
  68. //设置拷贝的文件
  69. from('build/intermediates/bundles/release/')
  70. //打进jar包后的文件目录
  71. into('build/libs/')
  72. //将classes.jar放入build/libs/目录下
  73. exclude('com/allpayx/sdk/BuildConfig.class')
  74. exclude('com/allpayx/sdk/BuildConfig\$*.class')
  75. exclude('**/R.class')
  76. exclude('**/R\$*.class')
  77. exclude('com/unionpay/res/*')
  78. include('classes.jar')
  79. //重命名
  80. rename ('classes.jar', 'AllPaySDK.jar')
  81. }
  82. makeJar.dependsOn(build)