2015-12-24 00:54:00 +08:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion 22
|
|
|
|
buildToolsVersion "22.0.1"
|
|
|
|
|
|
|
|
defaultConfig {
|
2017-02-21 17:58:30 +08:00
|
|
|
applicationId "org.cocos2dx.controller_test"
|
2015-12-24 00:54:00 +08:00
|
|
|
minSdkVersion 10
|
|
|
|
targetSdkVersion 22
|
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
|
|
|
|
2017-02-21 17:58:30 +08:00
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
|
|
|
targets 'controller_test'
|
|
|
|
arguments 'NDK_MODULE_PATH=../../../../..:../../../../../cocos:../../../../../external'
|
|
|
|
arguments '-j' + Runtime.runtime.availableProcessors()
|
|
|
|
abiFilters 'armeabi'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-24 00:54:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.main {
|
|
|
|
java.srcDir "src"
|
|
|
|
res.srcDir "res"
|
|
|
|
manifest.srcFile "AndroidManifest.xml"
|
2017-02-21 17:58:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
|
|
|
path "jni/Android.mk"
|
|
|
|
}
|
2015-12-24 00:54:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
signingConfigs {
|
|
|
|
|
|
|
|
release {
|
|
|
|
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
|
|
|
storeFile file(RELEASE_STORE_FILE)
|
|
|
|
storePassword RELEASE_STORE_PASSWORD
|
|
|
|
keyAlias RELEASE_KEY_ALIAS
|
|
|
|
keyPassword RELEASE_KEY_PASSWORD
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
|
|
|
signingConfig signingConfigs.release
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-21 17:58:30 +08:00
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
def copyAssets = task("${variant.dirName}copyAssets", type: Copy) {
|
|
|
|
|
|
|
|
// delete previous files first
|
|
|
|
delete "${buildDir}/intermediates/assets/${variant.dirName}"
|
|
|
|
|
|
|
|
copy {
|
|
|
|
from "${buildDir}/../../../../res"
|
|
|
|
into "${buildDir}/intermediates/assets/${variant.dirName}/res"
|
|
|
|
}
|
|
|
|
|
|
|
|
copy {
|
|
|
|
from "${buildDir}/../../../../src"
|
|
|
|
into "${buildDir}/intermediates/assets/${variant.dirName}/src"
|
|
|
|
}
|
|
|
|
|
|
|
|
copy {
|
|
|
|
from("${buildDir}/../../../../../cpp-tests/Resources") {
|
|
|
|
exclude "**/*.gz"
|
|
|
|
}
|
|
|
|
into "${buildDir}/intermediates/assets/${variant.dirName}/res"
|
|
|
|
}
|
|
|
|
|
|
|
|
copy {
|
|
|
|
from "${buildDir}/../../../../../../cocos/scripting/js-bindings/script"
|
|
|
|
into "${buildDir}/intermediates/assets/${variant.dirName}/script"
|
|
|
|
}
|
|
|
|
|
|
|
|
copy {
|
|
|
|
from "${buildDir}/../../../../main.js"
|
|
|
|
from "${buildDir}/../../../../project.json"
|
|
|
|
into "${buildDir}/intermediates/assets/${variant.dirName}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
variant.mergeAssets.finalizedBy copyAssets
|
|
|
|
}
|
|
|
|
|
2015-12-24 00:54:00 +08:00
|
|
|
dependencies {
|
|
|
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
|
|
|
compile project(':libcocos2dx')
|
|
|
|
}
|