build.gradle 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. import org.apache.tools.ant.taskdefs.condition.Os
  2. apply plugin: 'com.android.application'
  3. android {
  4. compileSdkVersion 30
  5. buildToolsVersion '30.0.2'
  6. aaptOptions {
  7. cruncherEnabled = false
  8. useNewCruncher = false
  9. }
  10. defaultConfig {
  11. // applicationId "com.aries.sgzj"
  12. applicationId PACKAGE_NAME
  13. minSdkVersion 16
  14. targetSdkVersion 29
  15. versionCode VERSION_CODE.toInteger()
  16. versionName VERSION_NAME.toString()
  17. multiDexEnabled true
  18. manifestPlaceholders = [MY_APP_NAME: MY_APP_NAME]
  19. // uroi_ad_sdk_url_scheme 替换为您应用的url_scheme ,当前主要用作埋点检测。
  20. // 建议:应用包名+"uroi_ad_sdk_scheme"
  21. manifestPlaceholders.put("APPLOG_SCHEME", "com.aries.sgzj_uroi_ad_sdk_url_scheme".toLowerCase())
  22. ndk {
  23. abiFilters 'armeabi-v7a'
  24. }
  25. lintOptions {
  26. checkReleaseBuilds false
  27. abortOnError false
  28. }
  29. externalNativeBuild {
  30. ndkBuild {
  31. if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
  32. // skip the NDK Build step if PROP_NDK_MODE is none
  33. targets 'cocos2djs'
  34. arguments 'NDK_TOOLCHAIN_VERSION=clang'
  35. def module_paths = [project.file("${System.getenv("COCOSCREATOR_HOME")}/resources/.editors/Creator/2.3.3/resources/cocos2d-x"),
  36. project.file("${System.getenv("COCOSCREATOR_HOME")}/resources/.editors/Creator/2.3.3/resources/cocos2d-x/cocos"),
  37. project.file("${System.getenv("COCOSCREATOR_HOME")}/resources/.editors/Creator/2.3.3/resources/cocos2d-x/external")]
  38. //def module_paths = [project.file("D:/CocosCreatorIDE/CocosDashboard/resources/.editors/Creator/2.3.3/resources/cocos2d-x"),
  39. //project.file("D:/CocosCreatorIDE/CocosDashboard/resources/.editors/Creator/2.3.3/resources/cocos2d-x/cocos"),
  40. // project.file("D:/CocosCreatorIDE/CocosDashboard/resources/.editors/Creator/2.3.3/resources/cocos2d-x/external")]
  41. if (Os.isFamily(Os.FAMILY_WINDOWS)) {
  42. arguments 'NDK_MODULE_PATH=' + module_paths.join(";")
  43. } else {
  44. arguments 'NDK_MODULE_PATH=' + module_paths.join(':')
  45. }
  46. arguments '-j' + Runtime.runtime.availableProcessors()
  47. abiFilters.addAll(PROP_APP_ABI.split(':').collect { it as String })
  48. }
  49. }
  50. }
  51. }
  52. sourceSets.main {
  53. java.srcDirs "../src", "src"
  54. res.srcDirs "../res", 'res'
  55. res.srcDirs += 'libs/topon_res'
  56. jniLibs.srcDirs "../libs", 'libs'
  57. manifest.srcFile "AndroidManifest.xml"
  58. }
  59. externalNativeBuild {
  60. ndkBuild {
  61. if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
  62. // skip the NDK Build step if PROP_NDK_MODE is none
  63. path "jni/Android.mk"
  64. }
  65. }
  66. }
  67. signingConfigs {
  68. release {
  69. storeFile file(new File('./keystore/android.keystore'))
  70. storePassword RELEASE_STORE_PASSWORD
  71. keyAlias RELEASE_KEY_ALIAS
  72. keyPassword RELEASE_KEY_PASSWORD
  73. }
  74. }
  75. buildTypes {
  76. release {
  77. signingConfig signingConfigs.release
  78. debuggable false
  79. jniDebuggable false
  80. renderscriptDebuggable false
  81. minifyEnabled false
  82. shrinkResources false
  83. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  84. if (project.hasProperty("RELEASE_STORE_FILE")) {
  85. signingConfig signingConfigs.release
  86. }
  87. externalNativeBuild {
  88. ndkBuild {
  89. arguments 'NDK_DEBUG=0'
  90. }
  91. }
  92. buildConfigField "String", "TF_CHANNEL", "${TF_CHANNEL}"
  93. buildConfigField "String", "JL_AID", "${JL_AID}"
  94. buildConfigField "String", "JL_CHANNEL", "${JL_CHANNEL}"
  95. buildConfigField "String", "KS_AID", "${KS_AID}"
  96. buildConfigField "String", "KS_ANAME", "${KS_ANAME}"
  97. buildConfigField "String", "KS_CHANNEL", "${KS_CHANNEL}"
  98. buildConfigField "String", "UM_AID", "${UM_AID}"
  99. buildConfigField "String", "UM_CHANNEL", "${UM_CHANNEL}"
  100. buildConfigField "String", "UM_SECRET", "${UM_SECRET}"
  101. buildConfigField "String", "WX_APP_ID", "${WX_APP_ID}"
  102. buildConfigField "String", "TOPON", "${TOPON}"
  103. buildConfigField "String", "APP_CONFIG_CODE", "${APP_CONFIG_CODE}"
  104. }
  105. debug {
  106. debuggable true
  107. jniDebuggable true
  108. renderscriptDebuggable true
  109. externalNativeBuild {
  110. ndkBuild {
  111. arguments 'NDK_DEBUG=1'
  112. }
  113. }
  114. buildConfigField "String", "TF_CHANNEL", "${TF_CHANNEL}"
  115. buildConfigField "String", "JL_AID", "${JL_AID}"
  116. buildConfigField "String", "JL_CHANNEL", "${JL_CHANNEL}"
  117. buildConfigField "String", "KS_AID", "${KS_AID}"
  118. buildConfigField "String", "KS_ANAME", "${KS_ANAME}"
  119. buildConfigField "String", "KS_CHANNEL", "${KS_CHANNEL}"
  120. buildConfigField "String", "UM_AID", "${UM_AID}"
  121. buildConfigField "String", "UM_CHANNEL", "${UM_CHANNEL}"
  122. buildConfigField "String", "UM_SECRET", "${UM_SECRET}"
  123. buildConfigField "String", "WX_APP_ID", "${WX_APP_ID}"
  124. buildConfigField "String", "TOPON", "${TOPON}"
  125. buildConfigField "String", "APP_CONFIG_CODE", "${APP_CONFIG_CODE}"
  126. }
  127. }
  128. compileOptions {
  129. sourceCompatibility JavaVersion.VERSION_1_8
  130. targetCompatibility JavaVersion.VERSION_1_8
  131. }
  132. // repositories {
  133. // flatDir {
  134. // dirs 'libs'
  135. // }
  136. // }
  137. }
  138. android.applicationVariants.all { variant ->
  139. // delete previous files first
  140. delete "${buildDir}/intermediates/merged_assets/${variant.dirName}"
  141. variant.mergeAssets.doLast {
  142. def sourceDir = "${buildDir}/../../../../.."
  143. copy {
  144. from "${sourceDir}/res"
  145. into "${outputDir}/res"
  146. }
  147. copy {
  148. from "${sourceDir}/subpackages"
  149. into "${outputDir}/subpackages"
  150. }
  151. copy {
  152. from "${sourceDir}/src"
  153. into "${outputDir}/src"
  154. }
  155. copy {
  156. from "${sourceDir}/jsb-adapter"
  157. into "${outputDir}/jsb-adapter"
  158. }
  159. copy {
  160. from "${sourceDir}/main.js"
  161. from "${sourceDir}/project.json"
  162. into outputDir
  163. }
  164. }
  165. }
  166. def SUPPORT_VERSION = "27.1.1"
  167. dependencies {
  168. implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar', '*.so'])
  169. implementation fileTree(dir: "${System.getenv("COCOSCREATOR_HOME")}/resources/.editors/Creator/2.3.3/resources/cocos2d-x/cocos/platform/android/java/libs", include: ['*.jar'])
  170. //implementation fileTree(dir: "D:/CocosCreatorIDE/CocosDashboard/resources/.editors/Creator/2.3.3/resources/cocos2d-x/cocos/platform/android/java/libs", include: ['*.jar'])
  171. implementation project(':libcocos2dx')
  172. // implementation(name: 'open_ad_sdk', ext: 'aar')
  173. implementation 'com.android.support:multidex:1.0.0'
  174. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  175. exclude group: 'com.android.support', module: 'support-annotations'
  176. })
  177. implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
  178. implementation 'com.squareup.okhttp3:okhttp:3.4.1'
  179. implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
  180. implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
  181. //implementation "com.android.support:appcompat-v7:${SUPPORT_VERSION}"
  182. implementation "com.android.support:support-annotations:${SUPPORT_VERSION}"
  183. //implementation "com.android.support:support-v4:${SUPPORT_VERSION}"
  184. implementation files('libs\\crashsdk-3.2.0.4.jar')
  185. implementation files('libs\\umeng-asms-v1.1.3.jar')
  186. implementation files('libs\\umeng-common-9.1.0.jar')
  187. implementation files('libs\\umeng-crash-v0.0.4.jar')
  188. implementation files('libs\\umeng-game-9.1.0+G.jar')
  189. implementation files('libs\\utdid4all-1.5.2-proguard.jar')
  190. implementation project(':push')
  191. implementation 'cn.thinkingdata.android:ThinkingAnalyticsSDK:2.5.6'
  192. //TopOn
  193. api fileTree(include: ['*.jar', '*.aar'], dir: 'libs/topon_lib')
  194. //noinspection GradleCompatible
  195. api 'com.android.support:appcompat-v7:28.0.0'
  196. //noinspection GradleCompatible
  197. api 'com.android.support:design:28.0.0'
  198. implementation files('libs/OpenInstall_v2.5.0.jar')
  199. implementation 'com.google.zxing:core:3.3.0'
  200. // api 'com.google.code.gson:gson:2.8.0'
  201. }