From 37dddf9b15929cf503e98f8b83ad700e844b933d Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Thu, 21 May 2015 15:31:18 +0800 Subject: [PATCH 1/6] Add execute permission for the gradlew in proj.android-studio. --- templates/cpp-template-default/proj.android-studio/gradlew | 0 .../frameworks/runtime-src/proj.android-studio/gradlew | 0 .../frameworks/runtime-src/proj.android-studio/gradlew | 0 tests/cpp-empty-test/proj.android-studio/gradlew | 0 tests/cpp-tests/proj.android-studio/gradlew | 0 tests/game-controller-test/proj.android-studio/gradlew | 0 tests/js-tests/project/proj.android-studio/gradlew | 0 tests/lua-empty-test/project/proj.android-studio/gradlew | 0 .../lua-game-controller-test/project/proj.android-studio/gradlew | 0 tests/lua-tests/project/proj.android-studio/gradlew | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 templates/cpp-template-default/proj.android-studio/gradlew mode change 100644 => 100755 templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew mode change 100644 => 100755 templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew mode change 100644 => 100755 tests/cpp-empty-test/proj.android-studio/gradlew mode change 100644 => 100755 tests/cpp-tests/proj.android-studio/gradlew mode change 100644 => 100755 tests/game-controller-test/proj.android-studio/gradlew mode change 100644 => 100755 tests/js-tests/project/proj.android-studio/gradlew mode change 100644 => 100755 tests/lua-empty-test/project/proj.android-studio/gradlew mode change 100644 => 100755 tests/lua-game-controller-test/project/proj.android-studio/gradlew mode change 100644 => 100755 tests/lua-tests/project/proj.android-studio/gradlew diff --git a/templates/cpp-template-default/proj.android-studio/gradlew b/templates/cpp-template-default/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/tests/cpp-empty-test/proj.android-studio/gradlew b/tests/cpp-empty-test/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/tests/cpp-tests/proj.android-studio/gradlew b/tests/cpp-tests/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/tests/game-controller-test/proj.android-studio/gradlew b/tests/game-controller-test/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/tests/js-tests/project/proj.android-studio/gradlew b/tests/js-tests/project/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/tests/lua-empty-test/project/proj.android-studio/gradlew b/tests/lua-empty-test/project/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/tests/lua-game-controller-test/project/proj.android-studio/gradlew b/tests/lua-game-controller-test/project/proj.android-studio/gradlew old mode 100644 new mode 100755 diff --git a/tests/lua-tests/project/proj.android-studio/gradlew b/tests/lua-tests/project/proj.android-studio/gradlew old mode 100644 new mode 100755 From 78d4089215d858eeefa025d1194038e9306569c2 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Thu, 21 May 2015 15:43:01 +0800 Subject: [PATCH 2/6] Add the project.properties for the ndk-build of proj.android-studio. --- .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ .../proj.android-studio/app/project.properties | 11 +++++++++++ 10 files changed, 110 insertions(+) create mode 100644 templates/cpp-template-default/proj.android-studio/app/project.properties create mode 100644 templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/project.properties create mode 100644 templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/project.properties create mode 100644 tests/cpp-empty-test/proj.android-studio/app/project.properties create mode 100644 tests/cpp-tests/proj.android-studio/app/project.properties create mode 100644 tests/game-controller-test/proj.android-studio/app/project.properties create mode 100644 tests/js-tests/project/proj.android-studio/app/project.properties create mode 100644 tests/lua-empty-test/project/proj.android-studio/app/project.properties create mode 100644 tests/lua-game-controller-test/project/proj.android-studio/app/project.properties create mode 100644 tests/lua-tests/project/proj.android-studio/app/project.properties diff --git a/templates/cpp-template-default/proj.android-studio/app/project.properties b/templates/cpp-template-default/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/project.properties b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/project.properties b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/tests/cpp-empty-test/proj.android-studio/app/project.properties b/tests/cpp-empty-test/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/tests/cpp-tests/proj.android-studio/app/project.properties b/tests/cpp-tests/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/tests/game-controller-test/proj.android-studio/app/project.properties b/tests/game-controller-test/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/tests/js-tests/project/proj.android-studio/app/project.properties b/tests/js-tests/project/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/tests/lua-empty-test/project/proj.android-studio/app/project.properties b/tests/lua-empty-test/project/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/project.properties b/tests/lua-game-controller-test/project/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 diff --git a/tests/lua-tests/project/proj.android-studio/app/project.properties b/tests/lua-tests/project/proj.android-studio/app/project.properties new file mode 100644 index 0000000000..f049142c17 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 From 41792caa6b089e3f881b41b58f6bf40e7d0c5335 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Thu, 21 May 2015 16:34:03 +0800 Subject: [PATCH 3/6] Add files & configuration for android studio support in console. --- .gitignore | 4 +++ .../proj.android-studio/build-cfg.json | 13 +++++++++ .../proj.android-studio/build-cfg.json | 29 +++++++++++++++++++ .../proj.android-studio/build-cfg.json | 24 +++++++++++++++ tests/cpp-empty-test/.cocos-project.json | 3 +- .../proj.android-studio/build-cfg.json | 16 ++++++++++ tests/cpp-tests/.cocos-project.json | 3 +- .../proj.android-studio/build-cfg.json | 16 ++++++++++ .../game-controller-test/.cocos-project.json | 3 +- .../proj.android-studio/build-cfg.json | 16 ++++++++++ tests/js-tests/.cocos-project.json | 3 +- .../proj.android-studio/build-cfg.json | 29 +++++++++++++++++++ tests/lua-empty-test/.cocos-project.json | 3 +- .../proj.android-studio/build-cfg.json | 21 ++++++++++++++ .../.cocos-project.json | 3 +- .../proj.android-studio/build-cfg.json | 28 ++++++++++++++++++ tests/lua-tests/.cocos-project.json | 3 +- .../proj.android-studio/build-cfg.json | 28 ++++++++++++++++++ 18 files changed, 238 insertions(+), 7 deletions(-) create mode 100644 templates/cpp-template-default/proj.android-studio/build-cfg.json create mode 100644 templates/js-template-default/frameworks/runtime-src/proj.android-studio/build-cfg.json create mode 100644 templates/lua-template-default/frameworks/runtime-src/proj.android-studio/build-cfg.json create mode 100644 tests/cpp-empty-test/proj.android-studio/build-cfg.json create mode 100644 tests/cpp-tests/proj.android-studio/build-cfg.json create mode 100644 tests/game-controller-test/proj.android-studio/build-cfg.json create mode 100644 tests/js-tests/project/proj.android-studio/build-cfg.json create mode 100644 tests/lua-empty-test/project/proj.android-studio/build-cfg.json create mode 100644 tests/lua-game-controller-test/project/proj.android-studio/build-cfg.json create mode 100644 tests/lua-tests/project/proj.android-studio/build-cfg.json diff --git a/.gitignore b/.gitignore index 4785e08370..008e17a40f 100644 --- a/.gitignore +++ b/.gitignore @@ -113,6 +113,10 @@ build/build/ cocos/scripting/lua-bindings/proj.ios_mac/build/ tests/*/runtime/ tests/*/publish/ +tests/*/project/proj.android-studio/app/build.xml +tests/*/project/proj.android-studio/app/proguard-project.txt +tests/*/proj.android-studio/app/build.xml +tests/*/proj.android-studio/app/proguard-project.txt # Android project.properties diff --git a/templates/cpp-template-default/proj.android-studio/build-cfg.json b/templates/cpp-template-default/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..611f232c30 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/build-cfg.json @@ -0,0 +1,13 @@ +{ + "ndk_module_path" :[ + "../cocos2d", + "../cocos2d/cocos", + "../cocos2d/external" + ], + "copy_resources": [ + { + "from": "../Resources", + "to": "" + } + ] +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build-cfg.json b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..d427ea47b6 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build-cfg.json @@ -0,0 +1,29 @@ +{ + "ndk_module_path" :[ + "../../cocos2d-x", + "../../cocos2d-x/cocos", + "../../cocos2d-x/external" + ], + "copy_resources": [ + { + "from": "../../../src", + "to": "src" + }, + { + "from": "../../../res", + "to": "res" + }, + { + "from": "../../../main.js", + "to": "" + }, + { + "from": "../../../project.json", + "to": "" + }, + { + "from": "../../cocos2d-x/cocos/scripting/js-bindings/script", + "to": "script" + } + ] +} diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/build-cfg.json b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..f1a55fd365 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/build-cfg.json @@ -0,0 +1,24 @@ +{ + "ndk_module_path" :[ + "../../cocos2d-x", + "../../cocos2d-x/cocos/", + "../../cocos2d-x/external", + "../../cocos2d-x/cocos/scripting" + ], + "copy_resources": [ + { + "from": "../../../src", + "to": "src" + }, + { + "from": "../../../res", + "to": "res" + } + ], + "must_copy_resources": [ + { + "from": "../../../config.json", + "to": "" + } + ] +} diff --git a/tests/cpp-empty-test/.cocos-project.json b/tests/cpp-empty-test/.cocos-project.json index 97103e9e8f..bafca7169b 100644 --- a/tests/cpp-empty-test/.cocos-project.json +++ b/tests/cpp-empty-test/.cocos-project.json @@ -24,7 +24,8 @@ "target_name": "cpp-empty-test Mac" }, "android_cfg": { - "project_path": "proj.android" + "project_path": "proj.android", + "studio_proj_path" : "proj.android-studio" }, "wp8_1_cfg" : { "project_path": "../../build", diff --git a/tests/cpp-empty-test/proj.android-studio/build-cfg.json b/tests/cpp-empty-test/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..98dbc8533f --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/build-cfg.json @@ -0,0 +1,16 @@ +{ + "ndk_module_path" :[ + "../../..", + "../../../cocos", + "../../../external" + ], + "copy_resources": [ + { + "from": "../Resources", + "to": "", + "exclude": [ + "*.gz" + ] + } + ] +} diff --git a/tests/cpp-tests/.cocos-project.json b/tests/cpp-tests/.cocos-project.json index 34e7c97a15..fa24c6e16e 100644 --- a/tests/cpp-tests/.cocos-project.json +++ b/tests/cpp-tests/.cocos-project.json @@ -24,7 +24,8 @@ "target_name": "cpp-tests Mac" }, "android_cfg": { - "project_path": "proj.android" + "project_path": "proj.android", + "studio_proj_path" : "proj.android-studio" }, "wp8_1_cfg" : { "project_path": "../../build", diff --git a/tests/cpp-tests/proj.android-studio/build-cfg.json b/tests/cpp-tests/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..98dbc8533f --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/build-cfg.json @@ -0,0 +1,16 @@ +{ + "ndk_module_path" :[ + "../../..", + "../../../cocos", + "../../../external" + ], + "copy_resources": [ + { + "from": "../Resources", + "to": "", + "exclude": [ + "*.gz" + ] + } + ] +} diff --git a/tests/game-controller-test/.cocos-project.json b/tests/game-controller-test/.cocos-project.json index 91621fd443..b0a3b0127b 100644 --- a/tests/game-controller-test/.cocos-project.json +++ b/tests/game-controller-test/.cocos-project.json @@ -6,7 +6,8 @@ }, "project_type": "cpp", "android_cfg": { - "project_path": "proj.android" + "project_path": "proj.android", + "studio_proj_path" : "proj.android-studio" }, "engine_dir": "../../" } diff --git a/tests/game-controller-test/proj.android-studio/build-cfg.json b/tests/game-controller-test/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..98dbc8533f --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/build-cfg.json @@ -0,0 +1,16 @@ +{ + "ndk_module_path" :[ + "../../..", + "../../../cocos", + "../../../external" + ], + "copy_resources": [ + { + "from": "../Resources", + "to": "", + "exclude": [ + "*.gz" + ] + } + ] +} diff --git a/tests/js-tests/.cocos-project.json b/tests/js-tests/.cocos-project.json index bd34889d3f..353080810c 100644 --- a/tests/js-tests/.cocos-project.json +++ b/tests/js-tests/.cocos-project.json @@ -18,7 +18,8 @@ "target_name": "js-tests Mac" }, "android_cfg": { - "project_path": "project/proj.android" + "project_path": "project/proj.android", + "studio_proj_path" : "project/proj.android-studio" }, "web_cfg": { "project_path": "", diff --git a/tests/js-tests/project/proj.android-studio/build-cfg.json b/tests/js-tests/project/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..4010cc7cdb --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/build-cfg.json @@ -0,0 +1,29 @@ +{ + "copy_resources": [ + { + "from": "../../src", + "to": "src" + }, + { + "from": "../../../cpp-tests/Resources/", + "to": "res/" + }, + { + "from": "../../main.js", + "to": "" + }, + { + "from": "../../project.json", + "to": "" + }, + { + "from": "../../../../cocos/scripting/js-bindings/script", + "to": "script" + } + ], + "ndk_module_path": [ + "../../../..", + "../../../../cocos", + "../../../../external" + ] +} diff --git a/tests/lua-empty-test/.cocos-project.json b/tests/lua-empty-test/.cocos-project.json index 470ad30447..94e6c01188 100644 --- a/tests/lua-empty-test/.cocos-project.json +++ b/tests/lua-empty-test/.cocos-project.json @@ -25,7 +25,8 @@ "target_name": "lua-empty-test Mac" }, "android_cfg": { - "project_path": "project/proj.android" + "project_path": "project/proj.android", + "studio_proj_path" : "project/proj.android-studio" }, "engine_dir": "../../" } diff --git a/tests/lua-empty-test/project/proj.android-studio/build-cfg.json b/tests/lua-empty-test/project/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..92b544334b --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/build-cfg.json @@ -0,0 +1,21 @@ +{ + "ndk_module_path" :[ + "../../../..", + "../../../../cocos", + "../../../../external" + ], + "copy_resources": [ + { + "from": "../../src", + "to": "src" + }, + { + "from": "../../res", + "to": "res" + }, + { + "from": "../../../../cocos/scripting/lua-bindings/script/", + "to": "src/cocos" + } + ] +} diff --git a/tests/lua-game-controller-test/.cocos-project.json b/tests/lua-game-controller-test/.cocos-project.json index 570b02f99b..7f6266d7c2 100644 --- a/tests/lua-game-controller-test/.cocos-project.json +++ b/tests/lua-game-controller-test/.cocos-project.json @@ -7,6 +7,7 @@ "project_type": "lua", "has_native": true, "android_cfg": { - "project_path": "project/proj.android" + "project_path": "project/proj.android", + "studio_proj_path" : "project/proj.android-studio" } } diff --git a/tests/lua-game-controller-test/project/proj.android-studio/build-cfg.json b/tests/lua-game-controller-test/project/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..71c3d466a0 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/build-cfg.json @@ -0,0 +1,28 @@ +{ + "ndk_module_path" :[ + "../../../..", + "../../../../cocos", + "../../../../external" + ], + "copy_resources": [ + { + "from": "../../src", + "to": "src" + }, + { + "from": "../../res", + "to": "res" + }, + { + "from": "../../../../cocos/scripting/lua-bindings/script/", + "to": "src/cocos" + }, + { + "from": "../../../game-controller-test/Resources", + "to": "res", + "exclude": [ + "*.gz" + ] + } + ] +} diff --git a/tests/lua-tests/.cocos-project.json b/tests/lua-tests/.cocos-project.json index aaef81cc15..1a0b053d27 100644 --- a/tests/lua-tests/.cocos-project.json +++ b/tests/lua-tests/.cocos-project.json @@ -25,7 +25,8 @@ "target_name": "lua-tests Mac" }, "android_cfg": { - "project_path": "project/proj.android" + "project_path": "project/proj.android", + "studio_proj_path" : "project/proj.android-studio" }, "engine_dir": "../../" } diff --git a/tests/lua-tests/project/proj.android-studio/build-cfg.json b/tests/lua-tests/project/proj.android-studio/build-cfg.json new file mode 100644 index 0000000000..41ae5ae199 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/build-cfg.json @@ -0,0 +1,28 @@ +{ + "ndk_module_path" :[ + "../../../..", + "../../../../cocos", + "../../../../external" + ], + "copy_resources": [ + { + "from": "../../src", + "to": "src" + }, + { + "from": "../../res/cocosbuilderRes", + "to": "res/cocosbuilderRes" + }, + { + "from": "../../../cpp-tests/Resources", + "to": "res", + "exclude": [ + "*.gz" + ] + }, + { + "from": "../../../../cocos/scripting/lua-bindings/script/", + "to": "src/cocos" + } + ] +} From 94e2e1cb00adb695f2d414e440c191ddefdd3c7c Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Thu, 21 May 2015 18:27:30 +0800 Subject: [PATCH 4/6] Modify the configuration for android studio support in console. --- templates/cpp-template-default/cocos-project-template.json | 4 +++- .../cpp-template-default/proj.android-studio/app/build.gradle | 2 +- .../cpp-template-default/proj.android-studio/settings.gradle | 3 ++- templates/js-template-default/cocos-project-template.json | 4 +++- .../runtime-src/proj.android-studio/app/build.gradle | 2 +- .../runtime-src/proj.android-studio/settings.gradle | 3 ++- templates/lua-template-default/cocos-project-template.json | 4 +++- .../runtime-src/proj.android-studio/settings.gradle | 3 ++- templates/lua-template-runtime/cocos-project-template.json | 4 +++- tests/cpp-empty-test/proj.android-studio/settings.gradle | 3 ++- tests/cpp-tests/proj.android-studio/settings.gradle | 3 ++- .../game-controller-test/proj.android-studio/settings.gradle | 3 ++- tests/js-tests/project/proj.android-studio/settings.gradle | 3 ++- .../project/proj.android-studio/settings.gradle | 3 ++- .../project/proj.android-studio/settings.gradle | 3 ++- tests/lua-tests/project/proj.android-studio/settings.gradle | 3 ++- 16 files changed, 34 insertions(+), 16 deletions(-) diff --git a/templates/cpp-template-default/cocos-project-template.json b/templates/cpp-template-default/cocos-project-template.json index 727f296ed7..966a45740b 100644 --- a/templates/cpp-template-default/cocos-project-template.json +++ b/templates/cpp-template-default/cocos-project-template.json @@ -42,6 +42,7 @@ "proj.android/AndroidManifest.xml", "proj.android/build.xml", "proj.android/res/values/strings.xml", + "proj.android-studio/settings.gradle", "proj.ios_mac/ios/main.m", "proj.ios_mac/ios/Prefix.pch", "proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", @@ -51,7 +52,8 @@ "project_replace_package_name":{ "src_package_name":"org.cocos2dx.hellocpp", "files":[ - "proj.android/AndroidManifest.xml" + "proj.android/AndroidManifest.xml", + "proj.android-studio/app/build.gradle" ] }, "project_replace_mac_bundleid": { diff --git a/templates/cpp-template-default/proj.android-studio/app/build.gradle b/templates/cpp-template-default/proj.android-studio/app/build.gradle index 8b80348200..599914d292 100644 --- a/templates/cpp-template-default/proj.android-studio/app/build.gradle +++ b/templates/cpp-template-default/proj.android-studio/app/build.gradle @@ -5,7 +5,7 @@ android { buildToolsVersion "22.0.1" defaultConfig { - applicationId "org.cocos2dx.cpp_empty_test" + applicationId "org.cocos2dx.hellocpp" minSdkVersion 10 targetSdkVersion 22 versionCode 1 diff --git a/templates/cpp-template-default/proj.android-studio/settings.gradle b/templates/cpp-template-default/proj.android-studio/settings.gradle index e9cae16445..011889344e 100644 --- a/templates/cpp-template-default/proj.android-studio/settings.gradle +++ b/templates/cpp-template-default/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../cocos2d/cocos/platform/android/libcocos2dx') -include ':app' +include ':HelloCpp' +project(':HelloCpp').projectDir = new File(settingsDir, 'app') diff --git a/templates/js-template-default/cocos-project-template.json b/templates/js-template-default/cocos-project-template.json index 0272903ee9..247d9b6887 100644 --- a/templates/js-template-default/cocos-project-template.json +++ b/templates/js-template-default/cocos-project-template.json @@ -59,6 +59,7 @@ "frameworks/runtime-src/proj.android/AndroidManifest.xml", "frameworks/runtime-src/proj.android/build.xml", "frameworks/runtime-src/proj.android/res/values/strings.xml", + "frameworks/runtime-src/proj.android-studio/settings.gradle", "frameworks/runtime-src/proj.ios_mac/ios/main.m", "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", @@ -77,7 +78,8 @@ "project_replace_package_name":{ "src_package_name":"org.cocos2dx.hellojavascript", "files":[ - "frameworks/runtime-src/proj.android/AndroidManifest.xml" + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android-studio/app/build.gradle" ] }, "project_replace_mac_bundleid":{ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle index 540f81e328..33da552686 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle @@ -5,7 +5,7 @@ android { buildToolsVersion "22.0.1" defaultConfig { - applicationId "org.cocos2dx.hellolua" + applicationId "org.cocos2dx.hellojavascript" minSdkVersion 10 targetSdkVersion 22 versionCode 1 diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle index aa7d6ba93b..133ec2d702 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../cocos2d-x/cocos/platform/android/libcocos2dx') -include ':app' +include ':HelloJavascript' +project(':HelloJavascript').projectDir = new File(settingsDir, 'app') diff --git a/templates/lua-template-default/cocos-project-template.json b/templates/lua-template-default/cocos-project-template.json index 303c2e6f95..6a19df14b3 100644 --- a/templates/lua-template-default/cocos-project-template.json +++ b/templates/lua-template-default/cocos-project-template.json @@ -161,6 +161,7 @@ "frameworks/runtime-src/proj.android/AndroidManifest.xml", "frameworks/runtime-src/proj.android/build.xml", "frameworks/runtime-src/proj.android/res/values/strings.xml", + "frameworks/runtime-src/proj.android-studio/settings.gradle", "frameworks/runtime-src/proj.ios_mac/ios/main.m", "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", "frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm", @@ -170,7 +171,8 @@ "project_replace_package_name": { "src_package_name": "org.cocos2dx.hellolua", "files": [ - "frameworks/runtime-src/proj.android/AndroidManifest.xml" + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android-studio/app/build.gradle" ] }, "project_replace_mac_bundleid": { diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle index aa7d6ba93b..71d4b157a5 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../cocos2d-x/cocos/platform/android/libcocos2dx') -include ':app' +include ':HelloLua' +project(':HelloLua').projectDir = new File(settingsDir, 'app') diff --git a/templates/lua-template-runtime/cocos-project-template.json b/templates/lua-template-runtime/cocos-project-template.json index fa03afca47..a2dc874dc0 100644 --- a/templates/lua-template-runtime/cocos-project-template.json +++ b/templates/lua-template-runtime/cocos-project-template.json @@ -161,6 +161,7 @@ "frameworks/runtime-src/proj.android/AndroidManifest.xml", "frameworks/runtime-src/proj.android/build.xml", "frameworks/runtime-src/proj.android/res/values/strings.xml", + "frameworks/runtime-src/proj.android-studio/settings.gradle", "frameworks/runtime-src/proj.ios_mac/ios/main.m", "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", "frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm", @@ -170,7 +171,8 @@ "project_replace_package_name": { "src_package_name": "org.cocos2dx.hellolua", "files": [ - "frameworks/runtime-src/proj.android/AndroidManifest.xml" + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android-studio/app/build.gradle" ] }, "project_replace_mac_bundleid": { diff --git a/tests/cpp-empty-test/proj.android-studio/settings.gradle b/tests/cpp-empty-test/proj.android-studio/settings.gradle index 25a3ed500d..6d8165edec 100644 --- a/tests/cpp-empty-test/proj.android-studio/settings.gradle +++ b/tests/cpp-empty-test/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx') -include ':app' +include ':CppEmptyTest' +project(':CppEmptyTest').projectDir = new File(settingsDir, 'app') diff --git a/tests/cpp-tests/proj.android-studio/settings.gradle b/tests/cpp-tests/proj.android-studio/settings.gradle index 25a3ed500d..20644fa006 100644 --- a/tests/cpp-tests/proj.android-studio/settings.gradle +++ b/tests/cpp-tests/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx') -include ':app' +include ':CppTests' +project(':CppTests').projectDir = new File(settingsDir, 'app') diff --git a/tests/game-controller-test/proj.android-studio/settings.gradle b/tests/game-controller-test/proj.android-studio/settings.gradle index d2f6c77247..f8b8e3329d 100644 --- a/tests/game-controller-test/proj.android-studio/settings.gradle +++ b/tests/game-controller-test/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx_with_controller' project(':libcocos2dx_with_controller').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx-with-controller') -include ':app' +include ':GameControllerTest' +project(':GameControllerTest').projectDir = new File(settingsDir, 'app') diff --git a/tests/js-tests/project/proj.android-studio/settings.gradle b/tests/js-tests/project/proj.android-studio/settings.gradle index 1de06f6b29..05e6a4191f 100644 --- a/tests/js-tests/project/proj.android-studio/settings.gradle +++ b/tests/js-tests/project/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') -include ':app' +include ':JSTests' +project(':JSTests').projectDir = new File(settingsDir, 'app') diff --git a/tests/lua-empty-test/project/proj.android-studio/settings.gradle b/tests/lua-empty-test/project/proj.android-studio/settings.gradle index 1de06f6b29..11316ebf9c 100644 --- a/tests/lua-empty-test/project/proj.android-studio/settings.gradle +++ b/tests/lua-empty-test/project/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') -include ':app' +include ':LuaEmptyTest' +project(':LuaEmptyTest').projectDir = new File(settingsDir, 'app') diff --git a/tests/lua-game-controller-test/project/proj.android-studio/settings.gradle b/tests/lua-game-controller-test/project/proj.android-studio/settings.gradle index 5b5eda1247..57e3fb0330 100644 --- a/tests/lua-game-controller-test/project/proj.android-studio/settings.gradle +++ b/tests/lua-game-controller-test/project/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx_with_controller' project(':libcocos2dx_with_controller').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx-with-controller') -include ':app' +include ':LuaGameControllerTest' +project(':LuaGameControllerTest').projectDir = new File(settingsDir, 'app') diff --git a/tests/lua-tests/project/proj.android-studio/settings.gradle b/tests/lua-tests/project/proj.android-studio/settings.gradle index 1de06f6b29..6087728e42 100644 --- a/tests/lua-tests/project/proj.android-studio/settings.gradle +++ b/tests/lua-tests/project/proj.android-studio/settings.gradle @@ -1,3 +1,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') -include ':app' +include ':LuaTests' +project(':LuaTests').projectDir = new File(settingsDir, 'app') From 3d0c716ee9b230fad3cd15cbf257903eaa4dd891 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Fri, 22 May 2015 15:52:41 +0800 Subject: [PATCH 5/6] Add script in build.gradle for sign the release apk. --- .../proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../project/proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../project/proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../project/proj.android-studio/app/build.gradle | 15 +++++++++++++++ .../project/proj.android-studio/app/build.gradle | 15 +++++++++++++++ 10 files changed, 150 insertions(+) diff --git a/templates/cpp-template-default/proj.android-studio/app/build.gradle b/templates/cpp-template-default/proj.android-studio/app/build.gradle index 599914d292..0358799ff7 100644 --- a/templates/cpp-template-default/proj.android-studio/app/build.gradle +++ b/templates/cpp-template-default/proj.android-studio/app/build.gradle @@ -20,10 +20,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle index 33da552686..a4ddecef06 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle @@ -20,10 +20,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle index 540f81e328..66c1ee4e77 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle @@ -20,10 +20,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/tests/cpp-empty-test/proj.android-studio/app/build.gradle b/tests/cpp-empty-test/proj.android-studio/app/build.gradle index 8b80348200..b58850e140 100644 --- a/tests/cpp-empty-test/proj.android-studio/app/build.gradle +++ b/tests/cpp-empty-test/proj.android-studio/app/build.gradle @@ -20,10 +20,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/tests/cpp-tests/proj.android-studio/app/build.gradle b/tests/cpp-tests/proj.android-studio/app/build.gradle index a9d15e0eef..b88a974d95 100644 --- a/tests/cpp-tests/proj.android-studio/app/build.gradle +++ b/tests/cpp-tests/proj.android-studio/app/build.gradle @@ -21,10 +21,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/tests/game-controller-test/proj.android-studio/app/build.gradle b/tests/game-controller-test/proj.android-studio/app/build.gradle index 3c733eb12d..dbee5189e0 100644 --- a/tests/game-controller-test/proj.android-studio/app/build.gradle +++ b/tests/game-controller-test/proj.android-studio/app/build.gradle @@ -20,10 +20,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/tests/js-tests/project/proj.android-studio/app/build.gradle b/tests/js-tests/project/proj.android-studio/app/build.gradle index 74f9d2621a..13b15014ca 100644 --- a/tests/js-tests/project/proj.android-studio/app/build.gradle +++ b/tests/js-tests/project/proj.android-studio/app/build.gradle @@ -21,10 +21,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/tests/lua-empty-test/project/proj.android-studio/app/build.gradle b/tests/lua-empty-test/project/proj.android-studio/app/build.gradle index 4ceac41ff7..435655ffc6 100644 --- a/tests/lua-empty-test/project/proj.android-studio/app/build.gradle +++ b/tests/lua-empty-test/project/proj.android-studio/app/build.gradle @@ -21,10 +21,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/build.gradle b/tests/lua-game-controller-test/project/proj.android-studio/app/build.gradle index cd6ebd5ebd..640473072a 100644 --- a/tests/lua-game-controller-test/project/proj.android-studio/app/build.gradle +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/build.gradle @@ -20,10 +20,25 @@ android { assets.srcDir "assets" } + 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 + } } } } diff --git a/tests/lua-tests/project/proj.android-studio/app/build.gradle b/tests/lua-tests/project/proj.android-studio/app/build.gradle index b6512722bf..0edc27697a 100644 --- a/tests/lua-tests/project/proj.android-studio/app/build.gradle +++ b/tests/lua-tests/project/proj.android-studio/app/build.gradle @@ -21,10 +21,25 @@ android { assets.srcDir "assets" } + 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 + } } } } From 3298145eb58b3c0f776278aa636058e2b328f5d6 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Mon, 25 May 2015 16:53:36 +0800 Subject: [PATCH 6/6] Support build & run Android Studio project in console. --- templates/cpp-template-default/cocos-project-template.json | 3 ++- .../proj.android-studio/app/AndroidManifest.xml | 2 +- templates/js-template-default/cocos-project-template.json | 3 ++- .../runtime-src/proj.android-studio/app/AndroidManifest.xml | 2 +- templates/lua-template-default/cocos-project-template.json | 3 ++- .../runtime-src/proj.android-studio/app/AndroidManifest.xml | 2 +- templates/lua-template-runtime/cocos-project-template.json | 3 ++- tests/cpp-tests/proj.android-studio/app/jni/Android.mk | 1 + tests/js-tests/project/proj.android-studio/build-cfg.json | 5 ++++- tests/js-tests/project/proj.android/build-cfg.json | 5 ++++- tools/cocos2d-console | 2 +- 11 files changed, 21 insertions(+), 10 deletions(-) diff --git a/templates/cpp-template-default/cocos-project-template.json b/templates/cpp-template-default/cocos-project-template.json index 966a45740b..37da10163d 100644 --- a/templates/cpp-template-default/cocos-project-template.json +++ b/templates/cpp-template-default/cocos-project-template.json @@ -53,7 +53,8 @@ "src_package_name":"org.cocos2dx.hellocpp", "files":[ "proj.android/AndroidManifest.xml", - "proj.android-studio/app/build.gradle" + "proj.android-studio/app/build.gradle", + "proj.android-studio/app/AndroidManifest.xml" ] }, "project_replace_mac_bundleid": { diff --git a/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml b/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml index 2bc0113bdd..57ed2fb242 100644 --- a/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml +++ b/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml @@ -14,7 +14,7 @@ android:value="cocos2dcpp" />