launcherTemplate.gradle 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.google.gms.google-services'
  3. apply plugin: 'com.google.firebase.crashlytics'
  4. dependencies {
  5. implementation project(':unityLibrary')
  6. }
  7. android {
  8. ndkPath "**NDKPATH**"
  9. compileSdkVersion **APIVERSION**
  10. buildToolsVersion '**BUILDTOOLS**'
  11. compileOptions {
  12. sourceCompatibility JavaVersion.VERSION_11
  13. targetCompatibility JavaVersion.VERSION_11
  14. }
  15. defaultConfig {
  16. multiDexEnabled true //添加此配置,是为了当代码行数超过64k的时候设置的
  17. minSdkVersion **MINSDKVERSION**
  18. targetSdkVersion **TARGETSDKVERSION**
  19. applicationId '**APPLICATIONID**'
  20. ndk {
  21. abiFilters **ABIFILTERS**
  22. }
  23. versionCode **VERSIONCODE**
  24. versionName '**VERSIONNAME**'
  25. }
  26. aaptOptions {
  27. noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
  28. ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
  29. }**SIGN**
  30. lintOptions {
  31. abortOnError false
  32. }
  33. buildTypes {
  34. debug {
  35. minifyEnabled **MINIFY_DEBUG**
  36. proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
  37. jniDebuggable true
  38. }
  39. release {
  40. minifyEnabled **MINIFY_RELEASE**
  41. proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
  42. }
  43. }**PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS**
  44. **BUILT_APK_LOCATION**
  45. bundle {
  46. language {
  47. enableSplit = false
  48. }
  49. density {
  50. enableSplit = false
  51. }
  52. abi {
  53. enableSplit = true
  54. }
  55. }
  56. task copyJsonFile {
  57. def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
  58. copy {
  59. from(unityProjectPath + '/Assets/PottingMobileSDK/')
  60. into('./')
  61. include("google-services.json")
  62. }
  63. }
  64. preBuild.dependsOn copyJsonFile
  65. }**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**