build.gradle 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. apply plugin: 'com.android.application'
  2. android {
  3. namespace "com.heychat.live"
  4. compileSdk rootProject.ext.compileSdkVersion
  5. defaultConfig {
  6. applicationId "com.heychat.live"
  7. minSdkVersion rootProject.ext.minSdkVersion
  8. targetSdkVersion rootProject.ext.targetSdkVersion
  9. versionCode 1
  10. versionName "1.0"
  11. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  12. aaptOptions {
  13. // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
  14. // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
  15. ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
  16. }
  17. }
  18. signingConfigs {
  19. //签名信息
  20. release {
  21. keyAlias System.getenv('KEY_ALIAS') ?: 'heychat'
  22. keyPassword System.getenv('KEY_PASSWORD') ?: '12345678'
  23. storeFile file(System.getenv('KEYSTORE_PATH') ?: '../heychat.keystore')
  24. storePassword System.getenv('STORE_PASSWORD') ?: '12345678'
  25. }
  26. }
  27. android.applicationVariants.all(variant ->{
  28. variant.outputs.all{
  29. outputFileName = "heychat.apk"
  30. }
  31. })
  32. buildTypes {
  33. release {
  34. minifyEnabled false
  35. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  36. signingConfig signingConfigs.release
  37. }
  38. }
  39. }
  40. repositories {
  41. flatDir{
  42. dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
  43. }
  44. }
  45. dependencies {
  46. implementation fileTree(include: ['*.jar'], dir: 'libs')
  47. implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
  48. implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
  49. implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
  50. implementation project(':capacitor-android')
  51. testImplementation "junit:junit:$junitVersion"
  52. androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
  53. androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
  54. implementation project(':capacitor-cordova-android-plugins')
  55. }
  56. apply from: 'capacitor.build.gradle'
  57. try {
  58. def servicesJSON = file('google-services.json')
  59. if (servicesJSON.text) {
  60. apply plugin: 'com.google.gms.google-services'
  61. }
  62. } catch(Exception e) {
  63. logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
  64. }