From fd993e2fa210ab7c4c2a274518ffc72d6f4b532c Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Thu, 24 Oct 2013 17:54:57 +0800 Subject: [PATCH 1/2] issues #2905:split jsbinding module --- .../scripting/javascript/bindings/Android.mk | 43 +++---------------- .../javascript/bindings/chipmunk/Android.mk | 33 ++++++++++++++ .../bindings/cocosbuilder/Android.mk | 29 +++++++++++++ .../javascript/bindings/cocostudio/Android.mk | 30 +++++++++++++ .../javascript/bindings/extension/Android.mk | 30 +++++++++++++ .../bindings/localstorage/Android.mk | 29 +++++++++++++ .../javascript/bindings/network/Android.mk | 30 +++++++++++++ .../proj.android/jni/Android.mk | 13 ++++++ 8 files changed, 200 insertions(+), 37 deletions(-) create mode 100644 cocos/scripting/javascript/bindings/chipmunk/Android.mk create mode 100644 cocos/scripting/javascript/bindings/cocosbuilder/Android.mk create mode 100644 cocos/scripting/javascript/bindings/cocostudio/Android.mk create mode 100644 cocos/scripting/javascript/bindings/extension/Android.mk create mode 100644 cocos/scripting/javascript/bindings/localstorage/Android.mk create mode 100644 cocos/scripting/javascript/bindings/network/Android.mk diff --git a/cocos/scripting/javascript/bindings/Android.mk b/cocos/scripting/javascript/bindings/Android.mk index 5689684060..8195fde121 100644 --- a/cocos/scripting/javascript/bindings/Android.mk +++ b/cocos/scripting/javascript/bindings/Android.mk @@ -8,65 +8,34 @@ LOCAL_MODULE_FILENAME := libcocos2dxjsb LOCAL_SRC_FILES := ScriptingCore.cpp \ cocos2d_specifics.cpp \ - jsb_cocos2dx_extension_manual.cpp \ js_manual_conversions.cpp \ cocosjs_manual_conversions.cpp \ - js_bindings_chipmunk_manual.cpp \ - js_bindings_chipmunk_functions.cpp \ - js_bindings_chipmunk_auto_classes.cpp \ - js_bindings_chipmunk_registration.cpp \ - js_bindings_system_functions.cpp \ - js_bindings_system_registration.cpp \ - js_bindings_ccbreader.cpp \ js_bindings_core.cpp \ js_bindings_opengl.cpp \ jsb_opengl_functions.cpp \ jsb_opengl_manual.cpp \ jsb_opengl_registration.cpp \ - ../../auto-generated/js-bindings/jsb_cocos2dx_auto.cpp \ - ../../auto-generated/js-bindings/jsb_cocos2dx_extension_auto.cpp \ - XMLHTTPRequest.cpp \ - jsb_websocket.cpp + ../../auto-generated/js-bindings/jsb_cocos2dx_auto.cpp LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT LOCAL_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/../../../CocosDenshion/include \ + $(LOCAL_PATH)/../../../audio/include \ + $(LOCAL_PATH)/../../../storage \ $(LOCAL_PATH)/../../auto-generated/js-bindings \ - $(LOCAL_PATH)/../../../../extensions \ - $(LOCAL_PATH)/../../../editor-support/cocostudio \ - $(LOCAL_PATH)/../../../editor-support/cocosbuilder + $(LOCAL_PATH)/../../../../extensions LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/../../auto-generated/js-bindings + $(LOCAL_PATH)/../../auto-generated/js-bindings \ + $(LOCAL_PATH)/../../../audio/include LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES += spidermonkey_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static -LOCAL_WHOLE_STATIC_LIBRARIES += spine_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static -LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_localstorage_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static -LOCAL_WHOLE_STATIC_LIBRARIES += websockets_static - -LOCAL_LDLIBS := -landroid -LOCAL_LDLIBS += -llog include $(BUILD_STATIC_LIBRARY) $(call import-module,spidermonkey/prebuilt/android) -$(call import-module,extensions) $(call import-module,2d) -$(call import-module,extensions) -$(call import-module,editor-support/cocosbuilder) -$(call import-module,editor-support/spine) -$(call import-module,network) -$(call import-module,chipmunk) -$(call import-module,storage/local-storage) -$(call import-module,editor-support/cocostudio) -$(call import-module,websockets/prebuilt/android) diff --git a/cocos/scripting/javascript/bindings/chipmunk/Android.mk b/cocos/scripting/javascript/bindings/chipmunk/Android.mk new file mode 100644 index 0000000000..ae7b615b57 --- /dev/null +++ b/cocos/scripting/javascript/bindings/chipmunk/Android.mk @@ -0,0 +1,33 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := jsb_chipmunk_static + +LOCAL_MODULE_FILENAME := libcocos2dxjsbchipmunk + +LOCAL_SRC_FILES := js_bindings_chipmunk_manual.cpp \ + js_bindings_chipmunk_functions.cpp \ + js_bindings_chipmunk_auto_classes.cpp \ + js_bindings_chipmunk_registration.cpp + +LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../../../.. + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,spidermonkey/prebuilt/android) +$(call import-module,scripting/javascript/bindings) +$(call import-module,extensions) +$(call import-module,chipmunk) diff --git a/cocos/scripting/javascript/bindings/cocosbuilder/Android.mk b/cocos/scripting/javascript/bindings/cocosbuilder/Android.mk new file mode 100644 index 0000000000..be5e73de8f --- /dev/null +++ b/cocos/scripting/javascript/bindings/cocosbuilder/Android.mk @@ -0,0 +1,29 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := jsb_builder_static + +LOCAL_MODULE_FILENAME := libcocos2dxjsbbuilder + +LOCAL_SRC_FILES := js_bindings_ccbreader.cpp \ + ../../../auto-generated/js-bindings/jsb_cocos2dx_builder_auto.cpp + +LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../../../editor-support/cocosbuilder + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,spidermonkey/prebuilt/android) +$(call import-module,scripting/javascript/bindings) +$(call import-module,editor-support/cocosbuilder) diff --git a/cocos/scripting/javascript/bindings/cocostudio/Android.mk b/cocos/scripting/javascript/bindings/cocostudio/Android.mk new file mode 100644 index 0000000000..ca0eb1939f --- /dev/null +++ b/cocos/scripting/javascript/bindings/cocostudio/Android.mk @@ -0,0 +1,30 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := jsb_studio_static + +LOCAL_MODULE_FILENAME := libcocos2dxjsbstudio + +LOCAL_SRC_FILES := jsb_cocos2dx_studio_manual.cpp \ + ../../../auto-generated/js-bindings/jsb_cocos2dx_studio_auto.cpp + +LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../../../../extensions \ + $(LOCAL_PATH)/../../../../editor-support/cocostudio + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,spidermonkey/prebuilt/android) +$(call import-module,scripting/javascript/bindings) +$(call import-module,editor-support/cocostudio) diff --git a/cocos/scripting/javascript/bindings/extension/Android.mk b/cocos/scripting/javascript/bindings/extension/Android.mk new file mode 100644 index 0000000000..871a5c1cf5 --- /dev/null +++ b/cocos/scripting/javascript/bindings/extension/Android.mk @@ -0,0 +1,30 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := jsb_extension_static + +LOCAL_MODULE_FILENAME := libcocos2dxjsbextension + +LOCAL_SRC_FILES := jsb_cocos2dx_extension_manual.cpp \ + ../../../auto-generated/js-bindings/jsb_cocos2dx_extension_auto.cpp + +LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../../../../extensions + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../../../../ + +LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,spidermonkey/prebuilt/android) +$(call import-module,scripting/javascript/bindings) +$(call import-module,extensions) diff --git a/cocos/scripting/javascript/bindings/localstorage/Android.mk b/cocos/scripting/javascript/bindings/localstorage/Android.mk new file mode 100644 index 0000000000..e13104f94c --- /dev/null +++ b/cocos/scripting/javascript/bindings/localstorage/Android.mk @@ -0,0 +1,29 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := jsb_localstorage_static + +LOCAL_MODULE_FILENAME := libcocos2dxjsblocalstorage + +LOCAL_SRC_FILES := js_bindings_system_functions.cpp \ + js_bindings_system_registration.cpp + +LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../../../../extensions + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_localstorage_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,spidermonkey/prebuilt/android) +$(call import-module,scripting/javascript/bindings) +$(call import-module,storage/local-storage) diff --git a/cocos/scripting/javascript/bindings/network/Android.mk b/cocos/scripting/javascript/bindings/network/Android.mk new file mode 100644 index 0000000000..6f5c59aa96 --- /dev/null +++ b/cocos/scripting/javascript/bindings/network/Android.mk @@ -0,0 +1,30 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := jsb_network_static + +LOCAL_MODULE_FILENAME := libcocos2dxjsbnetwork + +LOCAL_SRC_FILES := XMLHTTPRequest.cpp \ + jsb_websocket.cpp + +LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static +LOCAL_WHOLE_STATIC_LIBRARIES += websockets_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,spidermonkey/prebuilt/android) +$(call import-module,scripting/javascript/bindings) +$(call import-module,network) +$(call import-module,websockets/prebuilt/android) diff --git a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk b/samples/Javascript/TestJavascript/proj.android/jni/Android.mk index 89d17346d0..0a9f023dc3 100644 --- a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk +++ b/samples/Javascript/TestJavascript/proj.android/jni/Android.mk @@ -12,9 +12,22 @@ LOCAL_SRC_FILES := testjavascript/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static +LOCAL_WHOLE_STATIC_LIBRARIES += jsb_chipmunk_static +LOCAL_WHOLE_STATIC_LIBRARIES += jsb_extension_static +LOCAL_WHOLE_STATIC_LIBRARIES += jsb_localstorage_static +LOCAL_WHOLE_STATIC_LIBRARIES += jsb_network_static +LOCAL_WHOLE_STATIC_LIBRARIES += jsb_builder_static +LOCAL_WHOLE_STATIC_LIBRARIES += jsb_studio_static + LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 include $(BUILD_SHARED_LIBRARY) $(call import-module,scripting/javascript/bindings) +$(call import-module,scripting/javascript/bindings/chipmunk) +$(call import-module,scripting/javascript/bindings/extension) +$(call import-module,scripting/javascript/bindings/localstorage) +$(call import-module,scripting/javascript/bindings/network) +$(call import-module,scripting/javascript/bindings/cocosbuilder) +$(call import-module,scripting/javascript/bindings/cocostudio) From 56ef19714642b4a74b227d1f20b2a034613c19bd Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Thu, 24 Oct 2013 18:36:36 +0800 Subject: [PATCH 2/2] update the reference to cocos2d-x repo. --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 893da8ccfb..2f3c531665 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 893da8ccfb4ed7fa754c483a90dc4e5248c36e03 +Subproject commit 2f3c5316657e64ec38b8ed3ea6826eb48c46f32c