Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions build/scripts/build-testrunner-application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
4 changes: 3 additions & 1 deletion cmake/CreateNativeScriptApp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
8 changes: 7 additions & 1 deletion src/NativeScript/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
38 changes: 23 additions & 15 deletions src/NativeScript/inspector/InspectorPageAgent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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<JSC::Exception> 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<JSC::Exception> 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) {
Expand Down