issue #2905:TestJavascript build ok on Android

This commit is contained in:
minggo 2013-10-17 11:28:57 +08:00
parent ba7e4e6c7d
commit 8f9756f030
18 changed files with 57 additions and 40 deletions

View File

@ -1 +1 @@
7658fe75258895d82e9432317ff63b182547bcdc
9fac2ba89faf5e6f3c870c02f5186641e6be1590

View File

@ -1,7 +1,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := gui_static
LOCAL_MODULE := cocos_gui_static
LOCAL_MODULE_FILENAME := libgui

View File

@ -1,7 +1,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := network_static
LOCAL_MODULE := cocos_network_static
LOCAL_MODULE_FILENAME := libnetwork

View File

@ -2,9 +2,9 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := scriptingcore-spidermonkey
LOCAL_MODULE := cocos_jsb_static
LOCAL_MODULE_FILENAME := libscriptingcore-spidermonkey
LOCAL_MODULE_FILENAME := libcocos2dxjsb
LOCAL_SRC_FILES := ScriptingCore.cpp \
cocos2d_specifics.cpp \
@ -34,18 +34,40 @@ LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT
LOCAL_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/../../../CocosDenshion/include \
$(LOCAL_PATH)/../../auto-generated/js-bindings
$(LOCAL_PATH)/../../auto-generated/js-bindings \
$(LOCAL_PATH)/../../../../extensions \
$(LOCAL_PATH)/../../../editor-support/cocostudio
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/../../auto-generated/js-bindings
$(LOCAL_PATH)/../../auto-generated/js-bindings
LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static
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_WHOLE_STATIC_LIBRARIES += cocos_gui_static
LOCAL_LDLIBS := -landroid
LOCAL_LDLIBS += -llog
include $(BUILD_STATIC_LIBRARY)
$(call import-module,scripting/javascript/spidermonkey-android)
$(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)
$(call import-module,gui)

View File

@ -16,7 +16,7 @@
#include "ScriptingCore.h"
#include "jsdbgapi.h"
#include "cocos2d.h"
#include "LocalStorage.h"
#include "local-storage/LocalStorage.h"
#include "cocos2d_specifics.hpp"
#include "js_bindings_config.h"
// for debug socket

View File

@ -67,7 +67,7 @@ void MinXmlHttpRequest::_gotHeader(string header)
{
// Seems like we have the response Code! Parse it and check for it.
char * pch;
std::strcpy(cstr, header.c_str());
strcpy(cstr, header.c_str());
pch = strtok(cstr," ");
while (pch != NULL)

View File

@ -1 +1 @@
2641da58037c13f92ae771830a1fdf943e4964d2
bf994ad1fc8ac1044957d83708f7848e99ca59e6

View File

@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
#include "cocos-ext.h"
#include "extensions/cocos-ext.h"
#include "js_bindings_config.h"
#ifdef JSB_INCLUDE_CHIPMUNK

View File

@ -7,7 +7,7 @@
#include "js_bindings_config.h"
//#ifdef JSB_INCLUDE_SYSTEM
#include "LocalStorage.h"
#include "local-storage/LocalStorage.h"
#include "jsfriendapi.h"
#include "js_bindings_config.h"

View File

@ -24,7 +24,7 @@
#include "js_bindings_config.h"
#include "js_bindings_core.h"
#include "LocalStorage.h"
#include "local-storage/LocalStorage.h"
#include "cocos2d.h"
// system

View File

@ -6,7 +6,7 @@
//
#include "jsb_cocos2dx_extension_manual.h"
#include "cocos-ext.h"
#include "extensions/cocos-ext.h"
#include "ScriptingCore.h"
#include "cocos2d_specifics.hpp"
#include "cocostudio/CocoStudio.h"

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#include "jsb_websocket.h"
#include "cocos2d.h"
#include "WebSocket.h"
#include "network/WebSocket.h"
#include "spidermonkey_specifics.h"
#include "ScriptingCore.h"
#include "cocos2d_specifics.hpp"

View File

@ -1,19 +1,24 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := localstorage_static
LOCAL_MODULE := cocos_localstorage_static
LOCAL_MODULE_FILENAME := liblocalstorage
LOCAL_SRC_FILES := LocalStorage.cpp
LocalStorageAndroid.cpp \
LOCAL_SRC_FILES := LocalStorage.cpp \
LocalStorageAndroid.cpp
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d
LOCAL_CFLAGS += -Wno-psabi
LOCAL_EXPORT_CFLAGS += -Wno-psabi
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
include $(BUILD_STATIC_LIBRARY)
$(call import-module,2d)

View File

@ -3,8 +3,8 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := spidermonkey_static
LOCAL_MODULE_FILENAME := js_static
LOCAL_SRC_FILES := ./lib/$(TARGET_ARCH_ABI)/libjs_static.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libjs_static.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android
LOCAL_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 -Wno-invalid-offsetof
LOCAL_EXPORT_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 -Wno-invalid-offsetof
include $(PREBUILT_STATIC_LIBRARY)

View File

@ -1,7 +1,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libwebsockets_static
LOCAL_MODULE := websockets_static
LOCAL_MODULE_FILENAME := libwebsockets_static
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebsockets.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android

View File

@ -148,9 +148,9 @@ LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static
LOCAL_WHOLE_STATIC_LIBRARIES += spine_static
LOCAL_WHOLE_STATIC_LIBRARIES += gui_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
LOCAL_WHOLE_STATIC_LIBRARIES += network_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Classes

View File

@ -76,7 +76,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
COCOS2DX_ROOT="$DIR/../../../.."
APP_ROOT="$DIR/.."
APP_ANDROID_ROOT="$DIR"
BINDINGS_JS_ROOT="$APP_ROOT/../../../scripting/javascript/bindings/js"
BINDINGS_JS_ROOT="$APP_ROOT/../../../cocos/scripting/javascript/script"
echo
echo "Paths"
@ -110,5 +110,5 @@ echo
set -x
"$NDK_ROOT"/ndk-build $PARALLEL_BUILD_FLAG -C "$APP_ANDROID_ROOT" $* \
"NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" \
"NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}/external" \
NDK_LOG=0 V=0

View File

@ -11,20 +11,10 @@ LOCAL_SRC_FILES := testjavascript/main.cpp \
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += spidermonkey_static
LOCAL_WHOLE_STATIC_LIBRARIES += scriptingcore-spidermonkey
LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static
LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT
LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2
include $(BUILD_SHARED_LIBRARY)
$(call import-module,cocos2dx)
$(call import-module,audio/android)
$(call import-module,extensions)
$(call import-module,scripting/javascript/spidermonkey-android)
$(call import-module,scripting/javascript/bindings)
$(call import-module,cocos2dx/platform/android)