From 99206af7376227497e7611a2e34e7632c38b75cb Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 4 Jul 2017 16:35:17 +0800 Subject: [PATCH 1/4] Remove useless module and preprocess macros --- native/cocos/2d/libcocos2d.vcxproj | 4 +- native/cocos/Android.mk | 5 +- native/templates/cocos2dx_files.json | 4 - .../app/jni/Application.mk | 2 +- .../proj.android/jni/Application.mk | 2 +- .../HelloJavascript.xcodeproj/project.pbxproj | 2 - .../proj.win32/HelloJavascript.vcxproj | 4 +- .../app/jni/Application.mk | 2 +- .../proj.android/jni/Application.mk | 2 +- .../HelloJavascript.xcodeproj/project.pbxproj | 4 - .../proj.win32/HelloJavascript.vcxproj | 4 +- .../app/jni/Application.mk | 2 +- .../proj.android/jni/Application.mk | 2 +- .../HelloJavascript.xcodeproj/project.pbxproj | 4 - .../proj.win32/HelloJavascript.vcxproj | 4 +- .../Classes/ide-support/CodeIDESupport.h | 7 - .../Classes/ide-support/RuntimeJsImpl.cpp | 309 ------------------ .../Classes/ide-support/RuntimeJsImpl.h | 39 --- .../runtime-src/Classes/ide-support/lang | 31 -- .../proj.android-studio/app/jni/Android.mk | 11 +- .../app/jni/Application.mk | 2 +- .../runtime-src/proj.android/jni/Android.mk | 5 - .../proj.android/jni/Application.mk | 2 +- .../proj.android/jni/hellolua/main.cpp | 1 - .../proj.ios_mac/mac/SimulatorApp.mm | 1 - .../simulator.xcodeproj/project.pbxproj | 15 - .../libsimulator.xcodeproj/project.pbxproj | 3 - 27 files changed, 19 insertions(+), 454 deletions(-) delete mode 100755 native/tools/simulator/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h delete mode 100755 native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp delete mode 100755 native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.h delete mode 100755 native/tools/simulator/frameworks/runtime-src/Classes/ide-support/lang diff --git a/native/cocos/2d/libcocos2d.vcxproj b/native/cocos/2d/libcocos2d.vcxproj index ad20d2bd2d..c44cb7c6b5 100644 --- a/native/cocos/2d/libcocos2d.vcxproj +++ b/native/cocos/2d/libcocos2d.vcxproj @@ -80,7 +80,7 @@ Disabled $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories) - WIN32;_USRDLL;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;PROTOBUF_USE_DLLS;LIBPROTOBUF_EXPORTS;%(PreprocessorDefinitions) + WIN32;_USRDLL;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;PROTOBUF_USE_DLLS;LIBPROTOBUF_EXPORTS;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -121,7 +121,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32\libs\Debug\*.*" "$(OutDir)" $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\win32\include\zlib;$(EngineRoot)external\win32\include\freetype2;$(EngineRoot);%(AdditionalIncludeDirectories) - WIN32;_USRDLL;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;PROTOBUF_USE_DLLS;LIBPROTOBUF_EXPORTS;%(PreprocessorDefinitions) + WIN32;_USRDLL;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;PROTOBUF_USE_DLLS;LIBPROTOBUF_EXPORTS;%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/native/cocos/Android.mk b/native/cocos/Android.mk index dea60fc1ee..dc9feae3c3 100644 --- a/native/cocos/Android.mk +++ b/native/cocos/Android.mk @@ -280,8 +280,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := cocos2dx_static LOCAL_MODULE_FILENAME := libcocos2d -LOCAL_STATIC_LIBRARIES := cocostudio_static -LOCAL_STATIC_LIBRARIES += cocosbuilder_static +LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static LOCAL_STATIC_LIBRARIES += spine_static LOCAL_STATIC_LIBRARIES += dragonbones_static LOCAL_STATIC_LIBRARIES += creator_static @@ -293,8 +292,6 @@ include $(BUILD_STATIC_LIBRARY) #============================================================== #$(call import-module,.) $(call import-module,android) -$(call import-module,editor-support/cocostudio) -$(call import-module,editor-support/cocosbuilder) $(call import-module,editor-support/dragonbones/proj.android) $(call import-module,editor-support/spine) $(call import-module,editor-support/creator) diff --git a/native/templates/cocos2dx_files.json b/native/templates/cocos2dx_files.json index 42dfb5d2ca..95f152a43c 100644 --- a/native/templates/cocos2dx_files.json +++ b/native/templates/cocos2dx_files.json @@ -4407,10 +4407,6 @@ "tools/simulator/config.json", "tools/simulator/frameworks/runtime-src/Classes/AppDelegate.cpp", "tools/simulator/frameworks/runtime-src/Classes/AppDelegate.h", - "tools/simulator/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h", - "tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp", - "tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.h", - "tools/simulator/frameworks/runtime-src/Classes/ide-support/lang", "tools/simulator/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml", "tools/simulator/frameworks/runtime-src/proj.android-studio/app/build.gradle", "tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk", diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk b/native/templates/js-template-binary/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk index 26f53a1cfe..49248f8139 100755 --- a/native/templates/js-template-binary/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk +++ b/native/templates/js-template-binary/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk @@ -3,7 +3,7 @@ APP_STL := gnustl_static # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices APP_ABI := armeabi-v7a -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char -DPACKAGE_AS +APP_CPPFLAGS := -frtti -std=c++11 -fsigned-char -DPACKAGE_AS APP_LDFLAGS := -latomic # To solve windows commands char length too long diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/jni/Application.mk b/native/templates/js-template-binary/frameworks/runtime-src/proj.android/jni/Application.mk index 26f53a1cfe..49248f8139 100755 --- a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/jni/Application.mk +++ b/native/templates/js-template-binary/frameworks/runtime-src/proj.android/jni/Application.mk @@ -3,7 +3,7 @@ APP_STL := gnustl_static # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices APP_ABI := armeabi-v7a -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char -DPACKAGE_AS +APP_CPPFLAGS := -frtti -std=c++11 -fsigned-char -DPACKAGE_AS APP_LDFLAGS := -latomic # To solve windows commands char length too long diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/native/templates/js-template-binary/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj index 919dfe9c93..932adf6f2a 100755 --- a/native/templates/js-template-binary/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj +++ b/native/templates/js-template-binary/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -614,7 +614,6 @@ "COCOS2D_DEBUG=1", USE_FILE32API, COCOS2D_JAVASCRIPT, - CC_ENABLE_CHIPMUNK_INTEGRATION, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -638,7 +637,6 @@ NDEBUG, USE_FILE32API, COCOS2D_JAVASCRIPT, - CC_ENABLE_CHIPMUNK_INTEGRATION, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj b/native/templates/js-template-binary/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj index 954d045802..0be1d5988b 100755 --- a/native/templates/js-template-binary/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj +++ b/native/templates/js-template-binary/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj @@ -92,7 +92,7 @@ Disabled $(ProjectDir)..\Classes;$(ProjectDir)..\Classes\service;$(COCOS_X_ROOT)\tools\simulator\libsimulator\lib\runtime;$(COCOS_X_ROOT)\tools\simulator\libsimulator\lib\protobuf-lite;$(COCOS_X_ROOT)\external\win32-specific\zlib\include;$(COCOS_X_ROOT)\tools\simulator\libsimulator\proj.win32;$(COCOS_X_ROOT)\tools\simulator\libsimulator\lib;$(COCOS_X_ROOT)\;$(COCOS_X_ROOT)\cocos;$(COCOS_X_ROOT)\cocos\base;$(COCOS_X_ROOT)\external;$(COCOS_X_ROOT)\cocos\storage;$(COCOS_X_ROOT)\cocos\editor-support;$(COCOS_X_ROOT)\cocos\scripting\js-bindings\auto;$(COCOS_X_ROOT)\cocos\scripting\js-bindings\manual;$(COCOS_X_ROOT)\cocos\audio\include;$(COCOS_X_ROOT)\external\win32\include\spidermonkey;$(COCOS_X_ROOT)\external\win32\include\chipmunk;$(COCOS_X_ROOT)\external\win32\include\curl;$(COCOS_X_ROOT)\external\win32\include\glfw3;$(COCOS_X_ROOT)\extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDLL @@ -163,7 +163,7 @@ copy "$(ProjectDir)..\..\..\project.json" "$(LocalDebuggerWorkingDirectory)" /Y< $(ProjectDir)..\Classes;$(ProjectDir)..\Classes\service;$(COCOS_X_ROOT)\tools\simulator\libsimulator\lib\runtime;$(COCOS_X_ROOT)\tools\simulator\libsimulator\lib\protobuf-lite;$(COCOS_X_ROOT)\external\win32-specific\zlib\include;$(COCOS_X_ROOT)\tools\simulator\libsimulator\proj.win32;$(COCOS_X_ROOT)\tools\simulator\libsimulator\lib;$(COCOS_X_ROOT)\;$(COCOS_X_ROOT)\cocos;$(COCOS_X_ROOT)\cocos\base;$(COCOS_X_ROOT)\external;$(COCOS_X_ROOT)\cocos\storage;$(COCOS_X_ROOT)\cocos\editor-support;$(COCOS_X_ROOT)\cocos\scripting\js-bindings\auto;$(COCOS_X_ROOT)\cocos\scripting\js-bindings\manual;$(COCOS_X_ROOT)\cocos\audio\include;$(COCOS_X_ROOT)\external\win32\include\spidermonkey;$(COCOS_X_ROOT)\external\win32\include\chipmunk;$(COCOS_X_ROOT)\external\win32\include\glfw3;$(COCOS_X_ROOT)\external\win32\include\curl;$(COCOS_X_ROOT)\extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk index d9892dbbbe..74f803302d 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk @@ -3,7 +3,7 @@ APP_STL := gnustl_static # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices APP_ABI := armeabi-v7a -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char -DPACKAGE_AS +APP_CPPFLAGS := -frtti -std=c++11 -fsigned-char -DPACKAGE_AS APP_LDFLAGS := -latomic # To solve windows commands char length too long diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Application.mk b/native/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Application.mk index d9892dbbbe..74f803302d 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Application.mk +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Application.mk @@ -3,7 +3,7 @@ APP_STL := gnustl_static # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices APP_ABI := armeabi-v7a -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char -DPACKAGE_AS +APP_CPPFLAGS := -frtti -std=c++11 -fsigned-char -DPACKAGE_AS APP_LDFLAGS := -latomic # To solve windows commands char length too long diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/native/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj index fdba4cc791..6e995a8d19 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -904,8 +904,6 @@ "COCOS2D_DEBUG=1", USE_FILE32API, COCOS2D_JAVASCRIPT, - "CC_ENABLE_BULLET_INTEGRATION=1", - CC_ENABLE_CHIPMUNK_INTEGRATION, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -929,8 +927,6 @@ NDEBUG, USE_FILE32API, COCOS2D_JAVASCRIPT, - CC_ENABLE_CHIPMUNK_INTEGRATION, - "CC_ENABLE_BULLET_INTEGRATION=1", ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj b/native/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj index d8d52a2654..ed748c3520 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj @@ -86,7 +86,7 @@ Disabled $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\js-bindings\auto;$(EngineRoot)cocos\scripting\js-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\win32\include\;$(EngineRoot)external\win32\include\spidermonkey;$(EngineRoot)external\win32\include\chipmunk;$(EngineRoot)external\win32\include\glfw3;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -148,7 +148,7 @@ copy "$(ProjectDir)..\..\..\project.json" "$(OutDir)\" /Y $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\js-bindings\auto;$(EngineRoot)cocos\scripting\js-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\win32\include\spidermonkey;$(EngineRoot)external\win32\include\chipmunk;$(EngineRoot)external\win32\include;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk index d9892dbbbe..74f803302d 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk @@ -3,7 +3,7 @@ APP_STL := gnustl_static # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices APP_ABI := armeabi-v7a -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char -DPACKAGE_AS +APP_CPPFLAGS := -frtti -std=c++11 -fsigned-char -DPACKAGE_AS APP_LDFLAGS := -latomic # To solve windows commands char length too long diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/jni/Application.mk b/native/templates/js-template-link/frameworks/runtime-src/proj.android/jni/Application.mk index d9892dbbbe..74f803302d 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android/jni/Application.mk +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android/jni/Application.mk @@ -3,7 +3,7 @@ APP_STL := gnustl_static # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices APP_ABI := armeabi-v7a -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char -DPACKAGE_AS +APP_CPPFLAGS := -frtti -std=c++11 -fsigned-char -DPACKAGE_AS APP_LDFLAGS := -latomic # To solve windows commands char length too long diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/native/templates/js-template-link/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj index be996c2a2b..14a82eb56a 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -706,8 +706,6 @@ "COCOS2D_DEBUG=1", USE_FILE32API, COCOS2D_JAVASCRIPT, - "CC_ENABLE_BULLET_INTEGRATION=1", - CC_ENABLE_CHIPMUNK_INTEGRATION, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -731,8 +729,6 @@ NDEBUG, USE_FILE32API, COCOS2D_JAVASCRIPT, - CC_ENABLE_CHIPMUNK_INTEGRATION, - "CC_ENABLE_BULLET_INTEGRATION=1", ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj b/native/templates/js-template-link/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj index 13be246613..71ed699589 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj @@ -86,7 +86,7 @@ Disabled $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\js-bindings\auto;$(EngineRoot)cocos\scripting\js-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\win32\include\;$(EngineRoot)external\win32\include\spidermonkey;$(EngineRoot)external\win32\include\chipmunk;$(EngineRoot)external\win32\include\glfw3;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -148,7 +148,7 @@ copy "$(ProjectDir)..\..\..\project.json" "$(OutDir)\" /Y $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\js-bindings\auto;$(EngineRoot)cocos\scripting\js-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\win32\include\spidermonkey;$(EngineRoot)external\win32\include\chipmunk;$(EngineRoot)external\win32\include;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h deleted file mode 100755 index 3607d3c7b3..0000000000 --- a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __CODE_IDE_SUPPORT_H__ -#define __CODE_IDE_SUPPORT_H__ - -// define 1 to open Cocos Code IDE support, 0 to disable -#define CC_CODE_IDE_DEBUG_SUPPORT 1 - -#endif /* __CODE_IDE_SUPPORT_H__ */ diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp deleted file mode 100755 index bfb3f75650..0000000000 --- a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp +++ /dev/null @@ -1,309 +0,0 @@ -// -// RuntimeJsImpl.cpp -// Simulator -// -// - -#include "RuntimeJsImpl.h" - -#include "cocos2d.h" // 2dx engine - -#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) - -#include "runtime/ConfigParser.h" // config -#include "runtime/Runtime.h" -#include "runtime/FileServer.h" - -// js -#include "scripting/js-bindings/manual/ScriptingCore.h" -#include "js_module_register.h" - - -USING_NS_CC; - -static const char *RUNTIME_JS_BOOT_SCRIPT = "script/jsb_boot.js"; - -static bool reloadScript(const string& file) -{ - auto director = Director::getInstance(); - FontFNT::purgeCachedData(); - if (director->getOpenGLView()) - { - SpriteFrameCache::getInstance()->removeSpriteFrames(); - director->getTextureCache()->removeAllTextures(); - } - FileUtils::getInstance()->purgeCachedEntries(); - - //director->getScheduler()->unscheduleAll(); - //director->getScheduler()->scheduleUpdate(director->getActionManager(), Scheduler::PRIORITY_SYSTEM, false); - - string modulefile = file; - if (modulefile.empty()) - { - modulefile = ConfigParser::getInstance()->getEntryFile().c_str(); - } - - return ScriptingCore::getInstance()->runScript(modulefile.c_str()); -} - -bool runtime_FileUtils_addSearchPath(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "cocos2dx_FileUtils_addSearchPath : Invalid Native Object"); - if (argc == 1 || argc == 2) { - std::string arg0; - bool arg1 = false; - - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "cocos2dx_FileUtils_addSearchPath : Error processing arguments"); - - if (argc == 2) - { - arg1 = JS::ToBoolean(JS::RootedValue(cx, args.get(1))); - } - - if (! FileUtils::getInstance()->isAbsolutePath(arg0)) - { - // add write path to search path - if (FileServer::getShareInstance()->getIsUsingWritePath()) - { - cobj->addSearchPath(FileServer::getShareInstance()->getWritePath() + arg0, arg1); - } else - { - cobj->addSearchPath(arg0, arg1); - } - -#if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - // add project path to search path - cobj->addSearchPath(RuntimeEngine::getInstance()->getRuntime()->getProjectPath() + arg0, arg1); -#endif - } - - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "cocos2dx_FileUtils_addSearchPath : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool runtime_FileUtils_setSearchPaths(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_FileUtils_setSearchPaths : Invalid Native Object"); - if (argc == 1) { - std::vector vecPaths, writePaths; - ok &= jsval_to_std_vector_string(cx, args.get(0), &vecPaths); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FileUtils_setSearchPaths : Error processing arguments"); - - std::vector originPath; // for IOS platform. - std::vector projPath; // for Desktop platform. - for (int i = 0; i < vecPaths.size(); i++) - { - if (!FileUtils::getInstance()->isAbsolutePath(vecPaths[i])) - { - originPath.push_back(vecPaths[i]); // for IOS platform. - projPath.push_back(RuntimeEngine::getInstance()->getRuntime()->getProjectPath()+vecPaths[i]); //for Desktop platform. - writePaths.push_back(FileServer::getShareInstance()->getWritePath() + vecPaths[i]); - } - } - -#if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - vecPaths.insert(vecPaths.end(), projPath.begin(), projPath.end()); -#endif - if (FileServer::getShareInstance()->getIsUsingWritePath()) - { - vecPaths.insert(vecPaths.end(), writePaths.begin(), writePaths.end()); - } else - { - vecPaths.insert(vecPaths.end(), originPath.begin(), originPath.end()); - } - - cobj->setSearchPaths(vecPaths); - - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_FileUtils_setSearchPaths : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -void register_FileUtils(JSContext *cx, JS::HandleObject global) -{ - JS::RootedValue nsval(cx); - JS::RootedObject ns(cx); - JS_GetProperty(cx, global, "cc", &nsval); - if (nsval == JSVAL_VOID) { - return; - } - else { - ns.set(nsval.toObjectOrNull()); - } - JS::RootedObject proto(cx, get_jsb_cocos2d_FileUtils_prototype()); - JS_DefineFunction(cx, proto, "addSearchPath", runtime_FileUtils_addSearchPath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE); - JS_DefineFunction(cx, proto, "setSearchPaths", runtime_FileUtils_setSearchPaths, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE); -} - -RuntimeJsImpl* RuntimeJsImpl::create() -{ - RuntimeJsImpl *instance = new RuntimeJsImpl(); - return instance; -} - -bool RuntimeJsImpl::initJsEnv() -{ - if (_hasStarted) - { - return true; - } - - js_module_register(); - - ScriptingCore::getInstance()->addRegisterCallback(register_FileUtils); - ScriptingCore::getInstance()->start(); - _hasStarted = true; - - ScriptEngineProtocol *engine = ScriptingCore::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(engine); - - return true; -} - -bool RuntimeJsImpl::startWithDebugger() -{ - initJsEnv(); - - return true; -} - -void RuntimeJsImpl::startScript(const std::string& path) -{ - loadScriptFile(path); -} - -void RuntimeJsImpl::onStartDebuger(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse) -{ - if (loadScriptFile(ConfigParser::getInstance()->getEntryFile())) - { - dReplyParse.AddMember("code",0,dReplyParse.GetAllocator()); - } - else - { - dReplyParse.AddMember("code",1,dReplyParse.GetAllocator()); - } -} - -void RuntimeJsImpl::onClearCompile(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse) -{ - if (dArgParse.HasMember("modulefiles") && dArgParse["modulefiles"].Size() != 0) - { - const rapidjson::Value& objectfiles = dArgParse["modulefiles"]; - for (rapidjson::SizeType i = 0; i < objectfiles.Size(); i++) - { - ScriptingCore::getInstance()->cleanScript(objectfiles[i].GetString()); - } - } - else - { - std::unordered_map filenameScript = ScriptingCore::getInstance()->getFileScript(); - filenameScript.clear(); - } - - dReplyParse.AddMember("code",0,dReplyParse.GetAllocator()); -} - -void RuntimeJsImpl::onPrecompile(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse) -{ - const rapidjson::Value& objectfiles = dArgParse["modulefiles"]; - for (rapidjson::SizeType i = 0; i < objectfiles.Size(); i++) - { - ScriptingCore* sc = ScriptingCore::getInstance(); - JSContext* gc = sc->getGlobalContext(); - - sc->compileScript(objectfiles[i].GetString(), - JS::RootedObject(gc, sc->getGlobalObject()), - gc); - } - - dReplyParse.AddMember("code",0,dReplyParse.GetAllocator()); -} - -void RuntimeJsImpl::onReload(const rapidjson::Document &dArgParse, rapidjson::Document &dReplyParse) -{ - if (dArgParse.HasMember("modulefiles")){ - auto& allocator = dReplyParse.GetAllocator(); - rapidjson::Value bodyvalue(rapidjson::kObjectType); - const rapidjson::Value& objectfiles = dArgParse["modulefiles"]; - for (rapidjson::SizeType i = 0; i < objectfiles.Size(); i++){ - if (!reloadScript(objectfiles[i].GetString())) { - bodyvalue.AddMember(rapidjson::Value(objectfiles[i].GetString(), allocator) - , rapidjson::Value(1) - , allocator); - } - } - if (0 == objectfiles.Size()) - { - reloadScript(""); - } - dReplyParse.AddMember("body", bodyvalue, dReplyParse.GetAllocator()); - }else - { - reloadScript(""); - } - - dReplyParse.AddMember("code", 0, dReplyParse.GetAllocator()); -} - -void RuntimeJsImpl::onRemove(const std::string &filename) -{ - ScriptingCore::getInstance()->cleanScript(filename.c_str()); -} - -void RuntimeJsImpl::end() -{ - ScriptEngineManager::destroyInstance(); - RuntimeProtocol::end(); -} - -// private - -RuntimeJsImpl::RuntimeJsImpl() -: _hasStarted(false) -{ -} - -bool RuntimeJsImpl::loadScriptFile(const std::string& path) -{ - std::string filepath = path; - if (filepath.empty()) - { - filepath = ConfigParser::getInstance()->getEntryFile(); - } - CCLOG("------------------------------------------------"); - CCLOG("LOAD Js FILE: %s", filepath.c_str()); - CCLOG("------------------------------------------------"); - - initJsEnv(); - auto engine = ScriptingCore::getInstance(); - engine->runScript(RUNTIME_JS_BOOT_SCRIPT); - - // if (RuntimeEngine::getInstance()->getProjectConfig().getDebuggerType() != kCCRuntimeDebuggerNone) - // { - this->startWithDebugger(); - // } - - ScriptEngineManager::getInstance()->setScriptEngine(engine); - return ScriptingCore::getInstance()->runScript(filepath.c_str()); -} - - -#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) \ No newline at end of file diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.h b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.h deleted file mode 100755 index d324f3fea2..0000000000 --- a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// RuntimeJsImpl.h -// Simulator -// -// - -#ifndef __Simulator__RuntimeJsImpl__ -#define __Simulator__RuntimeJsImpl__ - -#include "CodeIDESupport.h" -#include "cocos2d.h" - -#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) -#include "runtime/RuntimeProtocol.h" - -class RuntimeJsImpl : public RuntimeProtocol -{ -public: - static RuntimeJsImpl* create(); - - void startScript(const std::string& file); - void onStartDebuger(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse); - void onClearCompile(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse); - void onPrecompile(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse); - void onReload(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse); - void onRemove(const std::string &filename); - void end(); - - bool startWithDebugger(); -private: - RuntimeJsImpl(); - bool initJsEnv(); - bool loadScriptFile(const std::string& file); - bool _hasStarted; -}; - -#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) - -#endif /* defined(__Simulator__RuntimeLua__) */ diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/lang b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/lang deleted file mode 100755 index d932059544..0000000000 --- a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/lang +++ /dev/null @@ -1,31 +0,0 @@ -{ - "zh-CN": { - "View": "视图(&V)", - "Exit": "退出(&X)", - "File": "文件(&F)", - "Portrait": "竖屏", - "Landscape": "横屏", - "Refresh": "刷新(重启)", - "Zoom Out": "缩放", - "Simulator": "模拟器", - "Open File": "打开文件", - "Open Project": "打开工程", - "Error": "错误", - "Help": "帮助(&H)", - "About": "关于(&A)", - "Show FPS": "显示FPS", - "Hide FPS": "隐藏FPS" - }, - "zh-Hans": { - "View": "视图", - "Exit": "退出", - "File": "文件", - "Portrait": "竖屏", - "Landscape": "横屏", - "Refresh": "刷新(重启)", - "Zoom Out": "缩放", - "Simulator": "模拟器", - "Help": "帮助(&H)", - "About": "关于(&A)" - } -} \ No newline at end of file diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk b/native/tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk index f5e8a600a7..00e2217cca 100755 --- a/native/tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk +++ b/native/tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk @@ -10,17 +10,10 @@ ifeq ($(COCOS_SIMULATOR_BUILD),1) LOCAL_ARM_MODE := arm endif -FILE_LIST := hellojavascript/main.cpp -FILE_LIST += $(wildcard $(LOCAL_PATH)/../../../Classes/*.cpp) -FILE_LIST += $(wildcard $(LOCAL_PATH)/../../../Classes/ide-support/*.cpp) -FILE_LIST += $(wildcard $(LOCAL_PATH)/../../../Classes/ide-support/*.c) - -LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) +LOCAL_SRC_FILES := hellojavascript/main.cpp \ + ../../../Classes/AppDelegate.cpp \ LOCAL_C_INCLUDES := \ -$(LOCAL_PATH)/../../../Classes/protobuf-lite \ -$(LOCAL_PATH)/../../../Classes/runtime \ -$(LOCAL_PATH)/../../../Classes/jsb \ $(LOCAL_PATH)/../../../Classes \ $(LOCAL_PATH)/../../../../../../../external \ $(LOCAL_PATH)/../../../../../../../tools/simulator/libsimulator/lib \ diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk b/native/tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk index 6bc8dd13cc..42107b7363 100755 --- a/native/tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk +++ b/native/tools/simulator/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk @@ -3,7 +3,7 @@ APP_STL := gnustl_static # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices APP_ABI := armeabi-v7a -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_CPPFLAGS := -frtti -std=c++11 -fsigned-char APP_LDFLAGS := -latomic # To solve windows commands char length too long diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk index 80916b2a18..b1b1a896a0 100755 --- a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk +++ b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk @@ -12,15 +12,10 @@ endif FILE_LIST := hellolua/main.cpp FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp) -FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/ide-support/*.cpp) -FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/ide-support/*.c) LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) LOCAL_C_INCLUDES := \ -$(LOCAL_PATH)/../../Classes/protobuf-lite \ -$(LOCAL_PATH)/../../Classes/runtime \ -$(LOCAL_PATH)/../../Classes/jsb \ $(LOCAL_PATH)/../../Classes \ $(LOCAL_PATH)/../../../../../../external \ $(LOCAL_PATH)/../../../../../../tools/simulator/libsimulator/lib \ diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Application.mk b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Application.mk index 5b147892ce..6d9ee09cb5 100755 --- a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Application.mk +++ b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Application.mk @@ -1,6 +1,6 @@ APP_STL := gnustl_static -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_CPPFLAGS := -frtti -std=c++11 -fsigned-char APP_LDFLAGS := -latomic # To solve windows commands char length too long diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp index ff9c646e95..2aea2f81c4 100755 --- a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp +++ b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp @@ -4,7 +4,6 @@ #include #include #include "runtime/ConfigParser.h" -#include "ide-support/CodeIDESupport.h" #define LOG_TAG "main" #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm index e564fd4ea7..bacecec60d 100755 --- a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm +++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm @@ -36,7 +36,6 @@ #include "runtime/ConfigParser.h" #include "cocos2d.h" -#include "CodeIDESupport.h" #include "platform/mac/PlayerMac.h" #include "AppEvent.h" diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj index 59b27ae00a..64ff9e328d 100755 --- a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj +++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj @@ -52,7 +52,6 @@ 9FB5D6081A691774002361CA /* libjscocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FB5D5D61A68FA00002361CA /* libjscocos2d iOS.a */; }; 9FB5D60A1A6917D8002361CA /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FB5D6091A6917D8002361CA /* libsqlite3.dylib */; }; 9FB5D60E1A691A02002361CA /* libjscocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FB5D5D41A68FA00002361CA /* libjscocos2d Mac.a */; }; - 9FB6C05F1A69815100945236 /* lang in Resources */ = {isa = PBXBuildFile; fileRef = 9FB6C0571A69815100945236 /* lang */; }; 9FD6FC0B1A5D27870028EDC6 /* libsimulator Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FD6FC081A5D26580028EDC6 /* libsimulator Mac.a */; settings = {ATTRIBUTES = (Required, ); }; }; 9FD6FC0C1A5D278E0028EDC6 /* libsimulator iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FD6FC0A1A5D26580028EDC6 /* libsimulator iOS.a */; }; 9FD6FC731A5D2A820028EDC6 /* ConsoleWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FD6FC711A5D2A820028EDC6 /* ConsoleWindowController.m */; }; @@ -207,8 +206,6 @@ 9FB5D5CE1A68F9FF002361CA /* cocos2d_js_bindings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_js_bindings.xcodeproj; path = "../../../../../cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj"; sourceTree = ""; }; 9FB5D5F81A691342002361CA /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; 9FB5D6091A6917D8002361CA /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/lib/libsqlite3.dylib; sourceTree = DEVELOPER_DIR; }; - 9FB6C0561A69815100945236 /* CodeIDESupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeIDESupport.h; sourceTree = ""; }; - 9FB6C0571A69815100945236 /* lang */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = lang; sourceTree = ""; }; 9FD6FC021A5D26580028EDC6 /* libsimulator.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libsimulator.xcodeproj; path = ../../../libsimulator/proj.ios_mac/libsimulator.xcodeproj; sourceTree = ""; }; 9FD6FC701A5D2A820028EDC6 /* ConsoleWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleWindowController.h; sourceTree = ""; }; 9FD6FC711A5D2A820028EDC6 /* ConsoleWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleWindowController.m; sourceTree = ""; }; @@ -364,16 +361,6 @@ name = Products; sourceTree = ""; }; - 9FB6C0551A69815100945236 /* ide-support */ = { - isa = PBXGroup; - children = ( - 9FB6C0561A69815100945236 /* CodeIDESupport.h */, - 9FB6C0571A69815100945236 /* lang */, - ); - name = "ide-support"; - path = "../Classes/ide-support"; - sourceTree = ""; - }; 9FD6FC031A5D26580028EDC6 /* Products */ = { isa = PBXGroup; children = ( @@ -442,7 +429,6 @@ F293BB7C15EB830F00256477 /* Classes */ = { isa = PBXGroup; children = ( - 9FB6C0551A69815100945236 /* ide-support */, F293BB7E15EB831F00256477 /* AppDelegate.cpp */, F293BB7F15EB831F00256477 /* AppDelegate.h */, ); @@ -598,7 +584,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9FB6C05F1A69815100945236 /* lang in Resources */, DA96489E1A70F925001F41E8 /* ConsoleWindow.xib in Resources */, 5023817617EBBE3400990C9B /* Icon.icns in Resources */, 9FFC07361A4A764100AED399 /* MainMenu.xib in Resources */, diff --git a/native/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj/project.pbxproj b/native/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj/project.pbxproj index 19acebe5f2..ad70fff337 100755 --- a/native/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj/project.pbxproj +++ b/native/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj/project.pbxproj @@ -779,7 +779,6 @@ DEBUG, "COCOS2D_DEBUG=1", USE_FILE32API, - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -822,8 +821,6 @@ GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( USE_FILE32API, - "CC_LUA_ENGINE_ENABLED=0", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", "COCOS2D_DEBUG=0", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; From d3007011251ba6d6d0c960deea1bc5ac50a6e272 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 4 Jul 2017 16:35:42 +0800 Subject: [PATCH 2/4] Fix android sub module dependency issue --- native/cocos/editor-support/creator/Android.mk | 10 +++++++--- .../editor-support/dragonbones/proj.android/Android.mk | 10 +++++++--- native/cocos/editor-support/spine/Android.mk | 8 ++++---- native/cocos/network/Android.mk | 10 +++++++--- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/native/cocos/editor-support/creator/Android.mk b/native/cocos/editor-support/creator/Android.mk index e5fc44c7e1..afdd0a4183 100644 --- a/native/cocos/editor-support/creator/Android.mk +++ b/native/cocos/editor-support/creator/Android.mk @@ -18,10 +18,14 @@ LOCAL_SRC_FILES := CCScale9Sprite.cpp \ physics/CCPhysicsContactImpulse.cpp \ CCCameraNode.cpp -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ + $(LOCAL_PATH)/../.. \ + $(LOCAL_PATH)/../../../external/sources -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. +LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. \ + $(LOCAL_PATH)/../.. \ + $(LOCAL_PATH)/../../../external/sources -LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static +# LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static include $(BUILD_STATIC_LIBRARY) diff --git a/native/cocos/editor-support/dragonbones/proj.android/Android.mk b/native/cocos/editor-support/dragonbones/proj.android/Android.mk index 45f46ee973..ce355afed5 100644 --- a/native/cocos/editor-support/dragonbones/proj.android/Android.mk +++ b/native/cocos/editor-support/dragonbones/proj.android/Android.mk @@ -31,11 +31,15 @@ LOCAL_SRC_FILES := ../animation/Animation.cpp \ ../cocos2dx/CCTextureData.cpp -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../.. +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../.. \ + $(LOCAL_PATH)/../../.. \ + $(LOCAL_PATH)/../../../../external/sources -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../.. +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../.. \ + $(LOCAL_PATH)/../../.. \ + $(LOCAL_PATH)/../../../../external/sources -LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static +# LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static LOCAL_CFLAGS += -Wno-psabi LOCAL_EXPORT_CFLAGS += -Wno-psabi diff --git a/native/cocos/editor-support/spine/Android.mk b/native/cocos/editor-support/spine/Android.mk index 0cc07198ed..06e36d509d 100644 --- a/native/cocos/editor-support/spine/Android.mk +++ b/native/cocos/editor-support/spine/Android.mk @@ -47,10 +47,10 @@ VertexAttachment.c \ extension.c \ spine-cocos2dx.cpp -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ + $(LOCAL_PATH)/../.. -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static +LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. \ + $(LOCAL_PATH)/../.. include $(BUILD_STATIC_LIBRARY) diff --git a/native/cocos/network/Android.mk b/native/cocos/network/Android.mk index 2be5204318..36c873c490 100644 --- a/native/cocos/network/Android.mk +++ b/native/cocos/network/Android.mk @@ -14,11 +14,15 @@ CCDownloader.cpp \ CCDownloader-android.cpp \ Uri.cpp -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/.. \ + $(LOCAL_PATH)/../../external/sources -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../external/websockets/include/android +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../external/websockets/include/android \ + $(LOCAL_PATH)/.. \ + $(LOCAL_PATH)/../../external/sources -LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static +# LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static LOCAL_STATIC_LIBRARIES += libwebsockets_static LOCAL_STATIC_LIBRARIES += cocos_ssl_static LOCAL_STATIC_LIBRARIES += cocos_crypto_static From 2b00307a443d025692a269dd4c1308b27653cff4 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 5 Jul 2017 11:30:57 +0800 Subject: [PATCH 3/4] Fix Spidermonkey Android build issue --- native/external/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/external/config.json b/native/external/config.json index 3f7e275fc2..26420ea862 100644 --- a/native/external/config.json +++ b/native/external/config.json @@ -1,5 +1,5 @@ { - "version": "v3-deps-30", + "version": "v3-deps-31", "zip_file_size": "74337963", "repo_name": "cocos2d-x-lite-external", "repo_parent": "https://github.com/cocos-creator/" From 450ad5b4d5df7dcc6fd2f7acb4e2113c9b001f6a Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 5 Jul 2017 11:34:53 +0800 Subject: [PATCH 4/4] Add cocos ui static dependency --- native/cocos/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/native/cocos/Android.mk b/native/cocos/Android.mk index dc9feae3c3..32945c26e3 100644 --- a/native/cocos/Android.mk +++ b/native/cocos/Android.mk @@ -281,6 +281,7 @@ LOCAL_MODULE := cocos2dx_static LOCAL_MODULE_FILENAME := libcocos2d LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static +LOCAL_STATIC_LIBRARIES += cocos_ui_static LOCAL_STATIC_LIBRARIES += spine_static LOCAL_STATIC_LIBRARIES += dragonbones_static LOCAL_STATIC_LIBRARIES += creator_static