build.gradle 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. apply plugin: 'com.android.application'
  2. //apply plugin: 'com.android.library'
  3. android {
  4. compileSdkVersion 26
  5. defaultConfig {
  6. applicationId "com.slam.bboxbleNext3"
  7. minSdkVersion 19
  8. targetSdkVersion 26
  9. versionCode 33
  10. versionName "3.3"
  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. compileOptions {
  20. sourceCompatibility JavaVersion.VERSION_1_8
  21. targetCompatibility JavaVersion.VERSION_1_8
  22. }
  23. //多渠道打包
  24. flavorDimensions "version"
  25. productFlavors {
  26. //哔蹦渠道
  27. BBengNext {
  28. //修改包名
  29. applicationId "com.slam.bboxbleNext3"
  30. //修改app名字,string资源下不能包含"app_name"
  31. resValue "string", "app_name", "手柄简易测试工具Next_${defaultConfig.versionName}"
  32. dimension "version"
  33. }
  34. }
  35. applicationVariants.all { variant ->
  36. variant.outputs.all {
  37. if (variant.buildType.name == "release") {
  38. // 输出apk名称
  39. outputFileName = "${variant.flavorName}_v${variant.versionName}.apk"
  40. } else {
  41. outputFileName = "${variant.flavorName}_v${variant.versionName}_debug.apk"
  42. }
  43. }
  44. }
  45. }
  46. //打包时间
  47. def static releaseTime() {
  48. return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
  49. }
  50. dependencies {
  51. implementation fileTree(include: ['*.jar'], dir: 'libs')
  52. implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
  53. implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  54. testImplementation 'junit:junit:4.12'
  55. androidTestImplementation 'com.android.support.test:runner:0.5'
  56. androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
  57. implementation 'org.greenrobot:eventbus:3.0.0'
  58. implementation project(':bboxblelib')
  59. }