build.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. apply plugin: 'com.android.application'
  2. android {
  3. signingConfigs {
  4. release {
  5. storeFile file('../nfctool.jks')
  6. storePassword '123456'
  7. keyAlias = 'nfctool'
  8. keyPassword '123456'
  9. }
  10. }
  11. compileSdkVersion 22
  12. defaultConfig {
  13. applicationId "com.mq.nfctool"
  14. minSdkVersion 15
  15. targetSdkVersion 22
  16. versionCode 1
  17. versionName "1.0"
  18. ndk {
  19. abiFilters "armeabi","x86"
  20. }
  21. signingConfig signingConfigs.release
  22. }
  23. lintOptions {
  24. checkReleaseBuilds false
  25. // Or, if you prefer, you can continue to check for errors in release builds,
  26. // but continue the build even when errors are found:
  27. abortOnError false
  28. }
  29. buildTypes {
  30. release {
  31. signingConfig signingConfigs.release
  32. minifyEnabled false
  33. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  34. }
  35. }
  36. sourceSets {
  37. main {
  38. jniLibs.srcDirs = ['libs']
  39. }
  40. }
  41. // 配置自定义打包名称
  42. android.applicationVariants.all { variant ->
  43. variant.outputs.all { output ->
  44. def outputFile = output.outputFile
  45. if (outputFile != null && outputFile.name.endsWith('release.apk')) {
  46. //打包名称 xxxx_yunnan_2.0_201911011522.apk
  47. def fileName = "PuerTool" +// 业务名称
  48. "_" +
  49. // 版本号
  50. "${defaultConfig.versionName}" +
  51. "_" +
  52. // 时间
  53. "${new Date().format("yyyyMMddHHmm")}" +
  54. // 后缀
  55. ".apk"
  56. outputFileName = fileName
  57. }
  58. }
  59. }
  60. }
  61. dependencies {
  62. implementation fileTree(dir: 'libs', include: ['*.jar'])
  63. implementation project(':commonLib')
  64. implementation 'com.android.support:appcompat-v7:22.2.1'
  65. implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  66. }