1
0

build.gradle 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import org.apache.tools.ant.taskdefs.condition.Os
  2. apply plugin: 'com.android.application'
  3. android {
  4. compileSdkVersion 22
  5. buildToolsVersion "25.0.0"
  6. defaultConfig {
  7. applicationId "ime.capella.jao.redcore"
  8. minSdkVersion 10
  9. targetSdkVersion PROP_TARGET_SDK_VERSION
  10. versionCode 1
  11. versionName "1.0"
  12. externalNativeBuild {
  13. ndkBuild {
  14. if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
  15. // skip the NDK Build step if PROP_NDK_MODE is none
  16. targets 'MyGame'
  17. arguments 'NDK_TOOLCHAIN_VERSION=4.9'
  18. arguments 'APP_PLATFORM=android-'+PROP_TARGET_SDK_VERSION
  19. def module_paths = [project.file("../../cocos2d").absolutePath,
  20. project.file("../../cocos2d/cocos").absolutePath,
  21. project.file("../../cocos2d/external").absolutePath]
  22. if (Os.isFamily(Os.FAMILY_WINDOWS)) {
  23. // should use '/'
  24. module_paths = module_paths.collect {it.replaceAll('\\\\', '/')}
  25. arguments 'NDK_MODULE_PATH=' + module_paths.join(";")
  26. }
  27. else {
  28. arguments 'NDK_MODULE_PATH=' + module_paths.join(':')
  29. }
  30. arguments '-j' + Runtime.runtime.availableProcessors()
  31. abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
  32. }
  33. }
  34. }
  35. }
  36. sourceSets.main {
  37. java.srcDir "src"
  38. res.srcDir "res"
  39. manifest.srcFile "AndroidManifest.xml"
  40. assets.srcDir "../../Resources"
  41. }
  42. externalNativeBuild {
  43. ndkBuild {
  44. if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
  45. // skip the NDK Build step if PROP_NDK_MODE is none
  46. path "jni/Android.mk"
  47. }
  48. }
  49. }
  50. signingConfigs {
  51. release {
  52. if (project.hasProperty("RELEASE_STORE_FILE")) {
  53. storeFile file(RELEASE_STORE_FILE)
  54. storePassword RELEASE_STORE_PASSWORD
  55. keyAlias RELEASE_KEY_ALIAS
  56. keyPassword RELEASE_KEY_PASSWORD
  57. }
  58. }
  59. }
  60. buildTypes {
  61. release {
  62. minifyEnabled false
  63. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  64. if (project.hasProperty("RELEASE_STORE_FILE")) {
  65. signingConfig signingConfigs.release
  66. }
  67. externalNativeBuild {
  68. ndkBuild {
  69. arguments 'NDK_DEBUG=0'
  70. }
  71. }
  72. }
  73. debug {
  74. externalNativeBuild {
  75. ndkBuild {
  76. arguments 'NDK_DEBUG=1'
  77. }
  78. }
  79. }
  80. }
  81. }
  82. dependencies {
  83. compile fileTree(dir: 'libs', include: ['*.jar'])
  84. compile project(':libcocos2dx')
  85. }