diff --git a/build/scripts/build-testrunner-application.sh b/build/scripts/build-testrunner-application.sh index 57badce49..d4b9f59e6 100755 --- a/build/scripts/build-testrunner-application.sh +++ b/build/scripts/build-testrunner-application.sh @@ -19,14 +19,14 @@ cmake .. -G"Xcode" mkdir -p "$NATIVESCRIPT_XCODEPROJ/xcshareddata/xcschemes" cp "$WORKSPACE/build/TestRunner.xcscheme" "$NATIVESCRIPT_XCODEPROJ/xcshareddata/xcschemes/TestRunner.xcscheme" -# xcodebuild \ -# -configuration "$CONFIGURATION" \ -# -sdk "iphoneos" \ -# -scheme "TestRunner" \ -# ARCHS="armv7 arm64" \ -# ONLY_ACTIVE_ARCH="NO" \ -# -project $NATIVESCRIPT_XCODEPROJ \ -# -quiet \ +xcodebuild \ +-configuration "$CONFIGURATION" \ +-sdk "iphoneos" \ +-scheme "TestRunner" \ +ARCHS="armv7 arm64" \ +ONLY_ACTIVE_ARCH="NO" \ +-project $NATIVESCRIPT_XCODEPROJ \ +-quiet \ xcodebuild archive \ -archivePath "$WORKSPACE/cmake-build/tests/TestRunner/$CONFIGURATION-iphoneos/TestRunner.xcarchive" \ diff --git a/cmake/CreateNativeScriptApp.cmake b/cmake/CreateNativeScriptApp.cmake index 3ef0fe63d..84156cdec 100644 --- a/cmake/CreateNativeScriptApp.cmake +++ b/cmake/CreateNativeScriptApp.cmake @@ -13,11 +13,13 @@ function(CreateNativeScriptApp _target _main _plist _resources) ) if(NOT ${BUILD_SHARED_LIBS}) + add_dependencies(${_target} NativeScript) target_link_libraries(${_target} - NativeScript libicucore.dylib libz.dylib libc++.dylib + "-lNativeScript" + "-L${NativeScriptFramework_BINARY_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" ) if(NOT ${EMBED_STATIC_DEPENDENCIES}) diff --git a/src/NativeScript/CMakeLists.txt b/src/NativeScript/CMakeLists.txt index 60b500c2b..b401e77e6 100644 --- a/src/NativeScript/CMakeLists.txt +++ b/src/NativeScript/CMakeLists.txt @@ -229,7 +229,13 @@ set(JSFILES smartStringify.js ) -include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/**" "${LIBFFI_INCLUDE_DIR}" "${WEBKIT_INCLUDE_DIRECTORIES}") +include_directories( + "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/**" + "${LIBFFI_INCLUDE_DIR}" + "${WEBKIT_INCLUDE_DIRECTORIES}" +) + link_directories("${LIBFFI_LIB_DIR}" ${WEBKIT_LINK_DIRECTORIES}) add_library(NativeScript ${SOURCE_FILES} ${HEADER_FILES} ${JSFILES}) diff --git a/src/NativeScript/inspector/InspectorPageAgent.mm b/src/NativeScript/inspector/InspectorPageAgent.mm index 3549e4539..dc313ff61 100644 --- a/src/NativeScript/inspector/InspectorPageAgent.mm +++ b/src/NativeScript/inspector/InspectorPageAgent.mm @@ -32,21 +32,29 @@ } void InspectorPageAgent::reload(ErrorString&, const bool* const optionalReloadFromOrigin, const bool* const optionalRevalidateAllResources) { - JSC::JSValue liveSyncCallback = m_globalObject.get(m_globalObject.globalExec(), JSC::Identifier::fromString(&m_globalObject.vm(), "__onLiveSync")); - JSC::CallData callData; - JSC::CallType callType = getCallData(m_globalObject.vm(), liveSyncCallback, callData); - if (callType == JSC::CallType::None) { - JSC::JSValue error = JSC::createError(m_globalObject.globalExec(), "global.__onLiveSync is not a function."); - m_globalObject.inspectorController().reportAPIException(m_globalObject.globalExec(), JSC::Exception::create(m_globalObject.globalExec()->vm(), error)); - return; - } - - WTF::NakedPtr exception; - JSC::MarkedArgumentBuffer liveSyncArguments; - call(m_globalObject.globalExec(), liveSyncCallback, callType, callData, JSC::jsUndefined(), liveSyncArguments, exception); - if (exception) { - m_globalObject.inspectorController().reportAPIException(m_globalObject.globalExec(), exception); - } + // __onLiveSync interacts with UI elements and has to be called in the main thread + CFRunLoopRef runloop = CFRunLoopGetMain(); + CFRunLoopPerformBlock(runloop, (__bridge CFTypeRef)(kCFRunLoopDefaultMode), ^{ + JSC::VM& vm = m_globalObject.vm(); + JSC::JSLockHolder lock(vm); + + JSC::JSValue liveSyncCallback = m_globalObject.get(m_globalObject.globalExec(), JSC::Identifier::fromString(&vm, "__onLiveSync")); + JSC::CallData callData; + JSC::CallType callType = getCallData(vm, liveSyncCallback, callData); + if (callType == JSC::CallType::None) { + JSC::JSValue error = JSC::createError(m_globalObject.globalExec(), "global.__onLiveSync is not a function."); + m_globalObject.inspectorController().reportAPIException(m_globalObject.globalExec(), JSC::Exception::create(vm, error)); + return; + } + + WTF::NakedPtr exception; + JSC::MarkedArgumentBuffer liveSyncArguments; + call(m_globalObject.globalExec(), liveSyncCallback, callType, callData, JSC::jsUndefined(), liveSyncArguments, exception); + if (exception) { + m_globalObject.inspectorController().reportAPIException(m_globalObject.globalExec(), exception); + } + }); + CFRunLoopWakeUp(runloop); } void InspectorPageAgent::navigate(ErrorString&, const String& in_url) {