diff --git a/CMakeLists.txt b/CMakeLists.txt index ad714cade5..3e84e84e42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,19 +55,20 @@ add_subdirectory(${ADXE_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) set(BUILD_ENGINE_DONE ON) if(BUILD_TESTS) - # add cpp tests default + # add cpp-template-default into project(Cocos2d-x) for tmp test + add_subdirectory(${ADXE_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp) + + # add cpp tests default add_subdirectory(${ADXE_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests) - add_subdirectory(${ADXE_ROOT_PATH}/tests/cpp-empty-test ${ENGINE_BINARY_PATH}/tests/cpp-empty-test) + # add fairygui tests when fairygui extension is enabled if(BUILD_EXTENSION_FAIRYGUI) add_subdirectory(${ADXE_ROOT_PATH}/tests/fairygui-tests ${ENGINE_BINARY_PATH}/tests/fairygui-tests) endif() if(BUILD_LUA_LIBS) - add_subdirectory(${ADXE_ROOT_PATH}/tests/lua-empty-test/project ${ENGINE_BINARY_PATH}/tests/lua-empty-test) + add_subdirectory(${ADXE_ROOT_PATH}/templates/lua-template-default ${ENGINE_BINARY_PATH}/tests/HelloLua) add_subdirectory(${ADXE_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test) endif(BUILD_LUA_LIBS) - # add cpp-template-default into project(Cocos2d-x) for tmp test - add_subdirectory(${ADXE_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp) endif() diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index 33c8f4f263..4e7a794660 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -1,8 +1,8 @@ #/**************************************************************************** # Copyright (c) 2013-2014 cocos2d-x.org -# Copyright (c) 2015-2017 Chukong Technologies Inc. +# Copyright (c) 2021 Bytedance Inc. # -# http://www.cocos2d-x.org +# https://adxe.org # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/templates/cpp-template-default/Classes/AppDelegate.cpp b/templates/cpp-template-default/Classes/AppDelegate.cpp index 00d169397c..bf4a965728 100644 --- a/templates/cpp-template-default/Classes/AppDelegate.cpp +++ b/templates/cpp-template-default/Classes/AppDelegate.cpp @@ -1,7 +1,8 @@ /**************************************************************************** Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org + Copyright (c) 2021 Bytedance Inc. + + https://adxe.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -25,16 +26,15 @@ #include "AppDelegate.h" #include "HelloWorldScene.h" -// #define USE_AUDIO_ENGINE 1 +#define USE_AUDIO_ENGINE 1 #if USE_AUDIO_ENGINE #include "audio/include/AudioEngine.h" -using namespace cocos2d::experimental; #endif USING_NS_CC; -static cocos2d::Size designResolutionSize = cocos2d::Size(480, 320); +static cocos2d::Size designResolutionSize = cocos2d::Size(1280, 720); static cocos2d::Size smallResolutionSize = cocos2d::Size(480, 320); static cocos2d::Size mediumResolutionSize = cocos2d::Size(1024, 768); static cocos2d::Size largeResolutionSize = cocos2d::Size(2048, 1536); diff --git a/templates/cpp-template-default/Classes/AppDelegate.h b/templates/cpp-template-default/Classes/AppDelegate.h index ec7f9a6137..41d860f5de 100644 --- a/templates/cpp-template-default/Classes/AppDelegate.h +++ b/templates/cpp-template-default/Classes/AppDelegate.h @@ -1,7 +1,8 @@ /**************************************************************************** Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org + Copyright (c) 2021 Bytedance Inc. + + https://adxe.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -38,26 +39,26 @@ public: AppDelegate(); virtual ~AppDelegate(); - virtual void initGLContextAttrs(); + void initGLContextAttrs() override; /** @brief Implement Director and Scene init code here. @return true Initialize success, app continue. @return false Initialize failed, app terminate. */ - virtual bool applicationDidFinishLaunching(); + bool applicationDidFinishLaunching() override; /** @brief Called when the application moves to the background @param the pointer of the application */ - virtual void applicationDidEnterBackground(); + void applicationDidEnterBackground() override; /** @brief Called when the application reenters the foreground @param the pointer of the application */ - virtual void applicationWillEnterForeground(); + void applicationWillEnterForeground() override; }; #endif // _APP_DELEGATE_H_ diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.cpp b/templates/cpp-template-default/Classes/HelloWorldScene.cpp index 0169bf96f6..23fc12e4ca 100644 --- a/templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -1,18 +1,19 @@ /**************************************************************************** Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - + Copyright (c) 2021 Bytedance Inc. + + https://adxe.org + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -30,7 +31,9 @@ USING_NS_CC; static void problemLoading(const char* filename) { printf("Error while loading: %s\n", filename); - printf("Depending on how you compiled you might have to add 'Resources/' in front of filenames in HelloWorldScene.cpp\n"); + printf( + "Depending on how you compiled you might have to add 'Resources/' in front of filenames in " + "HelloWorldScene.cpp\n"); } // on "init" you need to initialize your instance @@ -38,35 +41,31 @@ bool HelloWorld::init() { ////////////////////////////// // 1. super init first - if ( !Scene::init() ) + if (!Scene::init()) { return false; } auto visibleSize = Director::getInstance()->getVisibleSize(); - Vec2 origin = Director::getInstance()->getVisibleOrigin(); + auto origin = Director::getInstance()->getVisibleOrigin(); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program // you may modify it. // add a "close" icon to exit the progress. it's an autorelease object - auto closeItem = MenuItemImage::create( - "CloseNormal.png", - "CloseSelected.png", + auto closeItem = MenuItemImage::create("CloseNormal.png", "CloseSelected.png", CC_CALLBACK_1(HelloWorld::menuCloseCallback, this)); - if (closeItem == nullptr || - closeItem->getContentSize().width <= 0 || - closeItem->getContentSize().height <= 0) + if (closeItem == nullptr || closeItem->getContentSize().width <= 0 || closeItem->getContentSize().height <= 0) { problemLoading("'CloseNormal.png' and 'CloseSelected.png'"); } else { - float x = origin.x + visibleSize.width - closeItem->getContentSize().width/2; - float y = origin.y + closeItem->getContentSize().height/2; - closeItem->setPosition(Vec2(x,y)); + float x = origin.x + visibleSize.width - closeItem->getContentSize().width / 2; + float y = origin.y + closeItem->getContentSize().height / 2; + closeItem->setPosition(Vec2(x, y)); } // create menu, it's an autorelease object @@ -88,8 +87,8 @@ bool HelloWorld::init() else { // position the label on the center of the screen - label->setPosition(Vec2(origin.x + visibleSize.width/2, - origin.y + visibleSize.height - label->getContentSize().height)); + label->setPosition( + Vec2(origin.x + visibleSize.width / 2, origin.y + visibleSize.height - label->getContentSize().height)); // add the label as a child to this layer this->addChild(label, 1); @@ -104,24 +103,30 @@ bool HelloWorld::init() else { // position the sprite on the center of the screen - sprite->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); + sprite->setPosition(Vec2(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y)); // add the sprite as a child to this layer this->addChild(sprite, 0); + auto drawNode = DrawNode::create(); + drawNode->setPosition(Vec2(0, 0)); + addChild(drawNode); + + auto safeArea = Director::getInstance()->getSafeAreaRect(); + drawNode->drawRect(safeArea.origin, safeArea.origin + safeArea.size, Color4F::BLUE); } + return true; } - -void HelloWorld::menuCloseCallback(Ref* pSender) +void HelloWorld::menuCloseCallback(Ref* sender) { - //Close the cocos2d-x game scene and quit the application + // Close the cocos2d-x game scene and quit the application Director::getInstance()->end(); - /*To navigate back to native iOS screen(if present) without quitting the application ,do not use Director::getInstance()->end() as given above,instead trigger a custom event created in RootViewController.mm as below*/ + /*To navigate back to native iOS screen(if present) without quitting the application ,do not use + * Director::getInstance()->end() as given above,instead trigger a custom event created in RootViewController.mm + * as below*/ - //EventCustom customEndEvent("game_scene_close_event"); + // EventCustom customEndEvent("game_scene_close_event"); //_eventDispatcher->dispatchEvent(&customEndEvent); - - } diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.h b/templates/cpp-template-default/Classes/HelloWorldScene.h index 2a0c4b6e80..c77c79b593 100644 --- a/templates/cpp-template-default/Classes/HelloWorldScene.h +++ b/templates/cpp-template-default/Classes/HelloWorldScene.h @@ -1,7 +1,8 @@ /**************************************************************************** Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org + Copyright (c) 2021 Bytedance Inc. + + https://adxe.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -30,10 +31,10 @@ class HelloWorld : public cocos2d::Scene { public: - virtual bool init(); - + virtual bool init() override; + // a selector callback - void menuCloseCallback(cocos2d::Ref* pSender); + void menuCloseCallback(Ref* sender); }; #endif // __HELLOWORLD_SCENE_H__ diff --git a/templates/lua-template-default/CMakeLists.txt b/templates/lua-template-default/CMakeLists.txt index 4f95733fa9..8fd8318158 100644 --- a/templates/lua-template-default/CMakeLists.txt +++ b/templates/lua-template-default/CMakeLists.txt @@ -1,7 +1,8 @@ #/**************************************************************************** # Copyright (c) 2013-2014 cocos2d-x.org +# Copyright (c) 2021 Bytedance Inc. # -# http://www.cocos2d-x.org +# https://adxe.org # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -27,28 +28,30 @@ set(APP_NAME HelloLua) project(${APP_NAME}) -set(ADXE_ROOT "$ENV{ADXE_ROOT}") +if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloLua into root project + if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) + endif() -if(XCODE) - set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) -endif() + set(ADXE_ROOT "$ENV{ADXE_ROOT}") -if(NOT (ADXE_ROOT STREQUAL "")) - set(ADXE_ROOT_PATH "${ADXE_ROOT}") - file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH}) - message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}") -else() - message(FATAL_ERROR "Please run setup.py add system env var 'ADXE_ROOT' to specific the engine root") + if(NOT (ADXE_ROOT STREQUAL "")) + set(ADXE_ROOT_PATH "${ADXE_ROOT}") + file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH}) + message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}") + else() + message(FATAL_ERROR "Please run setup.py add system env var 'ADXE_ROOT' to specific the engine root") + endif() + + set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/) + + include(CocosBuildSet) + set(BUILD_LUA_LIBS ON) + add_subdirectory(${ADXE_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) endif() set(RUNTIME_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/runtime-src) -set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/) - -include(CocosBuildSet) -set(BUILD_LUA_LIBS ON) -add_subdirectory(${ADXE_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) - # script and source files info, not need to compile set(res_res_folders "${CMAKE_CURRENT_SOURCE_DIR}/res" @@ -56,9 +59,13 @@ set(res_res_folders set(res_src_folders "${CMAKE_CURRENT_SOURCE_DIR}/src" ) +set(res_script_folders + "${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings/script" + ) if(APPLE OR VS) cocos_mark_multi_resources(res_res RES_TO "Resources/res" FOLDERS ${res_res_folders}) cocos_mark_multi_resources(res_src RES_TO "Resources/src" FOLDERS ${res_src_folders}) + cocos_mark_multi_resources(res_script RES_TO "Resources/src/cocos" FOLDERS ${res_script_folders}) set(cc_common_res ${res_res} ${res_src} ${res_script}) endif() @@ -160,4 +167,5 @@ if(LINUX OR WINDOWS) cocos_get_resource_path(APP_RES_DIR ${APP_NAME}) cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) cocos_copy_lua_scripts(${APP_NAME} ${res_src_folders} ${APP_RES_DIR}/src ) + cocos_copy_lua_scripts(${APP_NAME} ${res_script_folders} ${APP_RES_DIR}/src/cocos) endif() diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp index 8065744396..2654da41d8 100644 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -1,7 +1,8 @@ /**************************************************************************** Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org + Copyright (c) 2021 Bytedance Inc. + + https://adxe.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -27,11 +28,10 @@ #include "cocos2d.h" #include "scripting/lua-bindings/manual/lua_module_register.h" -// #define USE_AUDIO_ENGINE 1 +#define USE_AUDIO_ENGINE 1 #if USE_AUDIO_ENGINE #include "audio/include/AudioEngine.h" -using namespace cocos2d::experimental; #endif USING_NS_CC; diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.h b/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.h index 57c03f0709..c5a12ae3d6 100644 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.h +++ b/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.h @@ -1,7 +1,8 @@ /**************************************************************************** Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org + Copyright (c) 2021 Bytedance Inc. + + https://adxe.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -37,24 +38,24 @@ public: AppDelegate(); virtual ~AppDelegate(); - virtual void initGLContextAttrs(); + void initGLContextAttrs() override; /** @brief Implement Director and Scene init code here. @return true Initialize success, app continue. @return false Initialize failed, app terminate. */ - virtual bool applicationDidFinishLaunching(); + bool applicationDidFinishLaunching() override; /** @brief Called when the application moves to the background @param the pointer of the application */ - virtual void applicationDidEnterBackground(); + void applicationDidEnterBackground() override; /** @brief Called when the application reenters the foreground @param the pointer of the application */ - virtual void applicationWillEnterForeground(); + void applicationWillEnterForeground() override; }; \ No newline at end of file diff --git a/tests/cpp-empty-test/.adxeproj.json b/tests/cpp-empty-test/.adxeproj.json deleted file mode 100644 index 45f67f80c9..0000000000 --- a/tests/cpp-empty-test/.adxeproj.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "win32_cfg": { - "project_name": "cpp-empty-test", - "project_path": "proj.win32" - }, - "linux_cfg": { - "project_path": "proj.linux", - "project_name": "cpp-empty-test" - }, - "ios_cfg": { - "project_path": "proj.ios", - "project_name": "cpp-empty-test" - }, - "project_type": "cpp", - "mac_cfg": { - "project_path": "proj.mac", - "project_name": "cpp-empty-test" - }, - "android_cfg": { - "project_path": "proj.android", - "studio_proj_path" : "proj.android-studio" - }, - "engine_dir": "../../" -} diff --git a/tests/cpp-empty-test/CMakeLists.txt b/tests/cpp-empty-test/CMakeLists.txt deleted file mode 100644 index 76ef6fe773..0000000000 --- a/tests/cpp-empty-test/CMakeLists.txt +++ /dev/null @@ -1,161 +0,0 @@ -#/**************************************************************************** -# Copyright (c) 2015-2017 Chukong Technologies Inc. - -# http://www.cocos2d-x.org -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ****************************************************************************/ -cmake_minimum_required(VERSION 3.10) - -set(APP_NAME cpp-empty-test) - -project(${APP_NAME}) - -if(NOT DEFINED BUILD_ENGINE_DONE) - if(XCODE) - set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) - endif() - - set(ADXE_ROOT "$ENV{ADXE_ROOT}") - if(NOT (ADXE_ROOT STREQUAL "")) - set(ADXE_ROOT_PATH "${ADXE_ROOT}") - file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH}) - message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}") - else() - set(ADXE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..) - endif() - - set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/) - - include(CocosBuildSet) - add_subdirectory(${ADXE_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) -endif() - -# record sources, headers, resources... -set(GAME_SOURCE) -set(GAME_HEADER) - -set(GAME_RES_FOLDER - "${CMAKE_CURRENT_SOURCE_DIR}/Resources" - ) -if(APPLE OR VS) - cocos_mark_multi_resources(cc_common_res RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER}) -endif() - -list(APPEND GAME_HEADER - Classes/AppMacros.h - Classes/HelloWorldScene.h - Classes/AppDelegate.h - ) -list(APPEND GAME_SOURCE - Classes/AppDelegate.cpp - Classes/HelloWorldScene.cpp - ) - -if(ANDROID) - # change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml - set(APP_NAME cpp_empty_test) - list(APPEND GAME_SOURCE - proj.android/app/jni/main.cpp - ) -elseif(LINUX) - list(APPEND GAME_SOURCE - proj.linux/main.cpp - ) -elseif(WINDOWS) - list(APPEND GAME_HEADER - proj.win32/main.h - ) - list(APPEND GAME_SOURCE - proj.win32/main.cpp - ${cc_common_res} - ) -elseif(APPLE) - if(IOS) - list(APPEND GAME_HEADER - proj.ios/AppController.h - proj.ios/RootViewController.h - ) - set(APP_UI_RES - proj.ios/LaunchScreen.storyboard - proj.ios/LaunchScreenBackground.png - proj.ios/Images.xcassets - ) - list(APPEND GAME_SOURCE - proj.ios/main.m - proj.ios/AppController.mm - proj.ios/RootViewController.mm - ${APP_UI_RES} - ) - elseif(MACOSX) - set(APP_UI_RES - proj.mac/Icon.icns - proj.mac/Info.plist - proj.mac/en.lproj/InfoPlist.strings - ) - list(APPEND GAME_SOURCE - proj.mac/main.cpp - ${APP_UI_RES} - ) - endif() - list(APPEND GAME_SOURCE ${cc_common_res}) -endif() - -set(all_code_files - ${GAME_HEADER} - ${GAME_SOURCE} - ) - -# mark app complie info -if(NOT ANDROID) - add_executable(${APP_NAME} ${all_code_files}) -else() - add_library(${APP_NAME} SHARED ${all_code_files}) - add_subdirectory(${ADXE_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform) - target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive) - - config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src") -endif() - -target_link_libraries(${APP_NAME} ${ADXE_CORE_LIB}) - -target_include_directories(${APP_NAME} PRIVATE Classes) - -setup_cocos_app_config(${APP_NAME}) -if(XCODE) - set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}") - set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)") - set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.cpp-empty-test") - if(MACOSX) - set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist") - elseif(IOS) - set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/Info.plist") - set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") - endif() - - # For code-signing, set the DEVELOPMENT_TEAM: - #set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "GRLXXXX2K9") -elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME}) -endif() - -if(LINUX OR WINDOWS) - cocos_get_resource_path(APP_RES_DIR ${APP_NAME}) - cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) -endif() diff --git a/tests/cpp-empty-test/Classes/AppDelegate.cpp b/tests/cpp-empty-test/Classes/AppDelegate.cpp deleted file mode 100644 index 5c10b5c62e..0000000000 --- a/tests/cpp-empty-test/Classes/AppDelegate.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "AppDelegate.h" - -#include -#include - -#include "HelloWorldScene.h" -#include "AppMacros.h" - -//Uncomment the following line to use localize manager -//#include "extensions/cocostudio/LocalizationManager.h" - -USING_NS_CC; -using namespace std; - -AppDelegate::AppDelegate() -{ - -} - -AppDelegate::~AppDelegate() -{ -} - -void AppDelegate::initGLContextAttrs() -{ - GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8, 0}; - - GLView::setGLContextAttrs(glContextAttrs); -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // Initialize director - auto director = Director::getInstance(); - auto glview = director->getOpenGLView(); - if(!glview) { - glview = GLViewImpl::create("Cpp Empty Test"); - director->setOpenGLView(glview); - } - - // Set window icon with best resolution (windows and linux) - #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) - // assert error when using listFilesRecursively on Windows 10 - // refer to: https://github.com/cocos2d/cocos2d-x/issues/18835 - // don't use listFiles as workaround (it will return directory itself) - // refer to: https://github.com/cocos2d/cocos2d-x/issues/18834 - std::vector icons; - FileUtils::getInstance()->listFilesRecursively("icons", &icons); - #else - std::string icons = "icons/Icon-60@3x.png"; - #endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ - glview->setIcon(icons); - - director->setOpenGLView(glview); - - // Set the design resolution - glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER); - - auto frameSize = glview->getFrameSize(); - - vector searchPath; - - // In this demo, we select resource according to the frame's height. - // If the resource size is different from design resolution size, you need to set contentScaleFactor. - // We use the ratio of resource's height to the height of design resolution, - // This can make sure that the resource's height could fit for the height of design resolution. - - // If the frame's height is larger than the height of medium resource size, select large resource. - if (frameSize.height > mediumResource.size.height) - { - searchPath.push_back(largeResource.directory); - - director->setContentScaleFactor(MIN(largeResource.size.height/designResolutionSize.height, largeResource.size.width/designResolutionSize.width)); - } - // If the frame's height is larger than the height of small resource size, select medium resource. - else if (frameSize.height > smallResource.size.height) - { - searchPath.push_back(mediumResource.directory); - - director->setContentScaleFactor(MIN(mediumResource.size.height/designResolutionSize.height, mediumResource.size.width/designResolutionSize.width)); - } - // If the frame's height is smaller than the height of medium resource size, select small resource. - else - { - searchPath.push_back(smallResource.directory); - - director->setContentScaleFactor(MIN(smallResource.size.height/designResolutionSize.height, smallResource.size.width/designResolutionSize.width)); - } - - // Set searching path - FileUtils::getInstance()->setSearchPaths(searchPath); - - // Uncomment follow block to use localize manager to set localize strings - - // If you want to load json localize data, use follow block - /* - cocostudio::ILocalizationManager * lm = cocostudio::JsonLocalizationManager::getInstance(); - lm->initLanguageData("your localize file name.lang.json"); - cocostudio::LocalizationHelper::setCurrentManager(lm, false); - */ - - // If you want to load binary localize data, use follow block - /* - cocostudio::ILocalizationManager * lm = cocostudio::BinLocalizationManager::getInstance(); - lm->initLanguageData("your localize file name.lang.csb"); - cocostudio::LocalizationHelper::setCurrentManager(lm, true); - */ - - // to enable VR, uncomment the following lines -// auto vrImpl = new VRGenericRenderer; -// glview->setVR(vrImpl); - - // Turn on display FPS - director->setDisplayStats(true); - - // Set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0f / 60); - - // Create a scene. it's an autorelease object - auto scene = utils::createInstance(); - - // Run - director->runWithScene(scene); - - return true; -} - -// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - - // If you use SimpleAudioEngine, it must be paused - // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); -} - -// This function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() { - Director::getInstance()->startAnimation(); - - // If you use SimpleAudioEngine, it must resume here - // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); -} diff --git a/tests/cpp-empty-test/Classes/AppDelegate.h b/tests/cpp-empty-test/Classes/AppDelegate.h deleted file mode 100644 index bce02d3cfd..0000000000 --- a/tests/cpp-empty-test/Classes/AppDelegate.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "cocos2d.h" - -/** -@brief The cocos2d Application. - -Private inheritance here hides part of interface from Director. -*/ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - virtual void initGLContextAttrs(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief Called when the application moves to the background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief Called when the application reenters the foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/tests/cpp-empty-test/Classes/AppMacros.h b/tests/cpp-empty-test/Classes/AppMacros.h deleted file mode 100644 index 57a96c4f44..0000000000 --- a/tests/cpp-empty-test/Classes/AppMacros.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __APPMACROS_H__ -#define __APPMACROS_H__ - -#include "cocos2d.h" - -/* For demonstrating using one design resolution to match different resources, - or one resource to match different design resolutions. - - [Situation 1] Using one design resolution to match different resources. - Please look into Appdelegate::applicationDidFinishLaunching. - We check current device frame size to decide which resource need to be selected. - So if you want to test this situation which said in title '[Situation 1]', - you should change ios simulator to different device(e.g. iphone, iphone-retina3.5, iphone-retina4.0, ipad, ipad-retina), - or change the window size in "proj.XXX/main.cpp" by "CCEGLView::setFrameSize" if you are using win32 or linux platform - and modify "proj.mac/AppController.mm" by changing the window rectangle. - - [Situation 2] Using one resource to match different design resolutions. - The coordinates in your codes is based on your current design resolution rather than resource size. - Therefore, your design resolution could be very large and your resource size could be small. - To test this, just define the marco 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536' - and open iphone simulator or create a window of 480x320 size. - - [Note] Normally, developer just need to define one design resolution(e.g. 960x640) with one or more resources. - */ - -#define DESIGN_RESOLUTION_480X320 0 -#define DESIGN_RESOLUTION_1024X768 1 -#define DESIGN_RESOLUTION_2048X1536 2 - -/* If you want to switch design resolution, change next line */ -#define TARGET_DESIGN_RESOLUTION_SIZE DESIGN_RESOLUTION_480X320 - -typedef struct tagResource -{ - cocos2d::Size size; - char directory[100]; -}Resource; - -static Resource smallResource = { cocos2d::Size(480, 320), "iphone" }; -static Resource mediumResource = { cocos2d::Size(1024, 768), "ipad" }; -static Resource largeResource = { cocos2d::Size(2048, 1536), "ipadhd" }; - -#if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320) -static cocos2d::Size designResolutionSize = cocos2d::Size(480, 320); -#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1024X768) -static cocos2d::Size designResolutionSize = cocos2d::Size(1024, 768); -#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_2048X1536) -static cocos2d::Size designResolutionSize = cocos2d::Size(2048, 1536); -#else -#error unknown target design resolution! -#endif - -// The font size 24 is designed for small resolution, so we should change it to fit for current design resolution -#define TITLE_FONT_SIZE (cocos2d::Director::getInstance()->getOpenGLView()->getDesignResolutionSize().width / smallResource.size.width * 24) - -#endif /* __APPMACROS_H__ */ diff --git a/tests/cpp-empty-test/Classes/HelloWorldScene.cpp b/tests/cpp-empty-test/Classes/HelloWorldScene.cpp deleted file mode 100644 index 562a5b677a..0000000000 --- a/tests/cpp-empty-test/Classes/HelloWorldScene.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "HelloWorldScene.h" -#include "AppMacros.h" - -USING_NS_CC; - -// on "init" you need to initialize your instance -bool HelloWorld::init() -{ - ////////////////////////////// - // 1. super init first - if ( !Scene::init() ) - { - return false; - } - - auto visibleSize = Director::getInstance()->getVisibleSize(); - auto origin = Director::getInstance()->getVisibleOrigin(); - - ///////////////////////////// - // 2. add a menu item with "X" image, which is clicked to quit the program - // you may modify it. - - // add a "close" icon to exit the progress. it's an autorelease object - auto closeItem = MenuItemImage::create( - "CloseNormal.png", - "CloseSelected.png", - CC_CALLBACK_1(HelloWorld::menuCloseCallback,this)); - - closeItem->setPosition(origin + Vec2(visibleSize) - Vec2(closeItem->getContentSize() / 2)); - - // create menu, it's an autorelease object - auto menu = Menu::create(closeItem, nullptr); - menu->setPosition(Vec2::ZERO); - this->addChild(menu, 1); - - ///////////////////////////// - // 3. add your codes below... - - // add a label shows "Hello World" - // create and initialize a label - - auto label = Label::createWithTTF("Hello World", "fonts/arial.ttf", TITLE_FONT_SIZE); - - // position the label on the center of the screen - label->setPosition(origin.x + visibleSize.width/2, - origin.y + visibleSize.height - label->getContentSize().height); - - // add the label as a child to this layer - this->addChild(label, 1); - - // add "HelloWorld" splash screen" - auto sprite = Sprite::create("HelloWorld.png"); - - // position the sprite on the center of the screen - sprite->setPosition(Vec2(visibleSize / 2) + origin); - - // add the sprite as a child to this layer - this->addChild(sprite); - - auto drawNode = DrawNode::create(); - drawNode->setPosition(Vec2(0, 0)); - addChild(drawNode); - - auto safeArea = Director::getInstance()->getSafeAreaRect(); - drawNode->drawRect(safeArea.origin, safeArea.origin + safeArea.size, Color4F::BLUE); - - return true; -} - -void HelloWorld::menuCloseCallback(Ref* sender) -{ - Director::getInstance()->end(); -} diff --git a/tests/cpp-empty-test/Classes/HelloWorldScene.h b/tests/cpp-empty-test/Classes/HelloWorldScene.h deleted file mode 100644 index 6a05385963..0000000000 --- a/tests/cpp-empty-test/Classes/HelloWorldScene.h +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __HELLOWORLD_SCENE_H__ -#define __HELLOWORLD_SCENE_H__ - -#include "cocos2d.h" - -class HelloWorld : public cocos2d::Scene -{ -public: - virtual bool init() override; - - // a selector callback - void menuCloseCallback(Ref* sender); -}; - -#endif // __HELLOWORLD_SCENE_H__ diff --git a/tests/cpp-empty-test/Resources/.gitignore b/tests/cpp-empty-test/Resources/.gitignore deleted file mode 100644 index 1d65afe366..0000000000 --- a/tests/cpp-empty-test/Resources/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#Do now ignore Marmalade icf files -!*.icf diff --git a/tests/cpp-empty-test/Resources/bang.png b/tests/cpp-empty-test/Resources/bang.png deleted file mode 100644 index a966d03612..0000000000 Binary files a/tests/cpp-empty-test/Resources/bang.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/fonts/Marker Felt.ttf b/tests/cpp-empty-test/Resources/fonts/Marker Felt.ttf deleted file mode 100644 index 3752ef3110..0000000000 Binary files a/tests/cpp-empty-test/Resources/fonts/Marker Felt.ttf and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/fonts/arial.ttf b/tests/cpp-empty-test/Resources/fonts/arial.ttf deleted file mode 100644 index abc899cd55..0000000000 Binary files a/tests/cpp-empty-test/Resources/fonts/arial.ttf and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-20.png b/tests/cpp-empty-test/Resources/icons/Icon-20.png deleted file mode 100644 index 8ead23e365..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-20.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-20@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-20@2x.png deleted file mode 100644 index 775685daca..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-20@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-20@3x.png b/tests/cpp-empty-test/Resources/icons/Icon-20@3x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-20@3x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-29.png b/tests/cpp-empty-test/Resources/icons/Icon-29.png deleted file mode 100644 index 0500184c86..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-29.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-29@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-29@2x.png deleted file mode 100644 index f0f8b7fe98..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-29@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-29@3x.png b/tests/cpp-empty-test/Resources/icons/Icon-29@3x.png deleted file mode 100644 index 5287e50a79..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-29@3x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-40.png b/tests/cpp-empty-test/Resources/icons/Icon-40.png deleted file mode 100644 index 775685daca..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-40.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-40@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-40@2x.png deleted file mode 100644 index d9c7ab446b..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-40@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-40@3x.png b/tests/cpp-empty-test/Resources/icons/Icon-40@3x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-40@3x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-50.png b/tests/cpp-empty-test/Resources/icons/Icon-50.png deleted file mode 100644 index ac381bc20e..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-50.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-50@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-50@2x.png deleted file mode 100644 index ef38d4500a..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-50@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-57.png b/tests/cpp-empty-test/Resources/icons/Icon-57.png deleted file mode 100644 index 4fcc6fddff..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-57.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-57@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-57@2x.png deleted file mode 100644 index c3807861ad..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-57@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-60@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-60@2x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-60@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-60@3x.png b/tests/cpp-empty-test/Resources/icons/Icon-60@3x.png deleted file mode 100644 index d4bc53132c..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-60@3x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-72.png b/tests/cpp-empty-test/Resources/icons/Icon-72.png deleted file mode 100644 index 2c573c8df4..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-72.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-72@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-72@2x.png deleted file mode 100644 index 1526615c02..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-72@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-76.png b/tests/cpp-empty-test/Resources/icons/Icon-76.png deleted file mode 100644 index 8a1fa1850c..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-76.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-76@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-76@2x.png deleted file mode 100644 index 8aa82506d0..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-76@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-83.5@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-83.5@2x.png deleted file mode 100644 index 6bf801d175..0000000000 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-83.5@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/ipad/CloseNormal.png b/tests/cpp-empty-test/Resources/ipad/CloseNormal.png deleted file mode 100644 index 70030ec75a..0000000000 Binary files a/tests/cpp-empty-test/Resources/ipad/CloseNormal.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/ipad/CloseSelected.png b/tests/cpp-empty-test/Resources/ipad/CloseSelected.png deleted file mode 100644 index 2227e6e175..0000000000 Binary files a/tests/cpp-empty-test/Resources/ipad/CloseSelected.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/ipad/HelloWorld.png b/tests/cpp-empty-test/Resources/ipad/HelloWorld.png deleted file mode 100644 index 52f4a6a300..0000000000 Binary files a/tests/cpp-empty-test/Resources/ipad/HelloWorld.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/ipad/grossini.png b/tests/cpp-empty-test/Resources/ipad/grossini.png deleted file mode 100644 index 679f03e4bf..0000000000 Binary files a/tests/cpp-empty-test/Resources/ipad/grossini.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/ipad/uv_checker_01.jpg b/tests/cpp-empty-test/Resources/ipad/uv_checker_01.jpg deleted file mode 100644 index 4459784f81..0000000000 Binary files a/tests/cpp-empty-test/Resources/ipad/uv_checker_01.jpg and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/ipadhd/CloseNormal.png b/tests/cpp-empty-test/Resources/ipadhd/CloseNormal.png deleted file mode 100644 index bee9c18843..0000000000 Binary files a/tests/cpp-empty-test/Resources/ipadhd/CloseNormal.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/ipadhd/CloseSelected.png b/tests/cpp-empty-test/Resources/ipadhd/CloseSelected.png deleted file mode 100644 index 311603fed6..0000000000 Binary files a/tests/cpp-empty-test/Resources/ipadhd/CloseSelected.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/ipadhd/HelloWorld.png b/tests/cpp-empty-test/Resources/ipadhd/HelloWorld.png deleted file mode 100644 index 6775fb99f1..0000000000 Binary files a/tests/cpp-empty-test/Resources/ipadhd/HelloWorld.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/iphone/CloseNormal.png b/tests/cpp-empty-test/Resources/iphone/CloseNormal.png deleted file mode 100644 index a52fde01ea..0000000000 Binary files a/tests/cpp-empty-test/Resources/iphone/CloseNormal.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/iphone/CloseSelected.png b/tests/cpp-empty-test/Resources/iphone/CloseSelected.png deleted file mode 100644 index c6527a903f..0000000000 Binary files a/tests/cpp-empty-test/Resources/iphone/CloseSelected.png and /dev/null differ diff --git a/tests/cpp-empty-test/Resources/iphone/HelloWorld.png b/tests/cpp-empty-test/Resources/iphone/HelloWorld.png deleted file mode 100644 index ccb48aad5e..0000000000 Binary files a/tests/cpp-empty-test/Resources/iphone/HelloWorld.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.android/.gitignore b/tests/cpp-empty-test/proj.android/.gitignore deleted file mode 100644 index 9c4de5825b..0000000000 --- a/tests/cpp-empty-test/proj.android/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures diff --git a/tests/cpp-empty-test/proj.android/app/.gitignore b/tests/cpp-empty-test/proj.android/app/.gitignore deleted file mode 100644 index 0886f94956..0000000000 --- a/tests/cpp-empty-test/proj.android/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build -/.externalNativeBuild diff --git a/tests/cpp-empty-test/proj.android/app/AndroidManifest.xml b/tests/cpp-empty-test/proj.android/app/AndroidManifest.xml deleted file mode 100644 index 9814b10580..0000000000 --- a/tests/cpp-empty-test/proj.android/app/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cpp-empty-test/proj.android/app/build.gradle b/tests/cpp-empty-test/proj.android/app/build.gradle deleted file mode 100644 index 0289b194c3..0000000000 --- a/tests/cpp-empty-test/proj.android/app/build.gradle +++ /dev/null @@ -1,115 +0,0 @@ -import org.gradle.internal.os.OperatingSystem -import java.nio.file.Paths -import java.nio.file.Files - -apply plugin: 'com.android.application' -apply from: project(':libcocos2dx').projectDir.toString() + "/adxetools.gradle" - -android { - compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger() - - // setup ndk - def ndkInfo = adxetools.findNDK("19.2.5345600+") - ndkVersion = ndkInfo[0] - if(ndkInfo[1]) { - ndkPath = ndkInfo[1] - } - - defaultConfig { - applicationId "org.cocos2dx.cpp_empty_test" - minSdkVersion PROP_MIN_SDK_VERSION - targetSdkVersion PROP_TARGET_SDK_VERSION - versionCode 1 - versionName "1.0" - - externalNativeBuild { - cmake { - targets "cpp_empty_test" - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", - "-DANDROID_ARM_NEON=TRUE" - cppFlags "-frtti -fexceptions -fsigned-char" - } - } - - ndk { - abiFilters = [] - abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String}) - } - } - - sourceSets.main { - java.srcDir "src" - res.srcDir "res" - manifest.srcFile "AndroidManifest.xml" - assets.srcDir "assets" - } - - externalNativeBuild { - cmake { - version "3.10.2" - path "../../CMakeLists.txt" - } - } - - 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 { - debuggable false - jniDebuggable false - renderscriptDebuggable false - minifyEnabled true - shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - if (project.hasProperty("RELEASE_STORE_FILE")) { - signingConfig signingConfigs.release - } - } - - debug { - debuggable true - jniDebuggable true - renderscriptDebuggable true - } - } -} - -android.applicationVariants.all { variant -> - - delete "${projectDir}/assets" - - def targetName = variant.name.capitalize() - def copyTaskName = "copy${targetName}ResourcesToAssets" - tasks.register(copyTaskName) { - copy { - from "${projectDir}/../../Resources" - into "${projectDir}/assets" - exclude "**/*.gz" - } - } - tasks.getByName("pre${targetName}Build").dependsOn copyTaskName -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':libcocos2dx') -} - -project.afterEvaluate { - if (tasks.findByName("externalNativeBuildDebug")) { - compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug - } - if (tasks.findByName("externalNativeBuildRelease")) { - compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease - } -} diff --git a/tests/cpp-empty-test/proj.android/app/jni/main.cpp b/tests/cpp-empty-test/proj.android/app/jni/main.cpp deleted file mode 100644 index 6cab47cbb3..0000000000 --- a/tests/cpp-empty-test/proj.android/app/jni/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include - -#include -#include - -#include "AppDelegate.h" - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -namespace { -std::unique_ptr appDelegate; -} - -void cocos_android_app_init(JNIEnv* env) { - LOGD("cocos_android_app_init"); - appDelegate.reset(new AppDelegate()); -} diff --git a/tests/cpp-empty-test/proj.android/app/proguard-rules.pro b/tests/cpp-empty-test/proj.android/app/proguard-rules.pro deleted file mode 100644 index c3d6dcccae..0000000000 --- a/tests/cpp-empty-test/proj.android/app/proguard-rules.pro +++ /dev/null @@ -1,38 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Proguard Cocos2d-x for release --keep public class org.cocos2dx.** { *; } --dontwarn org.cocos2dx.** --keep public class com.chukong.** { *; } --dontwarn com.chukong.** --keep public class com.huawei.android.** { *; } --dontwarn com.huawei.android.** - -# Proguard Apache HTTP for release --keep class org.apache.http.** { *; } --dontwarn org.apache.http.** - -# Proguard Android Webivew for release. uncomment if you are using a webview in cocos2d-x -#-keep public class android.net.http.SslError -#-keep public class android.webkit.WebViewClient - -#-dontwarn android.webkit.WebView -#-dontwarn android.net.http.SslError -#-dontwarn android.webkit.WebViewClient - diff --git a/tests/cpp-empty-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 45ee51d15f..0000000000 Binary files a/tests/cpp-empty-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 0dd2a60899..0000000000 Binary files a/tests/cpp-empty-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index a32f16f930..0000000000 Binary files a/tests/cpp-empty-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 332f268edc..0000000000 Binary files a/tests/cpp-empty-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.android/app/res/values/strings.xml b/tests/cpp-empty-test/proj.android/app/res/values/strings.xml deleted file mode 100644 index 35a12a294d..0000000000 --- a/tests/cpp-empty-test/proj.android/app/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - CppEmptyTest - diff --git a/tests/cpp-empty-test/proj.android/app/src/org/cocos2dx/cpp_empty_test/AppActivity.java b/tests/cpp-empty-test/proj.android/app/src/org/cocos2dx/cpp_empty_test/AppActivity.java deleted file mode 100644 index 2b66464e92..0000000000 --- a/tests/cpp-empty-test/proj.android/app/src/org/cocos2dx/cpp_empty_test/AppActivity.java +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -Copyright (c) 2015-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -package org.cocos2dx.cpp_empty_test; - -import android.os.Bundle; - -import org.cocos2dx.lib.Cocos2dxActivity; -import org.cocos2dx.lib.SharedLoader; - -public class AppActivity extends Cocos2dxActivity { - static { - // DNT remove, some android simulator require explicit load shared libraries, otherwise will crash - SharedLoader.load(); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.setEnableVirtualButton(false); - super.onCreate(savedInstanceState); - // Workaround in https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508 - if (!isTaskRoot()) { - // Android launched another instance of the root activity into an existing task - // so just quietly finish and go away, dropping the user back into the activity - // at the top of the stack (ie: the last state of this task) - // Don't need to finish it again since it's finished in super.onCreate . - return; - } - // DO OTHER INITIALIZATION BELOW - - } -} diff --git a/tests/cpp-empty-test/proj.android/build.gradle b/tests/cpp-empty-test/proj.android/build.gradle deleted file mode 100644 index 550730b1c8..0000000000 --- a/tests/cpp-empty-test/proj.android/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.2.0' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.android/gradle.properties b/tests/cpp-empty-test/proj.android/gradle.properties deleted file mode 100644 index 21f7abcca6..0000000000 --- a/tests/cpp-empty-test/proj.android/gradle.properties +++ /dev/null @@ -1,42 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -# Android SDK version that will be used as the compile project -PROP_COMPILE_SDK_VERSION=28 - -# Android SDK version that will be used as the earliest version of android this application can run on -PROP_MIN_SDK_VERSION=16 - -# Android SDK version that will be used as the latest version of android this application has been tested on -PROP_TARGET_SDK_VERSION=28 - - -# List of CPU Archtexture to build that application with -# Available architextures (armeabi-v7a | arm64-v8a | x86) -# To build for multiple architexture, use the `:` between them -# Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86 -PROP_APP_ABI=armeabi-v7a:arm64-v8a - -# uncomment it and fill in sign information for release mode -#RELEASE_STORE_FILE=file path of keystore -#RELEASE_STORE_PASSWORD=password of keystore -#RELEASE_KEY_ALIAS=alias of key -#RELEASE_KEY_PASSWORD=password of key - -android.injected.testOnly=false diff --git a/tests/cpp-empty-test/proj.android/gradle/wrapper/gradle-wrapper.jar b/tests/cpp-empty-test/proj.android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a86..0000000000 Binary files a/tests/cpp-empty-test/proj.android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/tests/cpp-empty-test/proj.android/gradle/wrapper/gradle-wrapper.properties b/tests/cpp-empty-test/proj.android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index fd17cfe19e..0000000000 --- a/tests/cpp-empty-test/proj.android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Tue Mar 14 17:40:59 CST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.android/gradlew b/tests/cpp-empty-test/proj.android/gradlew deleted file mode 100755 index 91a7e269e1..0000000000 --- a/tests/cpp-empty-test/proj.android/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/cpp-empty-test/proj.android/gradlew.bat b/tests/cpp-empty-test/proj.android/gradlew.bat deleted file mode 100644 index 8a0b282aa6..0000000000 --- a/tests/cpp-empty-test/proj.android/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/tests/cpp-empty-test/proj.android/settings.gradle b/tests/cpp-empty-test/proj.android/settings.gradle deleted file mode 100644 index d98eddc267..0000000000 --- a/tests/cpp-empty-test/proj.android/settings.gradle +++ /dev/null @@ -1,20 +0,0 @@ -import java.nio.file.Paths -import java.nio.file.Files - -def ENGINE_ROOT=Paths.get("${System.env.ADXE_ROOT}") -if(Files.exists(ENGINE_ROOT)) { - println("Determine ENGINE_JAVA_LIBPATH with system env var ADXE_ROOT") - ENGINE_ROOT = ENGINE_ROOT.toAbsolutePath().toString() -} -else { - println("Determine ENGINE_JAVA_LIBPATH with relative to settingsDir") - ENGINE_ROOT = settingsDir.getPath() + "/../../.." -} - -def ENGINE_JAVA_LIBPATH = ENGINE_ROOT + '/cocos/platform/android/libcocos2dx'; - -include ':libcocos2dx' -project(':libcocos2dx').projectDir = new File(ENGINE_JAVA_LIBPATH) -include ':CppEmptyTest' -project(':CppEmptyTest').projectDir = new File(settingsDir, 'app') -rootProject.name = "cpp-empty-test" \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.ios/AppController.h b/tests/cpp-empty-test/proj.ios/AppController.h deleted file mode 100644 index d7906fbfd9..0000000000 --- a/tests/cpp-empty-test/proj.ios/AppController.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/tests/cpp-empty-test/proj.ios/AppController.mm b/tests/cpp-empty-test/proj.ios/AppController.mm deleted file mode 100644 index 6f3e9d813c..0000000000 --- a/tests/cpp-empty-test/proj.ios/AppController.mm +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#import -#import "AppController.h" -#import "cocos2d.h" -#import "platform/ios/CCEAGLView-ios.h" -#import "../Classes/AppDelegate.h" -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - cocos2d::Application *app = cocos2d::Application::getInstance(); - app->initGLContextAttrs(); - cocos2d::GLViewImpl::convertAttrs(); - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - - CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: (NSString*)cocos2d::GLViewImpl::_pixelFormat - depthFormat: cocos2d::GLViewImpl::_depthFormat - preserveBackbuffer: NO - sharegroup: nil - multiSampling: cocos2d::GLViewImpl::_multisamplingCount > 0 ? YES : NO - numberOfSamples: cocos2d::GLViewImpl::_multisamplingCount]; - - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.extendedLayoutIncludesOpaqueBars = YES; - viewController.view = eaglView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - //Launching the app with the arguments -NSAllowsDefaultLineBreakStrategy NO to force back to the old behavior. - if ( [[UIDevice currentDevice].systemVersion floatValue] >= 13.0f) - { - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSAllowsDefaultLineBreakStrategy"]; - } - - // IMPORTANT: Setting the GLView should be done after creating the RootViewController - cocos2d::GLViewImpl *glview = cocos2d::GLViewImpl::createWithEAGLView(eaglView); - cocos2d::Director::getInstance()->setOpenGLView(glview); - - app->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Contents.json b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Contents.json deleted file mode 100644 index 51cbd32fe0..0000000000 --- a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Contents.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@3x.png", - "scale" : "3x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon-57.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon-57@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-20.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "Icon-50.png", - "scale" : "1x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "Icon-50@2x.png", - "scale" : "2x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "Icon-72.png", - "scale" : "1x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "Icon-72@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-83.5@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20.png deleted file mode 100644 index 8ead23e365..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@2x.png deleted file mode 100644 index 775685daca..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@3x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@3x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@3x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29.png deleted file mode 100644 index 0500184c86..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@2x.png deleted file mode 100644 index f0f8b7fe98..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@3x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@3x.png deleted file mode 100644 index 5287e50a79..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@3x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40.png deleted file mode 100644 index 775685daca..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@2x.png deleted file mode 100644 index d9c7ab446b..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@3x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@3x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@3x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50.png deleted file mode 100644 index ac381bc20e..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50@2x.png deleted file mode 100644 index ef38d4500a..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57.png deleted file mode 100644 index 4fcc6fddff..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57@2x.png deleted file mode 100644 index c3807861ad..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@2x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@3x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@3x.png deleted file mode 100644 index d4bc53132c..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72.png deleted file mode 100644 index 2c573c8df4..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72@2x.png deleted file mode 100644 index 1526615c02..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76.png deleted file mode 100644 index 8a1fa1850c..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76@2x.png deleted file mode 100644 index 8aa82506d0..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-83.5@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-83.5@2x.png deleted file mode 100644 index 6bf801d175..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-83.5@2x.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/Contents.json b/tests/cpp-empty-test/proj.ios/Images.xcassets/Contents.json deleted file mode 100644 index da4a164c91..0000000000 --- a/tests/cpp-empty-test/proj.ios/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.ios/Info.plist b/tests/cpp-empty-test/proj.ios/Info.plist deleted file mode 100644 index f979cc849b..0000000000 --- a/tests/cpp-empty-test/proj.ios/Info.plist +++ /dev/null @@ -1,55 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PROJECT_NAME} - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleIconFile - Icon-57.png - CFBundleIconFiles - - Icon.png - Icon@2x.png - Icon-57.png - Icon-114.png - Icon-72.png - Icon-144.png - - CFBundleIcons - - CFBundleIcons~ipad - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PROJECT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIPrerenderedIcon - - UIStatusBarHidden - - UISupportedInterfaceOrientations - - UIInterfaceOrientationLandscapeRight - - NSHumanReadableCopyright - Copyright © 2019. All rights reserved. - - diff --git a/tests/cpp-empty-test/proj.ios/LaunchScreen.storyboard b/tests/cpp-empty-test/proj.ios/LaunchScreen.storyboard deleted file mode 100644 index 068bbaa879..0000000000 --- a/tests/cpp-empty-test/proj.ios/LaunchScreen.storyboard +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cpp-empty-test/proj.ios/LaunchScreenBackground.png b/tests/cpp-empty-test/proj.ios/LaunchScreenBackground.png deleted file mode 100644 index dadccee686..0000000000 Binary files a/tests/cpp-empty-test/proj.ios/LaunchScreenBackground.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.ios/RootViewController.h b/tests/cpp-empty-test/proj.ios/RootViewController.h deleted file mode 100644 index 1c51096c57..0000000000 --- a/tests/cpp-empty-test/proj.ios/RootViewController.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/tests/cpp-empty-test/proj.ios/RootViewController.mm b/tests/cpp-empty-test/proj.ios/RootViewController.mm deleted file mode 100644 index 9032b65437..0000000000 --- a/tests/cpp-empty-test/proj.ios/RootViewController.mm +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6.0 and higher, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations -{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -// Controls the application's preferred home indicator auto-hiding when this view controller is shown. -- (BOOL)prefersHomeIndicatorAutoHidden { - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/tests/cpp-empty-test/proj.ios/exportoptions.plist b/tests/cpp-empty-test/proj.ios/exportoptions.plist deleted file mode 100644 index 14a6dc5c20..0000000000 --- a/tests/cpp-empty-test/proj.ios/exportoptions.plist +++ /dev/null @@ -1,15 +0,0 @@ - - - - - compileBitcode - - method - development - provisioningProfiles - - Bundle Identifier - Provision Prifile Name - - - diff --git a/tests/cpp-empty-test/proj.ios/main.m b/tests/cpp-empty-test/proj.ios/main.m deleted file mode 100644 index bd577a036e..0000000000 --- a/tests/cpp-empty-test/proj.ios/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// iphone -// -// Created by Walzer on 10-11-16. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/tests/cpp-empty-test/proj.linux/main.cpp b/tests/cpp-empty-test/proj.linux/main.cpp deleted file mode 100644 index 042c94fef6..0000000000 --- a/tests/cpp-empty-test/proj.linux/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - return Application::getInstance()->run(); -} diff --git a/tests/cpp-empty-test/proj.mac/Icon.icns b/tests/cpp-empty-test/proj.mac/Icon.icns deleted file mode 100644 index 3d09e8fb4f..0000000000 Binary files a/tests/cpp-empty-test/proj.mac/Icon.icns and /dev/null differ diff --git a/tests/cpp-empty-test/proj.mac/Info.plist b/tests/cpp-empty-test/proj.mac/Info.plist deleted file mode 100644 index 6feb2a81a1..0000000000 --- a/tests/cpp-empty-test/proj.mac/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleIconFile - Icon - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PROJECT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSHumanReadableCopyright - Copyright © 2019. All rights reserved. - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/tests/cpp-empty-test/proj.mac/en.lproj/InfoPlist.strings b/tests/cpp-empty-test/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/tests/cpp-empty-test/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/tests/cpp-empty-test/proj.mac/main.cpp b/tests/cpp-empty-test/proj.mac/main.cpp deleted file mode 100644 index 423552301a..0000000000 --- a/tests/cpp-empty-test/proj.mac/main.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "../Classes/AppDelegate.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - return Application::getInstance()->run(); -} - diff --git a/tests/cpp-empty-test/proj.win32/build-cfg.json b/tests/cpp-empty-test/proj.win32/build-cfg.json deleted file mode 100644 index aae4d7a054..0000000000 --- a/tests/cpp-empty-test/proj.win32/build-cfg.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "copy_resources": [ - { - "from": "../Resources", - "to": "" - } - ] -} diff --git a/tests/cpp-empty-test/proj.win32/main.cpp b/tests/cpp-empty-test/proj.win32/main.cpp deleted file mode 100644 index 14e13c921f..0000000000 --- a/tests/cpp-empty-test/proj.win32/main.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "main.h" -#include "../Classes/AppDelegate.h" - -USING_NS_CC; - -int WINAPI _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - - // create the application instance - AppDelegate app; - return Application::getInstance()->run(); -} diff --git a/tests/cpp-empty-test/proj.win32/main.h b/tests/cpp-empty-test/proj.win32/main.h deleted file mode 100644 index 13b6f36fd2..0000000000 --- a/tests/cpp-empty-test/proj.win32/main.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include -#include - -// C RunTime Header Files -#include "platform/CCStdC.h" - -#endif // __MAIN_H__ diff --git a/tests/lua-empty-test/.adxeproj.json b/tests/lua-empty-test/.adxeproj.json deleted file mode 100644 index fef1865f5f..0000000000 --- a/tests/lua-empty-test/.adxeproj.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "win32_cfg": { - "project_path": "project/proj.win32", - "project_name": "lua-empty-test", - "cmake_path": "project" - }, - "linux_cfg": { - "project_path": "project/proj.linux", - "project_name": "lua-empty-test", - "cmake_path": "project" - }, - "ios_cfg": { - "project_path": "project/proj.ios", - "project_name": "lua-empty-test", - "cmake_path": "project" - }, - "project_type": "lua", - "has_native": true, - "mac_cfg": { - "project_path": "project/proj.mac", - "project_name": "lua-empty-test", - "cmake_path": "project" - }, - "android_cfg": { - "project_path": "project/proj.android", - "studio_proj_path" : "project/proj.android-studio" - }, - "engine_dir": "../../" -} diff --git a/tests/lua-empty-test/project/CMakeLists.txt b/tests/lua-empty-test/project/CMakeLists.txt deleted file mode 100644 index ba51855684..0000000000 --- a/tests/lua-empty-test/project/CMakeLists.txt +++ /dev/null @@ -1,139 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -set(APP_NAME lua-empty-test) - -project(${APP_NAME}) - -if(NOT DEFINED BUILD_ENGINE_DONE) - if(XCODE) - set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) - endif() - - set(ADXE_ROOT "$ENV{ADXE_ROOT}") - if(NOT (ADXE_ROOT STREQUAL "")) - set(ADXE_ROOT_PATH "${ADXE_ROOT}") - file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH}) - message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}") - else() - set(ADXE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../..) - endif() - - set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/) - - include(CocosBuildSet) - set(BUILD_LUA_LIBS ON) - add_subdirectory(${ADXE_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) -endif() - -set(res_res_folders - "${CMAKE_CURRENT_SOURCE_DIR}/../res" - ) -set(res_src_folders - "${CMAKE_CURRENT_SOURCE_DIR}/../src" - ) -set(res_script_folders - "${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings/script" - ) -if(APPLE OR VS) - cocos_mark_multi_resources(res_res RES_TO "Resources/res" FOLDERS ${res_res_folders}) - cocos_mark_multi_resources(res_src RES_TO "Resources/src" FOLDERS ${res_src_folders}) - cocos_mark_multi_resources(res_script RES_TO "Resources/src/cocos" FOLDERS ${res_script_folders}) - set(cc_common_res ${res_res} ${res_src} ${res_script}) -endif() - -# record sources, headers... -set(GAME_SOURCE - Classes/AppDelegate.cpp - ) -set(GAME_HEADER - Classes/AppDelegate.h - ) - -if(ANDROID) - # change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml - set(APP_NAME lua_empty_test) - list(APPEND GAME_SOURCE proj.android/app/jni/main.cpp) -elseif(LINUX) - list(APPEND GAME_SOURCE proj.linux/main.cpp) -elseif(WINDOWS) - list(APPEND GAME_HEADER proj.win32/main.h) - list(APPEND GAME_SOURCE proj.win32/main.cpp ${cc_common_res}) -elseif(APPLE) - if(IOS) - list(APPEND GAME_HEADER - proj.ios/AppController.h - proj.ios/RootViewController.h - ) - set(APP_UI_RES - proj.ios/LaunchScreen.storyboard - proj.ios/LaunchScreenBackground.png - proj.ios/Images.xcassets - ) - list(APPEND GAME_SOURCE - proj.ios/main.m - proj.ios/AppController.mm - proj.ios/RootViewController.mm - proj.ios/HelloLua_Prefix.pch - ${APP_UI_RES} - ) - elseif(MACOSX) - set(APP_UI_RES - proj.mac/Icon.icns - proj.mac/Info.plist - proj.mac/en.lproj/InfoPlist.strings - ) - list(APPEND GAME_SOURCE - proj.mac/main.cpp - proj.mac/HelloLua_Prefix.pch - ${APP_UI_RES} - ) - endif() - list(APPEND GAME_SOURCE ${cc_common_res}) -endif() - -set(APP_SRC ${GAME_HEADER} ${GAME_SOURCE}) - -if(NOT ANDROID) - add_executable(${APP_NAME} ${APP_SRC}) -else() - add_library(${APP_NAME} SHARED ${APP_SRC}) - add_subdirectory(${ADXE_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/cpp-android) - target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive) - add_subdirectory(${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/cocos/lua-android) - target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive) - - config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src") -endif() - -target_link_libraries(${APP_NAME} ${ADXE_LUA_LIB}) -target_include_directories(${APP_NAME} PRIVATE Classes) - -# mark app resources -setup_cocos_app_config(${APP_NAME}) -if(APPLE) - set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}") - set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)") - set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.lua-empty-test") - - if(MACOSX) - set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist") - set_target_properties(${APP_NAME} PROPERTIES - LINK_FLAGS "-pagezero_size 10000 -image_base 100000000" - ) - elseif(IOS) - set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/Info.plist") - set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") - endif() - - # For code-signing, set the DEVELOPMENT_TEAM: - #set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "GRLXXXX2K9") -elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME}) -endif() - -if(LINUX OR WINDOWS) - cocos_get_resource_path(APP_RES_DIR ${APP_NAME}) - cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) - cocos_copy_lua_scripts(${APP_NAME} ${res_src_folders} ${APP_RES_DIR}/src ) - cocos_copy_lua_scripts(${APP_NAME} ${res_script_folders} ${APP_RES_DIR}/src/cocos) -endif() diff --git a/tests/lua-empty-test/project/Classes/AppDelegate.cpp b/tests/lua-empty-test/project/Classes/AppDelegate.cpp deleted file mode 100644 index b870014418..0000000000 --- a/tests/lua-empty-test/project/Classes/AppDelegate.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "cocos2d.h" -#include "AppDelegate.h" -#include "base/CCScriptSupport.h" -#include "scripting/lua-bindings/manual/CCLuaEngine.h" -#include "scripting/lua-bindings/manual/lua_module_register.h" - -USING_NS_CC; - -AppDelegate::AppDelegate() -{ - // fixed me - //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF); -} - -AppDelegate::~AppDelegate() -{ -} - -void AppDelegate::initGLContextAttrs() -{ - GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8, 0}; - - GLView::setGLContextAttrs(glContextAttrs); -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // register lua engine - LuaEngine* engine = LuaEngine::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(engine); - lua_State* L = engine->getLuaStack()->getLuaState(); - lua_module_register(L); - //The call was commented because it will lead to ZeroBrane Studio can't find correct context when debugging - //engine->executeScriptFile("src/hello.lua"); - -#if CC_64BITS - FileUtils::getInstance()->addSearchPath("src/64bit"); -#endif - FileUtils::getInstance()->addSearchPath("src"); - FileUtils::getInstance()->addSearchPath("res"); - engine->executeString("require 'hello.lua'"); - - return true; -} - -// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); -} diff --git a/tests/lua-empty-test/project/Classes/AppDelegate.h b/tests/lua-empty-test/project/Classes/AppDelegate.h deleted file mode 100644 index ce7b2e0032..0000000000 --- a/tests/lua-empty-test/project/Classes/AppDelegate.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "platform/CCApplication.h" - -/** -@brief The cocos2d Application. - -Private inheritance here hides part of interface from Director. -*/ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - virtual void initGLContextAttrs(); - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief Called when the application moves to the background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief Called when the application reenters the foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/tests/lua-empty-test/project/proj.android/.gitignore b/tests/lua-empty-test/project/proj.android/.gitignore deleted file mode 100644 index 9c4de5825b..0000000000 --- a/tests/lua-empty-test/project/proj.android/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures diff --git a/tests/lua-empty-test/project/proj.android/app/.gitignore b/tests/lua-empty-test/project/proj.android/app/.gitignore deleted file mode 100644 index 0886f94956..0000000000 --- a/tests/lua-empty-test/project/proj.android/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build -/.externalNativeBuild diff --git a/tests/lua-empty-test/project/proj.android/app/AndroidManifest.xml b/tests/lua-empty-test/project/proj.android/app/AndroidManifest.xml deleted file mode 100644 index 843c7b4124..0000000000 --- a/tests/lua-empty-test/project/proj.android/app/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/lua-empty-test/project/proj.android/app/build.gradle b/tests/lua-empty-test/project/proj.android/app/build.gradle deleted file mode 100644 index bd0ea6b7bb..0000000000 --- a/tests/lua-empty-test/project/proj.android/app/build.gradle +++ /dev/null @@ -1,122 +0,0 @@ -import org.gradle.internal.os.OperatingSystem; -import java.nio.file.Paths -import java.nio.file.Files - -apply plugin: 'com.android.application' -apply from: project(':libcocos2dx').projectDir.toString() + "/adxetools.gradle" - -android { - compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger() - - // setup ndk - def ndkInfo = adxetools.findNDK("19.2.5345600+") - ndkVersion = ndkInfo[0] - if(ndkInfo[1]) { - ndkPath = ndkInfo[1] - } - - defaultConfig { - applicationId "org.cocos2dx.lua_empty_test" - minSdkVersion PROP_MIN_SDK_VERSION - targetSdkVersion PROP_TARGET_SDK_VERSION - versionCode 1 - versionName "1.0" - - externalNativeBuild { - cmake { - targets "lua_empty_test" - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" - cppFlags "-frtti -fexceptions -fsigned-char" - } - } - - ndk { - abiFilters = [] - abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String}) - } - } - - sourceSets.main { - java.srcDir "src" - res.srcDir "res" - manifest.srcFile "AndroidManifest.xml" - assets.srcDir "assets" - } - - externalNativeBuild { - cmake { - version "3.10.2" - path "../../CMakeLists.txt" - } - } - - 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 { - debuggable false - jniDebuggable false - renderscriptDebuggable false - minifyEnabled true - shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - if (project.hasProperty("RELEASE_STORE_FILE")) { - signingConfig signingConfigs.release - } - } - - debug { - debuggable true - jniDebuggable true - renderscriptDebuggable true - } - } -} - -android.applicationVariants.all { variant -> - delete "${projectDir}/assets" - def targetName = variant.name.capitalize() - def copyTaskName = "copy${targetName}ResourcesToAssets" - - tasks.register(copyTaskName) { - copy { - from "${projectDir}/../../../res" - into "${projectDir}/assets/res" - } - - copy { - from "${projectDir}/../../../src" - into "${projectDir}/assets/src" - } - - copy { - from "${projectDir}/../../../../../extensions/scripting/lua-bindings/script" - into "${projectDir}/assets/src/cocos" - } - } - tasks.getByName("pre${targetName}Build").dependsOn copyTaskName -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':libcocos2dx') -} - -project.afterEvaluate { - if (tasks.findByName("externalNativeBuildDebug")) { - compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug - } - if (tasks.findByName("externalNativeBuildRelease")) { - compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease - } -} diff --git a/tests/lua-empty-test/project/proj.android/app/get_environment.sh b/tests/lua-empty-test/project/proj.android/app/get_environment.sh deleted file mode 100755 index 61ce03524c..0000000000 --- a/tests/lua-empty-test/project/proj.android/app/get_environment.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [ -f $HOME/.bashrc ]; then - source $HOME/.bashrc -fi - -if [ -f $HOME/.bash_profile ]; then - source $HOME/.bash_profile -fi - -echo $COCOS_CONSOLE_ROOT diff --git a/tests/lua-empty-test/project/proj.android/app/jni/main.cpp b/tests/lua-empty-test/project/proj.android/app/jni/main.cpp deleted file mode 100644 index 6cab47cbb3..0000000000 --- a/tests/lua-empty-test/project/proj.android/app/jni/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include - -#include -#include - -#include "AppDelegate.h" - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -namespace { -std::unique_ptr appDelegate; -} - -void cocos_android_app_init(JNIEnv* env) { - LOGD("cocos_android_app_init"); - appDelegate.reset(new AppDelegate()); -} diff --git a/tests/lua-empty-test/project/proj.android/app/proguard-rules.pro b/tests/lua-empty-test/project/proj.android/app/proguard-rules.pro deleted file mode 100644 index 2c062c4946..0000000000 --- a/tests/lua-empty-test/project/proj.android/app/proguard-rules.pro +++ /dev/null @@ -1,37 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Proguard Cocos2d-x for release --keep public class org.cocos2dx.** { *; } --dontwarn org.cocos2dx.** --keep public class com.chukong.** { *; } --dontwarn com.chukong.** --keep public class com.huawei.android.** { *; } --dontwarn com.huawei.android.** - -# Proguard Apache HTTP for release --keep class org.apache.http.** { *; } --dontwarn org.apache.http.** - -# Proguard Android Webivew for release. uncomment if you are using a webview in cocos2d-x -#-keep public class android.net.http.SslError -#-keep public class android.webkit.WebViewClient - -#-dontwarn android.webkit.WebView -#-dontwarn android.net.http.SslError -#-dontwarn android.webkit.WebViewClient \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 45ee51d15f..0000000000 Binary files a/tests/lua-empty-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 0dd2a60899..0000000000 Binary files a/tests/lua-empty-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index a32f16f930..0000000000 Binary files a/tests/lua-empty-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 332f268edc..0000000000 Binary files a/tests/lua-empty-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.android/app/res/values/strings.xml b/tests/lua-empty-test/project/proj.android/app/res/values/strings.xml deleted file mode 100644 index d5cf210926..0000000000 --- a/tests/lua-empty-test/project/proj.android/app/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - LuaEmptyTest - diff --git a/tests/lua-empty-test/project/proj.android/app/src/org/cocos2dx/lua_empty_test/AppActivity.java b/tests/lua-empty-test/project/proj.android/app/src/org/cocos2dx/lua_empty_test/AppActivity.java deleted file mode 100644 index 8191b9f9e2..0000000000 --- a/tests/lua-empty-test/project/proj.android/app/src/org/cocos2dx/lua_empty_test/AppActivity.java +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - Copyright (c) 2015-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -package org.cocos2dx.lua_empty_test; - -import android.os.Bundle; - -import org.cocos2dx.lib.Cocos2dxActivity; -import org.cocos2dx.lib.SharedLoader; - -public class AppActivity extends Cocos2dxActivity { - static { - SharedLoader.load(); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.setEnableVirtualButton(false); - super.onCreate(savedInstanceState); - // Workaround in https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508 - if (!isTaskRoot()) { - // Android launched another instance of the root activity into an existing task - // so just quietly finish and go away, dropping the user back into the activity - // at the top of the stack (ie: the last state of this task) - // Don't need to finish it again since it's finished in super.onCreate . - return; - } - // DO OTHER INITIALIZATION BELOW - - } -} diff --git a/tests/lua-empty-test/project/proj.android/build.gradle b/tests/lua-empty-test/project/proj.android/build.gradle deleted file mode 100644 index 550730b1c8..0000000000 --- a/tests/lua-empty-test/project/proj.android/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.2.0' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.android/gradle.properties b/tests/lua-empty-test/project/proj.android/gradle.properties deleted file mode 100644 index 8f5dc79e3f..0000000000 --- a/tests/lua-empty-test/project/proj.android/gradle.properties +++ /dev/null @@ -1,42 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -# Android SDK version that will be used as the compile project -PROP_COMPILE_SDK_VERSION=28 - -# Android SDK version that will be used as the earliest version of android this application can run on -PROP_MIN_SDK_VERSION=16 - -# Android SDK version that will be used as the latest version of android this application has been tested on -PROP_TARGET_SDK_VERSION=28 - - -# List of CPU Archtexture to build that application with -# Available architextures (armeabi-v7a | arm64-v8a | x86) -# To build for multiple architexture, use the `:` between them -# Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86 -PROP_APP_ABI=armeabi-v7a:arm64-v8a - -# uncomment it and fill in sign information for release mode -#RELEASE_STORE_FILE=file path of keystore -#RELEASE_STORE_PASSWORD=password of keystore -#RELEASE_KEY_ALIAS=alias of key -#RELEASE_KEY_PASSWORD=password of key - -android.injected.testOnly=false \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.android/gradle/wrapper/gradle-wrapper.jar b/tests/lua-empty-test/project/proj.android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a86..0000000000 Binary files a/tests/lua-empty-test/project/proj.android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.android/gradle/wrapper/gradle-wrapper.properties b/tests/lua-empty-test/project/proj.android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 82ec319ae7..0000000000 --- a/tests/lua-empty-test/project/proj.android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri May 10 15:15:29 CST 2019 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip diff --git a/tests/lua-empty-test/project/proj.android/gradlew b/tests/lua-empty-test/project/proj.android/gradlew deleted file mode 100755 index 91a7e269e1..0000000000 --- a/tests/lua-empty-test/project/proj.android/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/lua-empty-test/project/proj.android/gradlew.bat b/tests/lua-empty-test/project/proj.android/gradlew.bat deleted file mode 100644 index 8a0b282aa6..0000000000 --- a/tests/lua-empty-test/project/proj.android/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/tests/lua-empty-test/project/proj.android/settings.gradle b/tests/lua-empty-test/project/proj.android/settings.gradle deleted file mode 100644 index c2396208bc..0000000000 --- a/tests/lua-empty-test/project/proj.android/settings.gradle +++ /dev/null @@ -1,20 +0,0 @@ -import java.nio.file.Paths -import java.nio.file.Files - -def ENGINE_ROOT=Paths.get("${System.env.ADXE_ROOT}") -if(Files.exists(ENGINE_ROOT)) { - println("Determine ENGINE_JAVA_LIBPATH with system env var ADXE_ROOT") - ENGINE_ROOT = ENGINE_ROOT.toAbsolutePath().toString() -} -else { - println("Determine ENGINE_JAVA_LIBPATH with relative to settingsDir") - ENGINE_ROOT = settingsDir.getPath() + "/../../.." -} - -def ENGINE_JAVA_LIBPATH = ENGINE_ROOT + '/cocos/platform/android/libcocos2dx'; - -include ':libcocos2dx' -project(':libcocos2dx').projectDir = new File(ENGINE_JAVA_LIBPATH) -include ':LuaEmptyTest' -project(':LuaEmptyTest').projectDir = new File(settingsDir, 'app') -rootProject.name = "lua-empty-test" \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.ios/AppController.h b/tests/lua-empty-test/project/proj.ios/AppController.h deleted file mode 100644 index d7906fbfd9..0000000000 --- a/tests/lua-empty-test/project/proj.ios/AppController.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/tests/lua-empty-test/project/proj.ios/AppController.mm b/tests/lua-empty-test/project/proj.ios/AppController.mm deleted file mode 100644 index 5f463bba4c..0000000000 --- a/tests/lua-empty-test/project/proj.ios/AppController.mm +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#import -#import "AppController.h" -#import "cocos2d.h" -#import "platform/ios/CCEAGLView-ios.h" -#import "AppDelegate.h" - -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - cocos2d::Application *app = cocos2d::Application::getInstance(); - app->initGLContextAttrs(); - cocos2d::GLViewImpl::convertAttrs(); - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: (NSString*)cocos2d::GLViewImpl::_pixelFormat - depthFormat: cocos2d::GLViewImpl::_depthFormat - preserveBackbuffer: NO - sharegroup: nil - multiSampling: cocos2d::GLViewImpl::_multisamplingCount > 0 ? YES : NO - numberOfSamples: cocos2d::GLViewImpl::_multisamplingCount ]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = eaglView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - //Launching the app with the arguments -NSAllowsDefaultLineBreakStrategy NO to force back to the old behavior. - if ( [[UIDevice currentDevice].systemVersion floatValue] >= 13.0f) - { - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSAllowsDefaultLineBreakStrategy"]; - } - - // IMPORTANT: Setting the GLView should be done after creating the RootViewController - cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView(eaglView); - cocos2d::Director::getInstance()->setOpenGLView(glview); - - app->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/tests/lua-empty-test/project/proj.ios/HelloLua_Prefix.pch b/tests/lua-empty-test/project/proj.ios/HelloLua_Prefix.pch deleted file mode 100644 index b4311a0a3d..0000000000 --- a/tests/lua-empty-test/project/proj.ios/HelloLua_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'HelloLua' target in the 'HelloLua' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Contents.json b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Contents.json deleted file mode 100644 index 51cbd32fe0..0000000000 --- a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Contents.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@3x.png", - "scale" : "3x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon-57.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon-57@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-20.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "Icon-50.png", - "scale" : "1x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "Icon-50@2x.png", - "scale" : "2x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "Icon-72.png", - "scale" : "1x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "Icon-72@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-83.5@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20.png deleted file mode 100644 index 8ead23e365..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@2x.png deleted file mode 100644 index 775685daca..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@3x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@3x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@3x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29.png deleted file mode 100644 index 0500184c86..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@2x.png deleted file mode 100644 index f0f8b7fe98..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@3x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@3x.png deleted file mode 100644 index 5287e50a79..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@3x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40.png deleted file mode 100644 index 775685daca..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@2x.png deleted file mode 100644 index d9c7ab446b..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@3x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@3x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@3x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50.png deleted file mode 100644 index ac381bc20e..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50@2x.png deleted file mode 100644 index ef38d4500a..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57.png deleted file mode 100644 index 4fcc6fddff..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57@2x.png deleted file mode 100644 index c3807861ad..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@2x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@3x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@3x.png deleted file mode 100644 index d4bc53132c..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72.png deleted file mode 100644 index 2c573c8df4..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72@2x.png deleted file mode 100644 index 1526615c02..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76.png deleted file mode 100644 index 8a1fa1850c..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76@2x.png deleted file mode 100644 index 8aa82506d0..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-83.5@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-83.5@2x.png deleted file mode 100644 index 6bf801d175..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-83.5@2x.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/Contents.json b/tests/lua-empty-test/project/proj.ios/Images.xcassets/Contents.json deleted file mode 100644 index da4a164c91..0000000000 --- a/tests/lua-empty-test/project/proj.ios/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.ios/Info.plist b/tests/lua-empty-test/project/proj.ios/Info.plist deleted file mode 100644 index 406c829aad..0000000000 --- a/tests/lua-empty-test/project/proj.ios/Info.plist +++ /dev/null @@ -1,52 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PROJECT_NAME} - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleIconFile - Icon-57.png - CFBundleIcons - - CFBundleIcons~ipad - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PROJECT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSHumanReadableCopyright - Copyright © 2019. All rights reserved. - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIPrerenderedIcon - - UIRequiredDeviceCapabilities - - accelerometer - - - UIStatusBarHidden - - UISupportedInterfaceOrientations - - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationLandscapeLeft - - - diff --git a/tests/lua-empty-test/project/proj.ios/LaunchScreen.storyboard b/tests/lua-empty-test/project/proj.ios/LaunchScreen.storyboard deleted file mode 100644 index 068bbaa879..0000000000 --- a/tests/lua-empty-test/project/proj.ios/LaunchScreen.storyboard +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/lua-empty-test/project/proj.ios/LaunchScreenBackground.png b/tests/lua-empty-test/project/proj.ios/LaunchScreenBackground.png deleted file mode 100644 index dadccee686..0000000000 Binary files a/tests/lua-empty-test/project/proj.ios/LaunchScreenBackground.png and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.ios/RootViewController.h b/tests/lua-empty-test/project/proj.ios/RootViewController.h deleted file mode 100644 index 1c51096c57..0000000000 --- a/tests/lua-empty-test/project/proj.ios/RootViewController.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/tests/lua-empty-test/project/proj.ios/RootViewController.mm b/tests/lua-empty-test/project/proj.ios/RootViewController.mm deleted file mode 100644 index 8002ff82d0..0000000000 --- a/tests/lua-empty-test/project/proj.ios/RootViewController.mm +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -// Controls the application's preferred home indicator auto-hiding when this view controller is shown. -- (BOOL)prefersHomeIndicatorAutoHidden { - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/tests/lua-empty-test/project/proj.ios/exportoptions.plist b/tests/lua-empty-test/project/proj.ios/exportoptions.plist deleted file mode 100644 index 14a6dc5c20..0000000000 --- a/tests/lua-empty-test/project/proj.ios/exportoptions.plist +++ /dev/null @@ -1,15 +0,0 @@ - - - - - compileBitcode - - method - development - provisioningProfiles - - Bundle Identifier - Provision Prifile Name - - - diff --git a/tests/lua-empty-test/project/proj.ios/main.m b/tests/lua-empty-test/project/proj.ios/main.m deleted file mode 100644 index 27ca9796f7..0000000000 --- a/tests/lua-empty-test/project/proj.ios/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// HelloLua -// -// Created by Walzer on 11-6-15. -// Copyright __MyCompanyName__ 2011. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/tests/lua-empty-test/project/proj.linux/main.cpp b/tests/lua-empty-test/project/proj.linux/main.cpp deleted file mode 100644 index 042c94fef6..0000000000 --- a/tests/lua-empty-test/project/proj.linux/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - return Application::getInstance()->run(); -} diff --git a/tests/lua-empty-test/project/proj.mac/HelloLua_Prefix.pch b/tests/lua-empty-test/project/proj.mac/HelloLua_Prefix.pch deleted file mode 100644 index 46c36a7e99..0000000000 --- a/tests/lua-empty-test/project/proj.mac/HelloLua_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/tests/lua-empty-test/project/proj.mac/Icon.icns b/tests/lua-empty-test/project/proj.mac/Icon.icns deleted file mode 100644 index 3d09e8fb4f..0000000000 Binary files a/tests/lua-empty-test/project/proj.mac/Icon.icns and /dev/null differ diff --git a/tests/lua-empty-test/project/proj.mac/Info.plist b/tests/lua-empty-test/project/proj.mac/Info.plist deleted file mode 100644 index 021f82e95d..0000000000 --- a/tests/lua-empty-test/project/proj.mac/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleIconFile - Icon - CFBundleIdentifier - org.cocos2dx.lua_empty_test - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PROJECT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSHumanReadableCopyright - Copyright © 2019. All rights reserved. - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/tests/lua-empty-test/project/proj.mac/en.lproj/InfoPlist.strings b/tests/lua-empty-test/project/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/tests/lua-empty-test/project/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/tests/lua-empty-test/project/proj.mac/main.cpp b/tests/lua-empty-test/project/proj.mac/main.cpp deleted file mode 100644 index ed8ee7c15c..0000000000 --- a/tests/lua-empty-test/project/proj.mac/main.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - return Application::getInstance()->run(); -} diff --git a/tests/lua-empty-test/project/proj.win32/build-cfg.json b/tests/lua-empty-test/project/proj.win32/build-cfg.json deleted file mode 100644 index 60ebe76534..0000000000 --- a/tests/lua-empty-test/project/proj.win32/build-cfg.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "copy_resources": [ - { - "from": "../../src", - "to": "src" - }, - { - "from": "../../res", - "to": "res" - }, - { - "from": "../../../../extensions/scripting/lua-bindings/script", - "to": "src/cocos" - }, - { - "from": "../../../../thirdparty/lua/luasocket", - "to": "", - "include": [ - "*.lua" - ] - } - ] -} diff --git a/tests/lua-empty-test/project/proj.win32/main.cpp b/tests/lua-empty-test/project/proj.win32/main.cpp deleted file mode 100644 index 5283d815d2..0000000000 --- a/tests/lua-empty-test/project/proj.win32/main.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "main.h" -#include "AppDelegate.h" - -USING_NS_CC; - -// uncomment below line, open debug console -#define USE_WIN32_CONSOLE - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - -#ifdef USE_WIN32_CONSOLE - AllocConsole(); - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); -#endif - - // create the application instance - AppDelegate app; - int ret = Application::getInstance()->run(); - -#ifdef USE_WIN32_CONSOLE - FreeConsole(); -#endif - - return ret; -} diff --git a/tests/lua-empty-test/project/proj.win32/main.h b/tests/lua-empty-test/project/proj.win32/main.h deleted file mode 100644 index 13b6f36fd2..0000000000 --- a/tests/lua-empty-test/project/proj.win32/main.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include -#include - -// C RunTime Header Files -#include "platform/CCStdC.h" - -#endif // __MAIN_H__ diff --git a/tests/lua-empty-test/res/.gitignore b/tests/lua-empty-test/res/.gitignore deleted file mode 100644 index 1d65afe366..0000000000 --- a/tests/lua-empty-test/res/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#Do now ignore Marmalade icf files -!*.icf diff --git a/tests/lua-empty-test/res/background.caf b/tests/lua-empty-test/res/background.caf deleted file mode 100644 index 5d7d0b8ce9..0000000000 Binary files a/tests/lua-empty-test/res/background.caf and /dev/null differ diff --git a/tests/lua-empty-test/res/background.mp3 b/tests/lua-empty-test/res/background.mp3 deleted file mode 100644 index aec1c0a8c8..0000000000 Binary files a/tests/lua-empty-test/res/background.mp3 and /dev/null differ diff --git a/tests/lua-empty-test/res/background.ogg b/tests/lua-empty-test/res/background.ogg deleted file mode 100644 index e5af704a05..0000000000 Binary files a/tests/lua-empty-test/res/background.ogg and /dev/null differ diff --git a/tests/lua-empty-test/res/crop.png b/tests/lua-empty-test/res/crop.png deleted file mode 100644 index 9ea84bc93f..0000000000 Binary files a/tests/lua-empty-test/res/crop.png and /dev/null differ diff --git a/tests/lua-empty-test/res/dog.png b/tests/lua-empty-test/res/dog.png deleted file mode 100644 index 76bdca07a1..0000000000 Binary files a/tests/lua-empty-test/res/dog.png and /dev/null differ diff --git a/tests/lua-empty-test/res/effect1.wav b/tests/lua-empty-test/res/effect1.wav deleted file mode 100644 index f8d4292d0f..0000000000 Binary files a/tests/lua-empty-test/res/effect1.wav and /dev/null differ diff --git a/tests/lua-empty-test/res/farm.jpg b/tests/lua-empty-test/res/farm.jpg deleted file mode 100644 index d7290c3470..0000000000 Binary files a/tests/lua-empty-test/res/farm.jpg and /dev/null differ diff --git a/tests/lua-empty-test/res/fonts/Marker Felt.ttf b/tests/lua-empty-test/res/fonts/Marker Felt.ttf deleted file mode 100644 index 3752ef3110..0000000000 Binary files a/tests/lua-empty-test/res/fonts/Marker Felt.ttf and /dev/null differ diff --git a/tests/lua-empty-test/res/land.png b/tests/lua-empty-test/res/land.png deleted file mode 100644 index 6e0785b545..0000000000 Binary files a/tests/lua-empty-test/res/land.png and /dev/null differ diff --git a/tests/lua-empty-test/res/menu1.png b/tests/lua-empty-test/res/menu1.png deleted file mode 100644 index eeb327a4cb..0000000000 Binary files a/tests/lua-empty-test/res/menu1.png and /dev/null differ diff --git a/tests/lua-empty-test/res/menu2.png b/tests/lua-empty-test/res/menu2.png deleted file mode 100644 index 04763ea1a4..0000000000 Binary files a/tests/lua-empty-test/res/menu2.png and /dev/null differ diff --git a/tests/lua-empty-test/src/hello.lua b/tests/lua-empty-test/src/hello.lua deleted file mode 100644 index af6c14cbc5..0000000000 --- a/tests/lua-empty-test/src/hello.lua +++ /dev/null @@ -1,225 +0,0 @@ --- CC_USE_DEPRECATED_API = true -require "cocos.init" - --- cclog -cclog = function(...) - print(string.format(...)) -end - --- for CCLuaEngine traceback -function __G__TRACKBACK__(msg) - cclog("----------------------------------------") - cclog("LUA ERROR: " .. tostring(msg) .. "\n") - cclog(debug.traceback()) - cclog("----------------------------------------") -end - -local function initGLView() - local director = cc.Director:getInstance() - local glView = director:getOpenGLView() - if nil == glView then - glView = cc.GLViewImpl:create("Lua Empty Test") - director:setOpenGLView(glView) - end - - director:setOpenGLView(glView) - - glView:setDesignResolutionSize(480, 320, cc.ResolutionPolicy.NO_BORDER) - - --turn on display FPS - director:setDisplayStats(true) - - --set FPS. the default value is 1.0/60 if you don't call this - director:setAnimationInterval(1.0 / 60) -end - -local function main() - if(version() >= 504) then - collectgarbage("incremental") - else - -- avoid memory leak - collectgarbage("setpause", 100) - collectgarbage("setstepmul", 5000) - end - - initGLView() - - require "hello2" - cclog("result is " .. myadd(1, 1)) - - --------------- - - local visibleSize = cc.Director:getInstance():getVisibleSize() - local origin = cc.Director:getInstance():getVisibleOrigin() - - -- add the moving dog - local function creatDog() - local frameWidth = 105 - local frameHeight = 95 - - -- create dog animate - local textureDog = cc.Director:getInstance():getTextureCache():addImage("dog.png") - local rect = cc.rect(0, 0, frameWidth, frameHeight) - local frame0 = cc.SpriteFrame:createWithTexture(textureDog, rect) - rect = cc.rect(frameWidth, 0, frameWidth, frameHeight) - local frame1 = cc.SpriteFrame:createWithTexture(textureDog, rect) - - local spriteDog = cc.Sprite:createWithSpriteFrame(frame0) - spriteDog.isPaused = false - spriteDog:setPosition(origin.x, origin.y + visibleSize.height / 4 * 3) ---[[ - local animFrames = CCArray:create() - - animFrames:addObject(frame0) - animFrames:addObject(frame1) -]]-- - - local animation = cc.Animation:createWithSpriteFrames({frame0,frame1}, 0.5) - local animate = cc.Animate:create(animation) - spriteDog:runAction(cc.RepeatForever:create(animate)) - - -- moving dog at every frame - local function tick() - if spriteDog.isPaused then return end - local x, y = spriteDog:getPosition() - if x > origin.x + visibleSize.width then - x = origin.x - else - x = x + 1 - end - - spriteDog:setPositionX(x) - end - - cc.Director:getInstance():getScheduler():scheduleScriptFunc(tick, 0, false) - - return spriteDog - end - - -- create farm - local function createLayerFarm() - local layerFarm = cc.Layer:create() - - -- add in farm background - local bg = cc.Sprite:create("farm.jpg") - bg:setPosition(origin.x + visibleSize.width / 2 + 80, origin.y + visibleSize.height / 2) - layerFarm:addChild(bg) - - -- add land sprite - for i = 0, 3 do - for j = 0, 1 do - local spriteLand = cc.Sprite:create("land.png") - spriteLand:setPosition(200 + j * 180 - i % 2 * 90, 10 + i * 95 / 2) - layerFarm:addChild(spriteLand) - end - end - - -- add crop - local frameCrop = cc.SpriteFrame:create("crop.png", cc.rect(0, 0, 105, 95)) - for i = 0, 3 do - for j = 0, 1 do - local spriteCrop = cc.Sprite:createWithSpriteFrame(frameCrop) - spriteCrop:setPosition(10 + 200 + j * 180 - i % 2 * 90, 30 + 10 + i * 95 / 2) - layerFarm:addChild(spriteCrop) - end - end - - -- add moving dog - local spriteDog = creatDog() - layerFarm:addChild(spriteDog) - - -- handing touch events - local touchBeginPoint = nil - local function onTouchBegan(touch, event) - local location = touch:getLocation() - cclog("onTouchBegan: %0.2f, %0.2f", location.x, location.y) - touchBeginPoint = {x = location.x, y = location.y} - spriteDog.isPaused = true - -- CCTOUCHBEGAN event must return true - return true - end - - local function onTouchMoved(touch, event) - local location = touch:getLocation() - cclog("onTouchMoved: %0.2f, %0.2f", location.x, location.y) - if touchBeginPoint then - local cx, cy = layerFarm:getPosition() - layerFarm:setPosition(cx + location.x - touchBeginPoint.x, - cy + location.y - touchBeginPoint.y) - touchBeginPoint = {x = location.x, y = location.y} - end - end - - local function onTouchEnded(touch, event) - local location = touch:getLocation() - cclog("onTouchEnded: %0.2f, %0.2f", location.x, location.y) - touchBeginPoint = nil - spriteDog.isPaused = false - end - - local listener = cc.EventListenerTouchOneByOne:create() - listener:registerScriptHandler(onTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN ) - listener:registerScriptHandler(onTouchMoved,cc.Handler.EVENT_TOUCH_MOVED ) - listener:registerScriptHandler(onTouchEnded,cc.Handler.EVENT_TOUCH_ENDED ) - local eventDispatcher = layerFarm:getEventDispatcher() - eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layerFarm) - - return layerFarm - end - - - -- create menu - local function createLayerMenu() - local layerMenu = cc.Layer:create() - - local menuPopup, menuTools, effectID - - local function menuCallbackClosePopup() - -- stop test sound effect - cc.AudioEngine:stop(effectID) - menuPopup:setVisible(false) - end - - local function menuCallbackOpenPopup() - -- loop test sound effect - local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav") - effectID = cc.AudioEngine:play2d(effectPath) - menuPopup:setVisible(true) - end - - -- add a popup menu - local menuPopupItem = cc.MenuItemImage:create("menu2.png", "menu2.png") - menuPopupItem:setPosition(0, 0) - menuPopupItem:registerScriptTapHandler(menuCallbackClosePopup) - menuPopup = cc.Menu:create(menuPopupItem) - menuPopup:setPosition(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2) - menuPopup:setVisible(false) - layerMenu:addChild(menuPopup) - - -- add the left-bottom "tools" menu to invoke menuPopup - local menuToolsItem = cc.MenuItemImage:create("menu1.png", "menu1.png") - menuToolsItem:setPosition(0, 0) - menuToolsItem:registerScriptTapHandler(menuCallbackOpenPopup) - menuTools = cc.Menu:create(menuToolsItem) - local itemWidth = menuToolsItem:getContentSize().width - local itemHeight = menuToolsItem:getContentSize().height - menuTools:setPosition(origin.x + itemWidth/2, origin.y + itemHeight/2) - layerMenu:addChild(menuTools) - - return layerMenu - end - - -- play background music, preload effect - local bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("background.mp3") - cc.AudioEngine:play2d(bgMusicPath, true) - local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav") - cc.AudioEngine:preload(effectPath) - - -- run - local sceneGame = cc.Scene:create() - sceneGame:addChild(createLayerFarm()) - sceneGame:addChild(createLayerMenu()) - cc.Director:getInstance():runWithScene(sceneGame) -end - -xpcall(main, __G__TRACKBACK__) diff --git a/tests/lua-empty-test/src/hello2.lua b/tests/lua-empty-test/src/hello2.lua deleted file mode 100644 index 27158aa788..0000000000 --- a/tests/lua-empty-test/src/hello2.lua +++ /dev/null @@ -1,3 +0,0 @@ -function myadd(x, y) - return x + y -end \ No newline at end of file diff --git a/tests/lua-empty-test/src/mobdebug.lua b/tests/lua-empty-test/src/mobdebug.lua deleted file mode 100644 index 31ef8af06b..0000000000 --- a/tests/lua-empty-test/src/mobdebug.lua +++ /dev/null @@ -1,1465 +0,0 @@ --- --- MobDebug 0.542 --- Copyright 2011-13 Paul Kulchenko --- Based on RemDebug 1.0 Copyright Kepler Project 2005 --- - -local mobdebug = { - _NAME = "mobdebug", - _VERSION = 0.542, - _COPYRIGHT = "Paul Kulchenko", - _DESCRIPTION = "Mobile Remote Debugger for the Lua programming language", - port = os and os.getenv and os.getenv("MOBDEBUG_PORT") or 8172, - checkcount = 200, - yieldtimeout = 0.02, -} - -local coroutine = coroutine -local error = error -local getfenv = getfenv -local setfenv = setfenv -local loadstring = loadstring or load -- "load" replaced "loadstring" in Lua 5.2 -local io = io -local os = os -local pairs = pairs -local require = require -local setmetatable = setmetatable -local string = string -local tonumber = tonumber -local unpack = table.unpack or unpack -local rawget = rawget - --- if strict.lua is used, then need to avoid referencing some global --- variables, as they can be undefined; --- use rawget to to avoid complaints from strict.lua at run-time. --- it's safe to do the initialization here as all these variables --- should get defined values (of any) before the debugging starts. --- there is also global 'wx' variable, which is checked as part of --- the debug loop as 'wx' can be loaded at any time during debugging. -local genv = _G or _ENV -local jit = rawget(genv, "jit") -local MOAICoroutine = rawget(genv, "MOAICoroutine") - -if not setfenv then -- Lua 5.2 - -- based on http://lua-users.org/lists/lua-l/2010-06/msg00314.html - -- this assumes f is a function - local function findenv(f) - local level = 1 - repeat - local name, value = debug.getupvalue(f, level) - if name == '_ENV' then return level, value end - level = level + 1 - until name == nil - return nil end - getfenv = function (f) return(select(2, findenv(f)) or _G) end - setfenv = function (f, t) - local level = findenv(f) - if level then debug.setupvalue(f, level, t) end - return f end -end - --- check for OS and convert file names to lower case on windows --- (its file system is case insensitive, but case preserving), as setting a --- breakpoint on x:\Foo.lua will not work if the file was loaded as X:\foo.lua. --- OSX and Windows behave the same way (case insensitive, but case preserving) -local iscasepreserving = os and os.getenv and (os.getenv('WINDIR') - or (os.getenv('OS') or ''):match('[Ww]indows') - or os.getenv('DYLD_LIBRARY_PATH')) - or not io.open("/proc") - --- turn jit off based on Mike Pall's comment in this discussion: --- http://www.freelists.org/post/luajit/Debug-hooks-and-JIT,2 --- "You need to turn it off at the start if you plan to receive --- reliable hook calls at any later point in time." -if jit and jit.off then jit.off() end - -local socket = require "socket" -local debug = require "debug" -local coro_debugger -local coro_debugee -local coroutines = {}; setmetatable(coroutines, {__mode = "k"}) -- "weak" keys -local events = { BREAK = 1, WATCH = 2, RESTART = 3, STACK = 4 } -local breakpoints = {} -local watches = {} -local lastsource -local lastfile -local watchescnt = 0 -local abort -- default value is nil; this is used in start/loop distinction -local seen_hook = false -local checkcount = 0 -local step_into = false -local step_over = false -local step_level = 0 -local stack_level = 0 -local server -local buf -local outputs = {} -local iobase = {print = print} -local basedir = "" -local deferror = "execution aborted at default debugee" -local debugee = function () - local a = 1 - for _ = 1, 10 do a = a + 1 end - error(deferror) -end -local function q(s) return s:gsub('([%(%)%.%%%+%-%*%?%[%^%$%]])','%%%1') end - -local serpent = (function() ---- include Serpent module for serialization -local n, v = "serpent", 0.25 -- (C) 2012-13 Paul Kulchenko; MIT License -local c, d = "Paul Kulchenko", "Lua serializer and pretty printer" -local snum = {[tostring(1/0)]='1/0 --[[math.huge]]',[tostring(-1/0)]='-1/0 --[[-math.huge]]',[tostring(0/0)]='0/0'} -local badtype = {thread = true, userdata = true, cdata = true} -local keyword, globals, G = {}, {}, (_G or _ENV) -for _,k in ipairs({'and', 'break', 'do', 'else', 'elseif', 'end', 'false', - 'for', 'function', 'goto', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', - 'return', 'then', 'true', 'until', 'while'}) do keyword[k] = true end -for k,v in pairs(G) do globals[v] = k end -- build func to name mapping -for _,g in ipairs({'coroutine', 'debug', 'io', 'math', 'string', 'table', 'os'}) do - for k,v in pairs(G[g]) do globals[v] = g..'.'..k end end - -local function s(t, opts) - local name, indent, fatal, maxnum = opts.name, opts.indent, opts.fatal, opts.maxnum - local sparse, custom, huge = opts.sparse, opts.custom, not opts.nohuge - local space, maxl = (opts.compact and '' or ' '), (opts.maxlevel or math.huge) - local iname, comm = '_'..(name or ''), opts.comment and (tonumber(opts.comment) or math.huge) - local seen, sref, syms, symn = {}, {'local '..iname..'={}'}, {}, 0 - local function gensym(val) return '_'..(tostring(tostring(val)):gsub("[^%w]",""):gsub("(%d%w+)", - -- tostring(val) is needed because __tostring may return a non-string value - function(s) if not syms[s] then symn = symn+1; syms[s] = symn end return syms[s] end)) end - local function safestr(s) return type(s) == "number" and (huge and snum[tostring(s)] or s) - or type(s) ~= "string" and tostring(s) -- escape NEWLINE/010 and EOF/026 - or ("%q"):format(s):gsub("\010","n"):gsub("\026","\\026") end - local function comment(s,l) return comm and (l or 0) < comm and ' --[['..tostring(s)..']]' or '' end - local function globerr(s,l) return globals[s] and globals[s]..comment(s,l) or not fatal - and safestr(select(2, pcall(tostring, s))) or error("Can't serialize "..tostring(s)) end - local function safename(path, name) -- generates foo.bar, foo[3], or foo['b a r'] - local n = name == nil and '' or name - local plain = type(n) == "string" and n:match("^[%l%u_][%w_]*$") and not keyword[n] - local safe = plain and n or '['..safestr(n)..']' - return (path or '')..(plain and path and '.' or '')..safe, safe end - local alphanumsort = type(opts.sortkeys) == 'function' and opts.sortkeys or function(k, o, n) -- k=keys, o=originaltable, n=padding - local maxn, to = tonumber(n) or 12, {number = 'a', string = 'b'} - local function padnum(d) return ("%0"..maxn.."d"):format(d) end - table.sort(k, function(a,b) - -- sort numeric keys first: k[key] is non-nil for numeric keys - return (k[a] and 0 or to[type(a)] or 'z')..(tostring(a):gsub("%d+",padnum)) - < (k[b] and 0 or to[type(b)] or 'z')..(tostring(b):gsub("%d+",padnum)) end) end - local function val2str(t, name, indent, insref, path, plainindex, level) - local ttype, level, mt = type(t), (level or 0), getmetatable(t) - local spath, sname = safename(path, name) - local tag = plainindex and - ((type(name) == "number") and '' or name..space..'='..space) or - (name ~= nil and sname..space..'='..space or '') - if seen[t] then -- already seen this element - sref[#sref+1] = spath..space..'='..space..seen[t] - return tag..'nil'..comment('ref', level) end - if type(mt) == 'table' and (mt.__serialize or mt.__tostring) then -- knows how to serialize itself - seen[t] = insref or spath - if mt.__serialize then t = mt.__serialize(t) else t = tostring(t) end - ttype = type(t) end -- new value falls through to be serialized - if ttype == "table" then - if level >= maxl then return tag..'{}'..comment('max', level) end - seen[t] = insref or spath - if next(t) == nil then return tag..'{}'..comment(t, level) end -- table empty - local maxn, o, out = math.min(#t, maxnum or #t), {}, {} - for key = 1, maxn do o[key] = key end - if not maxnum or #o < maxnum then - local n = #o -- n = n + 1; o[n] is much faster than o[#o+1] on large tables - for key in pairs(t) do if o[key] ~= key then n = n + 1; o[n] = key end end end - if maxnum and #o > maxnum then o[maxnum+1] = nil end - if opts.sortkeys and #o > maxn then alphanumsort(o, t, opts.sortkeys) end - local sparse = sparse and #o > maxn -- disable sparsness if only numeric keys (shorter output) - for n, key in ipairs(o) do - local value, ktype, plainindex = t[key], type(key), n <= maxn and not sparse - if opts.valignore and opts.valignore[value] -- skip ignored values; do nothing - or opts.keyallow and not opts.keyallow[key] - or opts.valtypeignore and opts.valtypeignore[type(value)] -- skipping ignored value types - or sparse and value == nil then -- skipping nils; do nothing - elseif ktype == 'table' or ktype == 'function' or badtype[ktype] then - if not seen[key] and not globals[key] then - sref[#sref+1] = 'placeholder' - local sname = safename(iname, gensym(key)) -- iname is table for local variables - sref[#sref] = val2str(key,sname,indent,sname,iname,true) end - sref[#sref+1] = 'placeholder' - local path = seen[t]..'['..(seen[key] or globals[key] or gensym(key))..']' - sref[#sref] = path..space..'='..space..(seen[value] or val2str(value,nil,indent,path)) - else - out[#out+1] = val2str(value,key,indent,insref,seen[t],plainindex,level+1) - end - end - local prefix = string.rep(indent or '', level) - local head = indent and '{\n'..prefix..indent or '{' - local body = table.concat(out, ','..(indent and '\n'..prefix..indent or space)) - local tail = indent and "\n"..prefix..'}' or '}' - return (custom and custom(tag,head,body,tail) or tag..head..body..tail)..comment(t, level) - elseif badtype[ttype] then - seen[t] = insref or spath - return tag..globerr(t, level) - elseif ttype == 'function' then - seen[t] = insref or spath - local ok, res = pcall(string.dump, t) - local func = ok and ((opts.nocode and "function() --[[..skipped..]] end" or - "loadstring("..safestr(res)..",'@serialized')")..comment(t, level)) - return tag..(func or globerr(t, level)) - else return tag..safestr(t) end -- handle all other types - end - local sepr = indent and "\n" or ";"..space - local body = val2str(t, name, indent) -- this call also populates sref - local tail = #sref>1 and table.concat(sref, sepr)..sepr or '' - local warn = opts.comment and #sref>1 and space.."--[[incomplete output with shared/self-references skipped]]" or '' - return not name and body..warn or "do local "..body..sepr..tail.."return "..name..sepr.."end" -end - -local function merge(a, b) if b then for k,v in pairs(b) do a[k] = v end end; return a; end -return { _NAME = n, _COPYRIGHT = c, _DESCRIPTION = d, _VERSION = v, serialize = s, - dump = function(a, opts) return s(a, merge({name = '_', compact = true, sparse = true}, opts)) end, - line = function(a, opts) return s(a, merge({sortkeys = true, comment = true}, opts)) end, - block = function(a, opts) return s(a, merge({indent = ' ', sortkeys = true, comment = true}, opts)) end } -end)() ---- end of Serpent module - -local function removebasedir(path, basedir) - if iscasepreserving then - -- check if the lowercased path matches the basedir - -- if so, return substring of the original path (to not lowercase it) - return path:lower():find('^'..q(basedir:lower())) - and path:sub(#basedir+1) or path - else - return string.gsub(path, '^'..q(basedir), '') - end -end - -local function stack(start) - local function vars(f) - local func = debug.getinfo(f, "f").func - local i = 1 - local locals = {} - while true do - local name, value = debug.getlocal(f, i) - if not name then break end - if string.sub(name, 1, 1) ~= '(' then locals[name] = {value, tostring(value)} end - i = i + 1 - end - i = 1 - local ups = {} - while func and true do -- check for func as it may be nil for tail calls - local name, value = debug.getupvalue(func, i) - if not name then break end - ups[name] = {value, tostring(value)} - i = i + 1 - end - return locals, ups - end - - local stack = {} - for i = (start or 0), 100 do - local source = debug.getinfo(i, "Snl") - if not source then break end - - local src = source.source - if src:find("@") == 1 then - src = src:sub(2):gsub("\\", "/") - if src:find("%./") == 1 then src = src:sub(3) end - end - - table.insert(stack, { -- remove basedir from source - {source.name, removebasedir(src, basedir), source.linedefined, - source.currentline, source.what, source.namewhat, source.short_src}, - vars(i+1)}) - if source.what == 'main' then break end - end - return stack -end - -local function set_breakpoint(file, line) - if file == '-' and lastfile then file = lastfile - elseif iscasepreserving then file = string.lower(file) end - if not breakpoints[line] then breakpoints[line] = {} end - breakpoints[line][file] = true -end - -local function remove_breakpoint(file, line) - if file == '-' and lastfile then file = lastfile - elseif iscasepreserving then file = string.lower(file) end - if breakpoints[line] then breakpoints[line][file] = nil end -end - -local function has_breakpoint(file, line) - return breakpoints[line] - and breakpoints[line][iscasepreserving and string.lower(file) or file] -end - -local function restore_vars(vars) - if type(vars) ~= 'table' then return end - - -- locals need to be processed in the reverse order, starting from - -- the inner block out, to make sure that the localized variables - -- are correctly updated with only the closest variable with - -- the same name being changed - -- first loop find how many local variables there is, while - -- the second loop processes them from i to 1 - local i = 1 - while true do - local name = debug.getlocal(3, i) - if not name then break end - i = i + 1 - end - i = i - 1 - local written_vars = {} - while i > 0 do - local name = debug.getlocal(3, i) - if not written_vars[name] then - if string.sub(name, 1, 1) ~= '(' then - debug.setlocal(3, i, rawget(vars, name)) - end - written_vars[name] = true - end - i = i - 1 - end - - i = 1 - local func = debug.getinfo(3, "f").func - while true do - local name = debug.getupvalue(func, i) - if not name then break end - if not written_vars[name] then - if string.sub(name, 1, 1) ~= '(' then - debug.setupvalue(func, i, rawget(vars, name)) - end - written_vars[name] = true - end - i = i + 1 - end -end - -local function capture_vars(level) - local vars = {} - local func = debug.getinfo(level or 3, "f").func - local i = 1 - while true do - local name, value = debug.getupvalue(func, i) - if not name then break end - if string.sub(name, 1, 1) ~= '(' then vars[name] = value end - i = i + 1 - end - i = 1 - while true do - local name, value = debug.getlocal(level or 3, i) - if not name then break end - if string.sub(name, 1, 1) ~= '(' then vars[name] = value end - i = i + 1 - end - -- returned 'vars' table plays a dual role: (1) it captures local values - -- and upvalues to be restored later (in case they are modified in "eval"), - -- and (2) it provides an environment for evaluated chunks. - -- getfenv(func) is needed to provide proper environment for functions, - -- including access to globals, but this causes vars[name] to fail in - -- restore_vars on local variables or upvalues with `nil` values when - -- 'strict' is in effect. To avoid this `rawget` is used in restore_vars. - setmetatable(vars, { __index = getfenv(func), __newindex = getfenv(func) }) - return vars -end - -local function stack_depth(start_depth) - for i = start_depth, 0, -1 do - if debug.getinfo(i, "l") then return i+1 end - end - return start_depth -end - -local function is_safe(stack_level) - -- the stack grows up: 0 is getinfo, 1 is is_safe, 2 is debug_hook, 3 is user function - if stack_level == 3 then return true end - for i = 3, stack_level do - -- return if it is not safe to abort - local info = debug.getinfo(i, "S") - if not info then return true end - if info.what == "C" then return false end - end - return true -end - -local function in_debugger() - local this = debug.getinfo(1, "S").source - -- only need to check few frames as mobdebug frames should be close - for i = 3, 7 do - local info = debug.getinfo(i, "S") - if not info then return false end - if info.source == this then return true end - end - return false -end - -local function is_pending(peer) - -- if there is something already in the buffer, skip check - if not buf and checkcount >= mobdebug.checkcount then - peer:settimeout(0) -- non-blocking - buf = peer:receive(1) - peer:settimeout() -- back to blocking - checkcount = 0 - end - return buf -end - -local function debug_hook(event, line) - -- (1) LuaJIT needs special treatment. Because debug_hook is set for - -- *all* coroutines, and not just the one being debugged as in regular Lua - -- (http://lua-users.org/lists/lua-l/2011-06/msg00513.html), - -- need to avoid debugging mobdebug's own code as LuaJIT doesn't - -- always correctly generate call/return hook events (there are more - -- calls than returns, which breaks stack depth calculation and - -- 'step' and 'step over' commands stop working; possibly because - -- 'tail return' events are not generated by LuaJIT). - -- the next line checks if the debugger is run under LuaJIT and if - -- one of debugger methods is present in the stack, it simply returns. - if jit then - -- when luajit is compiled with LUAJIT_ENABLE_LUA52COMPAT, - -- coroutine.running() returns non-nil for the main thread. - local coro, main = coroutine.running() - if not coro or main then coro = 'main' end - local disabled = coroutines[coro] == false - or coroutines[coro] == nil and coro ~= (coro_debugee or 'main') - if coro_debugee and disabled or not coro_debugee and (disabled or in_debugger()) - then return end - end - - -- (2) check if abort has been requested and it's safe to abort - if abort and is_safe(stack_level) then error(abort) end - - -- (3) also check if this debug hook has not been visited for any reason. - -- this check is needed to avoid stepping in too early - -- (for example, when coroutine.resume() is executed inside start()). - if not seen_hook and in_debugger() then return end - - if event == "call" then - stack_level = stack_level + 1 - elseif event == "return" or event == "tail return" then - stack_level = stack_level - 1 - elseif event == "line" then - -- may need to fall through because of the following: - -- (1) step_into - -- (2) step_over and stack_level <= step_level (need stack_level) - -- (3) breakpoint; check for line first as it's known; then for file - -- (4) socket call (only do every Xth check) - -- (5) at least one watch is registered - if not ( - step_into or step_over or breakpoints[line] or watchescnt > 0 - or is_pending(server) - ) then checkcount = checkcount + 1; return end - - checkcount = mobdebug.checkcount -- force check on the next command - - -- this is needed to check if the stack got shorter or longer. - -- unfortunately counting call/return calls is not reliable. - -- the discrepancy may happen when "pcall(load, '')" call is made - -- or when "error()" is called in a function. - -- in either case there are more "call" than "return" events reported. - -- this validation is done for every "line" event, but should be "cheap" - -- as it checks for the stack to get shorter (or longer by one call). - -- start from one level higher just in case we need to grow the stack. - -- this may happen after coroutine.resume call to a function that doesn't - -- have any other instructions to execute. it triggers three returns: - -- "return, tail return, return", which needs to be accounted for. - stack_level = stack_depth(stack_level+1) - - local caller = debug.getinfo(2, "S") - - -- grab the filename and fix it if needed - local file = lastfile - if (lastsource ~= caller.source) then - file, lastsource = caller.source, caller.source - -- technically, users can supply names that may not use '@', - -- for example when they call loadstring('...', 'filename.lua'). - -- Unfortunately, there is no reliable/quick way to figure out - -- what is the filename and what is the source code. - -- The following will work if the supplied filename uses Unix path. - if file:find("^@") then - file = file:gsub("^@", ""):gsub("\\", "/") - -- need this conversion to be applied to relative and absolute - -- file names as you may write "require 'Foo'" to - -- load "foo.lua" (on a case insensitive file system) and breakpoints - -- set on foo.lua will not work if not converted to the same case. - if iscasepreserving then file = string.lower(file) end - if file:find("%./") == 1 then file = file:sub(3) - else file = file:gsub('^'..q(basedir), '') end - -- some file systems allow newlines in file names; remove these. - file = file:gsub("\n", ' ') - else - -- this is either a file name coming from loadstring("chunk", "file"), - -- or the actual source code that needs to be serialized (as it may - -- include newlines); assume it's a file name if it's all on one line. - file = file:find("[\r\n]") and serpent.line(file) or file - end - - -- set to true if we got here; this only needs to be done once per - -- session, so do it here to at least avoid setting it for every line. - seen_hook = true - lastfile = file - end - - local vars, status, res - if (watchescnt > 0) then - vars = capture_vars() - for index, value in pairs(watches) do - setfenv(value, vars) - local ok, fired = pcall(value) - if ok and fired then - status, res = coroutine.resume(coro_debugger, events.WATCH, vars, file, line, index) - break -- any one watch is enough; don't check multiple times - end - end - end - - -- need to get into the "regular" debug handler, but only if there was - -- no watch that was fired. If there was a watch, handle its result. - local getin = (status == nil) and - (step_into - or (step_over and stack_level <= step_level) - or has_breakpoint(file, line) - or is_pending(server)) - - if getin then - vars = vars or capture_vars() - step_into = false - step_over = false - status, res = coroutine.resume(coro_debugger, events.BREAK, vars, file, line) - end - - -- handle 'stack' command that provides stack() information to the debugger - if status and res == 'stack' then - while status and res == 'stack' do - -- resume with the stack trace and variables - if vars then restore_vars(vars) end -- restore vars so they are reflected in stack values - -- this may fail if __tostring method fails at run-time - local ok, snapshot = pcall(stack, 4) - status, res = coroutine.resume(coro_debugger, ok and events.STACK or events.BREAK, snapshot, file, line) - end - end - - -- need to recheck once more as resume after 'stack' command may - -- return something else (for example, 'exit'), which needs to be handled - if status and res and res ~= 'stack' then - if abort == nil and res == "exit" then os.exit(1); return end - abort = res - -- only abort if safe; if not, there is another (earlier) check inside - -- debug_hook, which will abort execution at the first safe opportunity - if is_safe(stack_level) then error(abort) end - elseif not status and res then - error(res, 2) -- report any other (internal) errors back to the application - end - - if vars then restore_vars(vars) end - end -end - -local function stringify_results(status, ...) - if not status then return status, ... end -- on error report as it - - local t = {...} - for i,v in pairs(t) do -- stringify each of the returned values - local ok, res = pcall(serpent.line, v, {nocode = true, comment = 1}) - t[i] = ok and res or ("%q"):format(res):gsub("\010","n"):gsub("\026","\\026") - end - -- stringify table with all returned values - -- this is done to allow each returned value to be used (serialized or not) - -- intependently and to preserve "original" comments - return pcall(serpent.dump, t, {sparse = false}) -end - -local function debugger_loop(sev, svars, sfile, sline) - local command - local app, osname - local eval_env = svars or {} - local function emptyWatch () return false end - local loaded = {} - for k in pairs(package.loaded) do loaded[k] = true end - - while true do - local line, err - local wx = rawget(genv, "wx") -- use rawread to make strict.lua happy - if (wx or mobdebug.yield) and server.settimeout then server:settimeout(mobdebug.yieldtimeout) end - while true do - line, err = server:receive() - if not line and err == "timeout" then - -- yield for wx GUI applications if possible to avoid "busyness" - app = app or (wx and wx.wxGetApp and wx.wxGetApp()) - if app then - local win = app:GetTopWindow() - local inloop = app:IsMainLoopRunning() - osname = osname or wx.wxPlatformInfo.Get():GetOperatingSystemFamilyName() - if win and not inloop then - -- process messages in a regular way - -- and exit as soon as the event loop is idle - if osname == 'Unix' then wx.wxTimer(app):Start(10, true) end - local exitLoop = function() - win:Disconnect(wx.wxID_ANY, wx.wxID_ANY, wx.wxEVT_IDLE) - win:Disconnect(wx.wxID_ANY, wx.wxID_ANY, wx.wxEVT_TIMER) - app:ExitMainLoop() - end - win:Connect(wx.wxEVT_IDLE, exitLoop) - win:Connect(wx.wxEVT_TIMER, exitLoop) - app:MainLoop() - end - elseif mobdebug.yield then mobdebug.yield() - end - elseif not line and err == "closed" then - error("Debugger connection unexpectedly closed", 0) - else - -- if there is something in the pending buffer, prepend it to the line - if buf then line = buf .. line; buf = nil end - break - end - end - if server.settimeout then server:settimeout() end -- back to blocking - command = string.sub(line, string.find(line, "^[A-Z]+")) - if command == "SETB" then - local _, _, _, file, line = string.find(line, "^([A-Z]+)%s+(.-)%s+(%d+)%s*$") - if file and line then - set_breakpoint(file, tonumber(line)) - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "DELB" then - local _, _, _, file, line = string.find(line, "^([A-Z]+)%s+(.-)%s+(%d+)%s*$") - if file and line then - remove_breakpoint(file, tonumber(line)) - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "EXEC" then - local _, _, chunk = string.find(line, "^[A-Z]+%s+(.+)$") - if chunk then - local func, res = loadstring(chunk) - local status - if func then - setfenv(func, eval_env) - status, res = stringify_results(pcall(func)) - end - if status then - server:send("200 OK " .. #res .. "\n") - server:send(res) - else - server:send("401 Error in Expression " .. #res .. "\n") - server:send(res) - end - else - server:send("400 Bad Request\n") - end - elseif command == "LOAD" then - local _, _, size, name = string.find(line, "^[A-Z]+%s+(%d+)%s+(%S.-)%s*$") - size = tonumber(size) - - if abort == nil then -- no LOAD/RELOAD allowed inside start() - if size > 0 then server:receive(size) end - if sfile and sline then - server:send("201 Started " .. sfile .. " " .. sline .. "\n") - else - server:send("200 OK 0\n") - end - else - -- reset environment to allow required modules to load again - -- remove those packages that weren't loaded when debugger started - for k in pairs(package.loaded) do - if not loaded[k] then package.loaded[k] = nil end - end - - if size == 0 and name == '-' then -- RELOAD the current script being debugged - server:send("200 OK 0\n") - coroutine.yield("load") - else - -- receiving 0 bytes blocks (at least in luasocket 2.0.2), so skip reading - local chunk = size == 0 and "" or server:receive(size) - if chunk then -- LOAD a new script for debugging - local func, res = loadstring(chunk, "@"..name) - if func then - server:send("200 OK 0\n") - debugee = func - coroutine.yield("load") - else - server:send("401 Error in Expression " .. #res .. "\n") - server:send(res) - end - else - server:send("400 Bad Request\n") - end - end - end - elseif command == "SETW" then - local _, _, exp = string.find(line, "^[A-Z]+%s+(.+)%s*$") - if exp then - local func, res = loadstring("return(" .. exp .. ")") - if func then - watchescnt = watchescnt + 1 - local newidx = #watches + 1 - watches[newidx] = func - server:send("200 OK " .. newidx .. "\n") - else - server:send("401 Error in Expression " .. #res .. "\n") - server:send(res) - end - else - server:send("400 Bad Request\n") - end - elseif command == "DELW" then - local _, _, index = string.find(line, "^[A-Z]+%s+(%d+)%s*$") - index = tonumber(index) - if index > 0 and index <= #watches then - watchescnt = watchescnt - (watches[index] ~= emptyWatch and 1 or 0) - watches[index] = emptyWatch - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "RUN" then - server:send("200 OK\n") - - local ev, vars, file, line, idx_watch = coroutine.yield() - eval_env = vars - if ev == events.BREAK then - server:send("202 Paused " .. file .. " " .. line .. "\n") - elseif ev == events.WATCH then - server:send("203 Paused " .. file .. " " .. line .. " " .. idx_watch .. "\n") - elseif ev == events.RESTART then - -- nothing to do - else - server:send("401 Error in Execution " .. #file .. "\n") - server:send(file) - end - elseif command == "STEP" then - server:send("200 OK\n") - step_into = true - - local ev, vars, file, line, idx_watch = coroutine.yield() - eval_env = vars - if ev == events.BREAK then - server:send("202 Paused " .. file .. " " .. line .. "\n") - elseif ev == events.WATCH then - server:send("203 Paused " .. file .. " " .. line .. " " .. idx_watch .. "\n") - elseif ev == events.RESTART then - -- nothing to do - else - server:send("401 Error in Execution " .. #file .. "\n") - server:send(file) - end - elseif command == "OVER" or command == "OUT" then - server:send("200 OK\n") - step_over = true - - -- OVER and OUT are very similar except for - -- the stack level value at which to stop - if command == "OUT" then step_level = stack_level - 1 - else step_level = stack_level end - - local ev, vars, file, line, idx_watch = coroutine.yield() - eval_env = vars - if ev == events.BREAK then - server:send("202 Paused " .. file .. " " .. line .. "\n") - elseif ev == events.WATCH then - server:send("203 Paused " .. file .. " " .. line .. " " .. idx_watch .. "\n") - elseif ev == events.RESTART then - -- nothing to do - else - server:send("401 Error in Execution " .. #file .. "\n") - server:send(file) - end - elseif command == "BASEDIR" then - local _, _, dir = string.find(line, "^[A-Z]+%s+(.+)%s*$") - if dir then - basedir = iscasepreserving and string.lower(dir) or dir - -- reset cached source as it may change with basedir - lastsource = nil - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "SUSPEND" then - -- do nothing; it already fulfilled its role - elseif command == "STACK" then - -- first check if we can execute the stack command - -- as it requires yielding back to debug_hook it cannot be executed - -- if we have not seen the hook yet as happens after start(). - -- in this case we simply return an empty result - local vars, ev = {} - if seen_hook then - ev, vars = coroutine.yield("stack") - end - if ev and ev ~= events.STACK then - server:send("401 Error in Execution " .. #vars .. "\n") - server:send(vars) - else - local ok, res = pcall(serpent.dump, vars, {nocode = true, sparse = false}) - if ok then - server:send("200 OK " .. res .. "\n") - else - server:send("401 Error in Execution " .. #res .. "\n") - server:send(res) - end - end - elseif command == "OUTPUT" then - local _, _, stream, mode = string.find(line, "^[A-Z]+%s+(%w+)%s+([dcr])%s*$") - if stream and mode and stream == "stdout" then - -- assign "print" in the global environment - genv.print = mode == 'd' and iobase.print or coroutine.wrap(function(...) - -- wrapping into coroutine.wrap protects this function from - -- being stepped through in the debugger - local tbl = {...} - while true do - if mode == 'c' then iobase.print(unpack(tbl)) end - for n = 1, #tbl do - tbl[n] = select(2, pcall(serpent.line, tbl[n], {nocode = true, comment = false})) end - local file = table.concat(tbl, "\t").."\n" - server:send("204 Output " .. stream .. " " .. #file .. "\n" .. file) - tbl = {coroutine.yield()} - end - end) - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "EXIT" then - server:send("200 OK\n") - coroutine.yield("exit") - else - server:send("400 Bad Request\n") - end - end -end - -local function connect(controller_host, controller_port) - return (socket.connect4 or socket.connect)(controller_host, controller_port) -end - -local function isrunning() - return coro_debugger and coroutine.status(coro_debugger) == 'suspended' -end - -local lasthost, lastport - --- Starts a debug session by connecting to a controller -local function start(controller_host, controller_port) - -- only one debugging session can be run (as there is only one debug hook) - if isrunning() then return end - - lasthost = controller_host or lasthost - lastport = controller_port or lastport - - controller_host = lasthost or "localhost" - controller_port = lastport or mobdebug.port - - local err - server, err = (socket.connect4 or socket.connect)(controller_host, controller_port) - if server then - -- correct stack depth which already has some calls on it - -- so it doesn't go into negative when those calls return - -- as this breaks subsequence checks in stack_depth(). - -- start from 16th frame, which is sufficiently large for this check. - stack_level = stack_depth(16) - - -- provide our own traceback function to report the error remotely - do - local dtraceback = debug.traceback - debug.traceback = function (...) - if select('#', ...) >= 1 then - local err, lvl = ... - if err and type(err) ~= 'thread' then - local trace = dtraceback(err, (lvl or 2)+1) - if genv.print == iobase.print then -- no remote redirect - return trace - else - genv.print(trace) -- report the error remotely - return -- don't report locally to avoid double reporting - end - end - end - -- direct call to debug.traceback: return the original. - -- debug.traceback(nil, level) doesn't work in Lua 5.1 - -- (http://lua-users.org/lists/lua-l/2011-06/msg00574.html), so - -- simply remove first frame from the stack trace - return (dtraceback(...):gsub("(stack traceback:\n)[^\n]*\n", "%1")) - end - end - coro_debugger = coroutine.create(debugger_loop) - debug.sethook(debug_hook, "lcr") - seen_hook = nil -- reset in case the last start() call was refused - step_into = true -- start with step command - return true - else - print(("Could not connect to %s:%s: %s") - :format(controller_host, controller_port, err or "unknown error")) - end -end - -local function controller(controller_host, controller_port, scratchpad) - -- only one debugging session can be run (as there is only one debug hook) - if isrunning() then return end - - lasthost = controller_host or lasthost - lastport = controller_port or lastport - - controller_host = lasthost or "localhost" - controller_port = lastport or mobdebug.port - - local exitonerror = not scratchpad - local err - server, err = (socket.connect4 or socket.connect)(controller_host, controller_port) - if server then - local function report(trace, err) - local msg = err .. "\n" .. trace - server:send("401 Error in Execution " .. #msg .. "\n") - server:send(msg) - return err - end - - seen_hook = true -- allow to accept all commands - coro_debugger = coroutine.create(debugger_loop) - - while true do - step_into = true -- start with step command - abort = false -- reset abort flag from the previous loop - if scratchpad then checkcount = mobdebug.checkcount end -- force suspend right away - - coro_debugee = coroutine.create(debugee) - debug.sethook(coro_debugee, debug_hook, "lcr") - local status, err = coroutine.resume(coro_debugee) - - -- was there an error or is the script done? - -- 'abort' state is allowed here; ignore it - if abort then - if tostring(abort) == 'exit' then break end - else - if status then -- normal execution is done - break - elseif err and not tostring(err):find(deferror) then - -- report the error back - -- err is not necessarily a string, so convert to string to report - report(debug.traceback(coro_debugee), tostring(err)) - if exitonerror then break end - -- resume once more to clear the response the debugger wants to send - -- need to use capture_vars(2) as three would be the level of - -- the caller for controller(), but because of the tail call, - -- the caller may not exist; - -- This is not entirely safe as the user may see the local - -- variable from console, but they will be reset anyway. - -- This functionality is used when scratchpad is paused to - -- gain access to remote console to modify global variables. - local status, err = coroutine.resume(coro_debugger, events.RESTART, capture_vars(2)) - if not status or status and err == "exit" then break end - end - end - end - else - print(("Could not connect to %s:%s: %s") - :format(controller_host, controller_port, err or "unknown error")) - return false - end - return true -end - -local function scratchpad(controller_host, controller_port) - return controller(controller_host, controller_port, true) -end - -local function loop(controller_host, controller_port) - return controller(controller_host, controller_port, false) -end - -local function on() - if not (isrunning() and server) then return end - - -- main is set to true under Lua5.2 for the "main" chunk. - -- Lua5.1 returns co as `nil` in that case. - local co, main = coroutine.running() - if main then co = nil end - if co then - coroutines[co] = true - debug.sethook(co, debug_hook, "lcr") - else - if jit then coroutines.main = true end - debug.sethook(debug_hook, "lcr") - end -end - -local function off() - if not (isrunning() and server) then return end - - -- main is set to true under Lua5.2 for the "main" chunk. - -- Lua5.1 returns co as `nil` in that case. - local co, main = coroutine.running() - if main then co = nil end - - -- don't remove coroutine hook under LuaJIT as there is only one (global) hook - if co then - coroutines[co] = false - if not jit then debug.sethook(co) end - else - if jit then coroutines.main = false end - if not jit then debug.sethook() end - end - - -- check if there is any thread that is still being debugged under LuaJIT; - -- if not, turn the debugging off - if jit then - local remove = true - for co, debugged in pairs(coroutines) do - if debugged then remove = false; break end - end - if remove then debug.sethook() end - end -end - --- Handles server debugging commands -local function handle(params, client, options) - local _, _, command = string.find(params, "^([a-z]+)") - local file, line, watch_idx - if command == "run" or command == "step" or command == "out" - or command == "over" or command == "exit" then - client:send(string.upper(command) .. "\n") - client:receive() -- this should consume the first '200 OK' response - while true do - local done = true - local breakpoint = client:receive() - if not breakpoint then - print("Program finished") - os.exit() - return -- use return here for those cases where os.exit() is not wanted - end - local _, _, status = string.find(breakpoint, "^(%d+)") - if status == "200" then - -- don't need to do anything - elseif status == "202" then - _, _, file, line = string.find(breakpoint, "^202 Paused%s+(.-)%s+(%d+)%s*$") - if file and line then - print("Paused at file " .. file .. " line " .. line) - end - elseif status == "203" then - _, _, file, line, watch_idx = string.find(breakpoint, "^203 Paused%s+(.-)%s+(%d+)%s+(%d+)%s*$") - if file and line and watch_idx then - print("Paused at file " .. file .. " line " .. line .. " (watch expression " .. watch_idx .. ": [" .. watches[watch_idx] .. "])") - end - elseif status == "204" then - local _, _, stream, size = string.find(breakpoint, "^204 Output (%w+) (%d+)$") - if stream and size then - local msg = client:receive(tonumber(size)) - print(msg) - if outputs[stream] then outputs[stream](msg) end - -- this was just the output, so go back reading the response - done = false - end - elseif status == "401" then - local _, _, size = string.find(breakpoint, "^401 Error in Execution (%d+)$") - if size then - local msg = client:receive(tonumber(size)) - print("Error in remote application: " .. msg) - os.exit(1) - return nil, nil, msg -- use return here for those cases where os.exit() is not wanted - end - else - print("Unknown error") - os.exit(1) - -- use return here for those cases where os.exit() is not wanted - return nil, nil, "Debugger error: unexpected response '" .. breakpoint .. "'" - end - if done then break end - end - elseif command == "setb" then - _, _, _, file, line = string.find(params, "^([a-z]+)%s+(.-)%s+(%d+)%s*$") - if file and line then - -- if this is a file name, and not a file source - if not file:find('^".*"$') then - file = string.gsub(file, "\\", "/") -- convert slash - file = removebasedir(file, basedir) - end - client:send("SETB " .. file .. " " .. line .. "\n") - if client:receive() == "200 OK" then - set_breakpoint(file, line) - else - print("Error: breakpoint not inserted") - end - else - print("Invalid command") - end - elseif command == "setw" then - local _, _, exp = string.find(params, "^[a-z]+%s+(.+)$") - if exp then - client:send("SETW " .. exp .. "\n") - local answer = client:receive() - local _, _, watch_idx = string.find(answer, "^200 OK (%d+)%s*$") - if watch_idx then - watches[watch_idx] = exp - print("Inserted watch exp no. " .. watch_idx) - else - local _, _, size = string.find(answer, "^401 Error in Expression (%d+)$") - if size then - local err = client:receive(tonumber(size)):gsub(".-:%d+:%s*","") - print("Error: watch expression not set: " .. err) - else - print("Error: watch expression not set") - end - end - else - print("Invalid command") - end - elseif command == "delb" then - _, _, _, file, line = string.find(params, "^([a-z]+)%s+(.-)%s+(%d+)%s*$") - if file and line then - -- if this is a file name, and not a file source - if not file:find('^".*"$') then - file = string.gsub(file, "\\", "/") -- convert slash - file = removebasedir(file, basedir) - end - client:send("DELB " .. file .. " " .. line .. "\n") - if client:receive() == "200 OK" then - remove_breakpoint(file, line) - else - print("Error: breakpoint not removed") - end - else - print("Invalid command") - end - elseif command == "delallb" then - for line, breaks in pairs(breakpoints) do - for file, _ in pairs(breaks) do - client:send("DELB " .. file .. " " .. line .. "\n") - if client:receive() == "200 OK" then - remove_breakpoint(file, line) - else - print("Error: breakpoint at file " .. file .. " line " .. line .. " not removed") - end - end - end - elseif command == "delw" then - local _, _, index = string.find(params, "^[a-z]+%s+(%d+)%s*$") - if index then - client:send("DELW " .. index .. "\n") - if client:receive() == "200 OK" then - watches[index] = nil - else - print("Error: watch expression not removed") - end - else - print("Invalid command") - end - elseif command == "delallw" then - for index, exp in pairs(watches) do - client:send("DELW " .. index .. "\n") - if client:receive() == "200 OK" then - watches[index] = nil - else - print("Error: watch expression at index " .. index .. " [" .. exp .. "] not removed") - end - end - elseif command == "eval" or command == "exec" - or command == "load" or command == "loadstring" - or command == "reload" then - local _, _, exp = string.find(params, "^[a-z]+%s+(.+)$") - if exp or (command == "reload") then - if command == "eval" or command == "exec" then - exp = (exp:gsub("%-%-%[(=*)%[.-%]%1%]", "") -- remove comments - :gsub("%-%-.-\n", " ") -- remove line comments - :gsub("\n", " ")) -- convert new lines - if command == "eval" then exp = "return " .. exp end - client:send("EXEC " .. exp .. "\n") - elseif command == "reload" then - client:send("LOAD 0 -\n") - elseif command == "loadstring" then - local _, _, _, file, lines = string.find(exp, "^([\"'])(.-)%1%s+(.+)") - if not file then - _, _, file, lines = string.find(exp, "^(%S+)%s+(.+)") - end - client:send("LOAD " .. #lines .. " " .. file .. "\n") - client:send(lines) - else - local file = io.open(exp, "r") - if not file and pcall(require, "winapi") then - -- if file is not open and winapi is there, try with a short path; - -- this may be needed for unicode paths on windows - winapi.set_encoding(winapi.CP_UTF8) - file = io.open(winapi.short_path(exp), "r") - end - if not file then error("Cannot open file " .. exp) end - -- read the file and remove the shebang line as it causes a compilation error - local lines = file:read("*all"):gsub("^#!.-\n", "\n") - file:close() - - local file = string.gsub(exp, "\\", "/") -- convert slash - file = removebasedir(file, basedir) - client:send("LOAD " .. #lines .. " " .. file .. "\n") - if #lines > 0 then client:send(lines) end - end - while true do - local params, err = client:receive() - if not params then - return nil, nil, "Debugger connection " .. (err or "error") - end - local done = true - local _, _, status, len = string.find(params, "^(%d+).-%s+(%d+)%s*$") - if status == "200" then - len = tonumber(len) - if len > 0 then - local status, res - local str = client:receive(len) - -- handle serialized table with results - local func, err = loadstring(str) - if func then - status, res = pcall(func) - if not status then err = res - elseif type(res) ~= "table" then - err = "received "..type(res).." instead of expected 'table'" - end - end - if err then - print("Error in processing results: " .. err) - return nil, nil, "Error in processing results: " .. err - end - print(unpack(res)) - return res[1], res - end - elseif status == "201" then - _, _, file, line = string.find(params, "^201 Started%s+(.-)%s+(%d+)%s*$") - elseif status == "202" or params == "200 OK" then - -- do nothing; this only happens when RE/LOAD command gets the response - -- that was for the original command that was aborted - elseif status == "204" then - local _, _, stream, size = string.find(params, "^204 Output (%w+) (%d+)$") - if stream and size then - local msg = client:receive(tonumber(size)) - print(msg) - if outputs[stream] then outputs[stream](msg) end - -- this was just the output, so go back reading the response - done = false - end - elseif status == "401" then - len = tonumber(len) - local res = client:receive(len) - print("Error in expression: " .. res) - return nil, nil, res - else - print("Unknown error") - return nil, nil, "Debugger error: unexpected response after EXEC/LOAD '" .. params .. "'" - end - if done then break end - end - else - print("Invalid command") - end - elseif command == "listb" then - for l, v in pairs(breakpoints) do - for f in pairs(v) do - print(f .. ": " .. l) - end - end - elseif command == "listw" then - for i, v in pairs(watches) do - print("Watch exp. " .. i .. ": " .. v) - end - elseif command == "suspend" then - client:send("SUSPEND\n") - elseif command == "stack" then - client:send("STACK\n") - local resp = client:receive() - local _, _, status, res = string.find(resp, "^(%d+)%s+%w+%s+(.+)%s*$") - if status == "200" then - local func, err = loadstring(res) - if func == nil then - print("Error in stack information: " .. err) - return nil, nil, err - end - local ok, stack = pcall(func) - if not ok then - print("Error in stack information: " .. stack) - return nil, nil, stack - end - for _,frame in ipairs(stack) do - print(serpent.line(frame[1], {comment = false})) - end - return stack - elseif status == "401" then - local _, _, len = string.find(resp, "%s+(%d+)%s*$") - len = tonumber(len) - local res = len > 0 and client:receive(len) or "Invalid stack information." - print("Error in expression: " .. res) - return nil, nil, res - else - print("Unknown error") - return nil, nil, "Debugger error: unexpected response after STACK" - end - elseif command == "output" then - local _, _, stream, mode = string.find(params, "^[a-z]+%s+(%w+)%s+([dcr])%s*$") - if stream and mode then - client:send("OUTPUT "..stream.." "..mode.."\n") - local resp = client:receive() - local _, _, status = string.find(resp, "^(%d+)%s+%w+%s*$") - if status == "200" then - print("Stream "..stream.." redirected") - outputs[stream] = type(options) == 'table' and options.handler or nil - else - print("Unknown error") - return nil, nil, "Debugger error: can't redirect "..stream - end - else - print("Invalid command") - end - elseif command == "basedir" then - local _, _, dir = string.find(params, "^[a-z]+%s+(.+)$") - if dir then - dir = string.gsub(dir, "\\", "/") -- convert slash - if not string.find(dir, "/$") then dir = dir .. "/" end - - local remdir = dir:match("\t(.+)") - if remdir then dir = dir:gsub("/?\t.+", "/") end - basedir = dir - - client:send("BASEDIR "..(remdir or dir).."\n") - local resp = client:receive() - local _, _, status = string.find(resp, "^(%d+)%s+%w+%s*$") - if status == "200" then - print("New base directory is " .. basedir) - else - print("Unknown error") - return nil, nil, "Debugger error: unexpected response after BASEDIR" - end - else - print(basedir) - end - elseif command == "help" then - print("setb -- sets a breakpoint") - print("delb -- removes a breakpoint") - print("delallb -- removes all breakpoints") - print("setw -- adds a new watch expression") - print("delw -- removes the watch expression at index") - print("delallw -- removes all watch expressions") - print("run -- runs until next breakpoint") - print("step -- runs until next line, stepping into function calls") - print("over -- runs until next line, stepping over function calls") - print("out -- runs until line after returning from current function") - print("listb -- lists breakpoints") - print("listw -- lists watch expressions") - print("eval -- evaluates expression on the current context and returns its value") - print("exec -- executes statement on the current context") - print("load -- loads a local file for debugging") - print("reload -- restarts the current debugging session") - print("stack -- reports stack trace") - print("output stdout -- capture and redirect io stream (default|copy|redirect)") - print("basedir [] -- sets the base path of the remote application, or shows the current one") - print("exit -- exits debugger") - else - local _, _, spaces = string.find(params, "^(%s*)$") - if not spaces then - print("Invalid command") - return nil, nil, "Invalid command" - end - end - return file, line -end - --- Starts debugging server -local function listen(host, port) - host = host or "*" - port = port or mobdebug.port - - local socket = require "socket" - - print("Lua Remote Debugger") - print("Run the program you wish to debug") - - local server = socket.bind(host, port) - local client = server:accept() - - client:send("STEP\n") - client:receive() - - local breakpoint = client:receive() - local _, _, file, line = string.find(breakpoint, "^202 Paused%s+(.-)%s+(%d+)%s*$") - if file and line then - print("Paused at file " .. file ) - print("Type 'help' for commands") - else - local _, _, size = string.find(breakpoint, "^401 Error in Execution (%d+)%s*$") - if size then - print("Error in remote application: ") - print(client:receive(size)) - end - end - - while true do - io.write("> ") - local line = io.read("*line") - handle(line, client) - end -end - -local cocreate -local function coro() - if cocreate then return end -- only set once - cocreate = cocreate or coroutine.create - coroutine.create = function(f, ...) - return cocreate(function(...) - require("mobdebug").on() - return f(...) - end, ...) - end -end - -local moconew -local function moai() - if moconew then return end -- only set once - moconew = moconew or (MOAICoroutine and MOAICoroutine.new) - if not moconew then return end - MOAICoroutine.new = function(...) - local thread = moconew(...) - -- need to support both thread.run and getmetatable(thread).run, which - -- was used in earlier MOAI versions - local mt = thread.run and thread or getmetatable(thread) - local patched = mt.run - mt.run = function(self, f, ...) - return patched(self, function(...) - require("mobdebug").on() - return f(...) - end, ...) - end - return thread - end -end - --- this is a function that removes all hooks and closes the socket to --- report back to the controller that the debugging is done. --- the script that called `done` can still continue. -local function done() - if not (isrunning() and server) then return end - - if not jit then - for co, debugged in pairs(coroutines) do - if debugged then debug.sethook(co) end - end - end - - debug.sethook() - server:close() - - coro_debugger = nil -- to make sure isrunning() returns `false` - seen_hook = nil -- to make sure that the next start() call works - abort = nil -- to make sure that callback calls use proper "abort" value -end - --- make public functions available -mobdebug.listen = listen -mobdebug.loop = loop -mobdebug.scratchpad = scratchpad -mobdebug.handle = handle -mobdebug.connect = connect -mobdebug.start = start -mobdebug.on = on -mobdebug.off = off -mobdebug.moai = moai -mobdebug.coro = coro -mobdebug.done = done -mobdebug.line = serpent.line -mobdebug.dump = serpent.dump -mobdebug.yield = nil -- callback - --- this is needed to make "require 'modebug'" to work when mobdebug --- module is loaded manually -package.loaded.mobdebug = mobdebug - -return mobdebug