diff --git a/.github/workflows/npm_release.yml b/.github/workflows/npm_release.yml index 47d87c3a..b3abef46 100644 --- a/.github/workflows/npm_release.yml +++ b/.github/workflows/npm_release.yml @@ -59,7 +59,7 @@ jobs: echo NPM_VERSION=$NPM_VERSION >> $GITHUB_OUTPUT echo NPM_TAG=$NPM_TAG >> $GITHUB_OUTPUT - name: Build - run: npm run build + run: npm run build-ios - name: Upload npm package artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index bcf49227..a2ff527b 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -43,7 +43,7 @@ jobs: echo NPM_VERSION=$NPM_VERSION >> $GITHUB_ENV npm version $NPM_VERSION --no-git-tag-version - name: Build - run: npm run build + run: npm run build-ios - name: Upload npm package artifact uses: actions/upload-artifact@v3 with: diff --git a/.gitignore b/.gitignore index b481a975..08fb1b04 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,9 @@ v8_build # v8 build files... .gclient* .cipd/ + +# project template +/project-template-ios/.build_env_vars.sh +/project-template-ios/__PROJECT_NAME__.xcodeproj/project.xcworkspace/xcshareddata/ +/project-template-vision/.build_env_vars.sh +/project-template-vision/__PROJECT_NAME__.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ No newline at end of file diff --git a/NativeScript/NativeScript-Prefix.pch b/NativeScript/NativeScript-Prefix.pch index 4ad4f89b..9932b781 100644 --- a/NativeScript/NativeScript-Prefix.pch +++ b/NativeScript/NativeScript-Prefix.pch @@ -1,7 +1,7 @@ #ifndef NativeScript_Prefix_pch #define NativeScript_Prefix_pch -#define NATIVESCRIPT_VERSION "8.6.1" +#define NATIVESCRIPT_VERSION "8.7.0-rc.1" #ifdef DEBUG #define SIZEOF_OFF_T 8 diff --git a/NativeScript/inspector/utils.mm b/NativeScript/inspector/utils.mm index dd7158de..d078e525 100644 --- a/NativeScript/inspector/utils.mm +++ b/NativeScript/inspector/utils.mm @@ -19,6 +19,7 @@ } NSString* fileExtension = [fullPath pathExtension]; + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" CFStringRef uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExtension, nil); if (uti == nil) { return std::string(); diff --git a/NativeScript/lib/arm64-xros/libcppgc_base.a b/NativeScript/lib/arm64-xros/libcppgc_base.a new file mode 100644 index 00000000..cb3e6489 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libcppgc_base.a differ diff --git a/NativeScript/lib/arm64-xros/libcrdtp.a b/NativeScript/lib/arm64-xros/libcrdtp.a new file mode 100644 index 00000000..cf5e6da1 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libcrdtp.a differ diff --git a/NativeScript/lib/arm64-xros/libcrdtp_platform.a b/NativeScript/lib/arm64-xros/libcrdtp_platform.a new file mode 100644 index 00000000..ffa03cb2 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libcrdtp_platform.a differ diff --git a/NativeScript/lib/arm64-xros/libffi.a b/NativeScript/lib/arm64-xros/libffi.a new file mode 100644 index 00000000..107d04c9 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libffi.a differ diff --git a/NativeScript/lib/arm64-xros/libinspector.a b/NativeScript/lib/arm64-xros/libinspector.a new file mode 100644 index 00000000..12620a4d Binary files /dev/null and b/NativeScript/lib/arm64-xros/libinspector.a differ diff --git a/NativeScript/lib/arm64-xros/libinspector_string_conversions.a b/NativeScript/lib/arm64-xros/libinspector_string_conversions.a new file mode 100644 index 00000000..0dc5c7dd Binary files /dev/null and b/NativeScript/lib/arm64-xros/libinspector_string_conversions.a differ diff --git a/NativeScript/lib/arm64-xros/libtorque_generated_definitions.a b/NativeScript/lib/arm64-xros/libtorque_generated_definitions.a new file mode 100644 index 00000000..c4cf4c5b Binary files /dev/null and b/NativeScript/lib/arm64-xros/libtorque_generated_definitions.a differ diff --git a/NativeScript/lib/arm64-xros/libtorque_generated_initializers.a b/NativeScript/lib/arm64-xros/libtorque_generated_initializers.a new file mode 100644 index 00000000..378cd547 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libtorque_generated_initializers.a differ diff --git a/NativeScript/lib/arm64-xros/libv8_base_without_compiler.a b/NativeScript/lib/arm64-xros/libv8_base_without_compiler.a new file mode 100644 index 00000000..8c1828f1 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libv8_base_without_compiler.a differ diff --git a/NativeScript/lib/arm64-xros/libv8_bigint.a b/NativeScript/lib/arm64-xros/libv8_bigint.a new file mode 100644 index 00000000..98f281f6 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libv8_bigint.a differ diff --git a/NativeScript/lib/arm64-xros/libv8_compiler.a b/NativeScript/lib/arm64-xros/libv8_compiler.a new file mode 100644 index 00000000..44c7b5fb Binary files /dev/null and b/NativeScript/lib/arm64-xros/libv8_compiler.a differ diff --git a/NativeScript/lib/arm64-xros/libv8_heap_base.a b/NativeScript/lib/arm64-xros/libv8_heap_base.a new file mode 100644 index 00000000..59b1a6a5 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libv8_heap_base.a differ diff --git a/NativeScript/lib/arm64-xros/libv8_heap_base_headers.a b/NativeScript/lib/arm64-xros/libv8_heap_base_headers.a new file mode 100644 index 00000000..8b277f0d --- /dev/null +++ b/NativeScript/lib/arm64-xros/libv8_heap_base_headers.a @@ -0,0 +1 @@ +! diff --git a/NativeScript/lib/arm64-xros/libv8_libbase.a b/NativeScript/lib/arm64-xros/libv8_libbase.a new file mode 100644 index 00000000..a208611c Binary files /dev/null and b/NativeScript/lib/arm64-xros/libv8_libbase.a differ diff --git a/NativeScript/lib/arm64-xros/libv8_libplatform.a b/NativeScript/lib/arm64-xros/libv8_libplatform.a new file mode 100644 index 00000000..815480a3 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libv8_libplatform.a differ diff --git a/NativeScript/lib/arm64-xros/libv8_snapshot.a b/NativeScript/lib/arm64-xros/libv8_snapshot.a new file mode 100644 index 00000000..030583c0 Binary files /dev/null and b/NativeScript/lib/arm64-xros/libv8_snapshot.a differ diff --git a/NativeScript/lib/arm64-xros/libzip.a b/NativeScript/lib/arm64-xros/libzip.a new file mode 100644 index 00000000..37ba95fe Binary files /dev/null and b/NativeScript/lib/arm64-xros/libzip.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libcppgc_base.a b/NativeScript/lib/arm64-xrsimulator/libcppgc_base.a new file mode 100644 index 00000000..2fbd5303 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libcppgc_base.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libcrdtp.a b/NativeScript/lib/arm64-xrsimulator/libcrdtp.a new file mode 100644 index 00000000..f1f65a60 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libcrdtp.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libcrdtp_platform.a b/NativeScript/lib/arm64-xrsimulator/libcrdtp_platform.a new file mode 100644 index 00000000..d87484b8 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libcrdtp_platform.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libffi.a b/NativeScript/lib/arm64-xrsimulator/libffi.a new file mode 100644 index 00000000..45f9cbf3 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libffi.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libinspector.a b/NativeScript/lib/arm64-xrsimulator/libinspector.a new file mode 100644 index 00000000..ca0ff003 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libinspector.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libinspector_string_conversions.a b/NativeScript/lib/arm64-xrsimulator/libinspector_string_conversions.a new file mode 100644 index 00000000..1628db2f Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libinspector_string_conversions.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libtorque_generated_definitions.a b/NativeScript/lib/arm64-xrsimulator/libtorque_generated_definitions.a new file mode 100644 index 00000000..5996ade8 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libtorque_generated_definitions.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libtorque_generated_initializers.a b/NativeScript/lib/arm64-xrsimulator/libtorque_generated_initializers.a new file mode 100644 index 00000000..4bb03996 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libtorque_generated_initializers.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libv8_base_without_compiler.a b/NativeScript/lib/arm64-xrsimulator/libv8_base_without_compiler.a new file mode 100644 index 00000000..eea4569f Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libv8_base_without_compiler.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libv8_bigint.a b/NativeScript/lib/arm64-xrsimulator/libv8_bigint.a new file mode 100644 index 00000000..3854a0f3 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libv8_bigint.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libv8_compiler.a b/NativeScript/lib/arm64-xrsimulator/libv8_compiler.a new file mode 100644 index 00000000..2a07e951 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libv8_compiler.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libv8_heap_base.a b/NativeScript/lib/arm64-xrsimulator/libv8_heap_base.a new file mode 100644 index 00000000..3f2e9a35 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libv8_heap_base.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libv8_heap_base_headers.a b/NativeScript/lib/arm64-xrsimulator/libv8_heap_base_headers.a new file mode 100644 index 00000000..8b277f0d --- /dev/null +++ b/NativeScript/lib/arm64-xrsimulator/libv8_heap_base_headers.a @@ -0,0 +1 @@ +! diff --git a/NativeScript/lib/arm64-xrsimulator/libv8_libbase.a b/NativeScript/lib/arm64-xrsimulator/libv8_libbase.a new file mode 100644 index 00000000..ef8df6a2 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libv8_libbase.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libv8_libplatform.a b/NativeScript/lib/arm64-xrsimulator/libv8_libplatform.a new file mode 100644 index 00000000..9fcbf4bf Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libv8_libplatform.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libv8_snapshot.a b/NativeScript/lib/arm64-xrsimulator/libv8_snapshot.a new file mode 100644 index 00000000..47ccc3cc Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libv8_snapshot.a differ diff --git a/NativeScript/lib/arm64-xrsimulator/libzip.a b/NativeScript/lib/arm64-xrsimulator/libzip.a new file mode 100644 index 00000000..b5660107 Binary files /dev/null and b/NativeScript/lib/arm64-xrsimulator/libzip.a differ diff --git a/NativeScript/runtime/Metadata.mm b/NativeScript/runtime/Metadata.mm index a26d8cd8..69442877 100644 --- a/NativeScript/runtime/Metadata.mm +++ b/NativeScript/runtime/Metadata.mm @@ -17,22 +17,25 @@ void LogMetadataUnavailable(const char* identifierString, uint8_t majorVersion, ); } +#if !TARGET_OS_VISION /** * \brief Gets the system version of the current device. */ static UInt8 getSystemVersion() { - static UInt8 iosVersion; - if (iosVersion != 0) { - return iosVersion; - } + static UInt8 iosVersion; + if (iosVersion != 0) { + return iosVersion; + } - NSString* version = [[UIDevice currentDevice] systemVersion]; - NSArray* versionTokens = [version componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"."]]; - UInt8 majorVersion = (UInt8)[versionTokens[0] intValue]; - UInt8 minorVersion = (UInt8)[versionTokens[1] intValue]; + NSString* version = [[UIDevice currentDevice] systemVersion]; + NSArray* versionTokens = [version componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"."]]; + UInt8 majorVersion = (UInt8)[versionTokens[0] intValue]; + UInt8 minorVersion = (UInt8)[versionTokens[1] intValue]; - return iosVersion = encodeVersion(majorVersion, minorVersion); + return iosVersion = encodeVersion(majorVersion, minorVersion); } +#endif + robin_hood::unordered_map getMetasByJSNames(MembersCollection members) { robin_hood::unordered_map result; for (auto member : members) { @@ -43,9 +46,13 @@ static UInt8 getSystemVersion() { // Meta bool Meta::isAvailable() const { - UInt8 introducedIn = this->introducedIn(); - UInt8 systemVersion = getSystemVersion(); - return introducedIn == 0 || introducedIn <= systemVersion; + #if TARGET_OS_VISION + return true; + #else + UInt8 introducedIn = this->introducedIn(); + UInt8 systemVersion = getSystemVersion(); + return introducedIn == 0 || introducedIn <= systemVersion; + #endif } // MethodMeta class diff --git a/NativeScript/runtime/MetadataInlines.h b/NativeScript/runtime/MetadataInlines.h index 5512dd83..de702e82 100644 --- a/NativeScript/runtime/MetadataInlines.h +++ b/NativeScript/runtime/MetadataInlines.h @@ -3,6 +3,7 @@ #include #include "StringHasher.h" +#include namespace tns { diff --git a/NativeScript/runtime/robin_hood.h b/NativeScript/runtime/robin_hood.h index 3e031626..fb9fa6f3 100644 --- a/NativeScript/runtime/robin_hood.h +++ b/NativeScript/runtime/robin_hood.h @@ -225,6 +225,8 @@ static Counts& counts() { # define ROBIN_HOOD_PRIVATE_DEFINITION_NODISCARD() #endif +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" + namespace robin_hood { #if ROBIN_HOOD(CXX) >= ROBIN_HOOD(CXX14) diff --git a/build_all.sh b/build_all_ios.sh similarity index 53% rename from build_all.sh rename to build_all_ios.sh index e5313d91..e490f4a5 100755 --- a/build_all.sh +++ b/build_all_ios.sh @@ -4,7 +4,7 @@ set -e rm -rf ./dist ./update_version.sh ./build_metadata_generator.sh -./build_nativescript.sh -./build_tklivesync.sh +./build_nativescript.sh --no-vision +./build_tklivesync.sh --no-vision ./prepare_dSYMs.sh -./build_npm.sh \ No newline at end of file +./build_npm_ios.sh \ No newline at end of file diff --git a/build_all_vision.sh b/build_all_vision.sh new file mode 100755 index 00000000..f5d1bd40 --- /dev/null +++ b/build_all_vision.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +rm -rf ./dist +./update_version.sh +./build_metadata_generator.sh +./build_nativescript.sh --no-catalyst --no-iphone --no-sim +./build_tklivesync.sh --no-catalyst --no-iphone --no-sim +./prepare_dSYMs.sh +./build_npm_vision.sh \ No newline at end of file diff --git a/build_metadata_generator.sh b/build_metadata_generator.sh index 2a1995cc..d3544fe4 100755 --- a/build_metadata_generator.sh +++ b/build_metadata_generator.sh @@ -23,8 +23,13 @@ rm -rf dist mkdir dist checkpoint "Building metadata generator for x86_64 ..." build "x86_64" +# make sure the binary is linked against the system libc++ instead of an @rpath one (which happens when compiling on arm64) +# todo: perhaps there is a better way to do this with cmake? +install_name_tool -change @rpath/libc++.1.dylib /usr/lib/libc++.1.dylib dist/x86_64/bin/objc-metadata-generator +otool -L dist/x86_64/bin/objc-metadata-generator checkpoint "Building metadata generator for arm64 ..." build "arm64" +otool -L dist/arm64/bin/objc-metadata-generator rm -rf build popd \ No newline at end of file diff --git a/build_nativescript.sh b/build_nativescript.sh index ccac9040..4cdfdcf0 100755 --- a/build_nativescript.sh +++ b/build_nativescript.sh @@ -26,6 +26,7 @@ function to_bool() { BUILD_CATALYST=$(to_bool ${BUILD_CATALYST:=true}) BUILD_IPHONE=$(to_bool ${BUILD_IPHONE:=true}) BUILD_SIMULATOR=$(to_bool ${BUILD_SIMULATOR:=true}) +BUILD_VISION=$(to_bool ${BUILD_VISION:=true}) VERBOSE=$(to_bool ${VERBOSE:=false}) for arg in $@; do @@ -36,6 +37,8 @@ for arg in $@; do --no-sim|--no-simulator) BUILD_SIMULATOR=false ;; --iphone|--device) BUILD_IPHONE=true ;; --no-iphone|--no-device) BUILD_IPHONE=false ;; + --xr|--vision) BUILD_VISION=true ;; + --no-xr|--no-vision) BUILD_VISION=false ;; --verbose|-v) VERBOSE=true ;; *) ;; esac @@ -58,52 +61,17 @@ xcodebuild -project v8ios.xcodeproj \ -configuration Release clean \ $QUIET - -if $BUILD_CATALYST; then -checkpoint "Building NativeScript for Mac Catalyst" -xcodebuild archive -project v8ios.xcodeproj \ - -scheme "NativeScript" \ - -configuration Release \ - -destination "platform=macOS,variant=Mac Catalyst" \ - $QUIET \ - EXCLUDED_ARCHS="x86_64" \ - SKIP_INSTALL=NO \ - -archivePath $DIST/intermediates/NativeScript.maccatalyst.xcarchive -fi - if $BUILD_SIMULATOR; then -# checkpoint "Building for x86_64 iphone simulator" -# xcodebuild archive -project v8ios.xcodeproj \ -# -scheme "NativeScript" \ -# -configuration Release \ -# -arch x86_64 \ -# -sdk iphonesimulator \ -# $QUIET \ -# DEVELOPMENT_TEAM=$DEV_TEAM \ -# SKIP_INSTALL=NO \ -# -archivePath $DIST/NativeScript.x86_64-iphonesimulator.xcarchive - -# checkpoint "Building for ARM64 iphone simulator" -# xcodebuild archive -project v8ios.xcodeproj \ -# -scheme "NativeScript" \ -# -configuration Release \ -# -arch arm64 \ -# -sdk iphonesimulator \ -# $QUIET \ -# DEVELOPMENT_TEAM=$DEV_TEAM \ -# SKIP_INSTALL=NO \ -# -archivePath $DIST/NativeScript.arm64-iphonesimulator.xcarchive - checkpoint "Building NativeScript for iphone simulators (multi-arch)" xcodebuild archive -project v8ios.xcodeproj \ -scheme "NativeScript" \ -configuration Release \ -destination "generic/platform=iOS Simulator" \ - -sdk iphonesimulator \ $QUIET \ EXCLUDED_ARCHS="i386" \ DEVELOPMENT_TEAM=$DEV_TEAM \ SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ -archivePath $DIST/intermediates/NativeScript.iphonesimulator.xcarchive fi @@ -113,27 +81,54 @@ xcodebuild archive -project v8ios.xcodeproj \ -scheme "NativeScript" \ -configuration Release \ -destination "generic/platform=iOS" \ - -sdk iphoneos \ $QUIET \ EXCLUDED_ARCHS="armv7" \ DEVELOPMENT_TEAM=$DEV_TEAM \ SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ -archivePath $DIST/intermediates/NativeScript.iphoneos.xcarchive +fi -#Create fat library for simulator -# rm -rf "$DIST/NativeScript.iphonesimulator.xcarchive" +if $BUILD_CATALYST; then +checkpoint "Building NativeScript for Mac Catalyst" +xcodebuild archive -project v8ios.xcodeproj \ + -scheme "NativeScript" \ + -configuration Release \ + -destination "generic/platform=macOS,variant=Mac Catalyst" \ + $QUIET \ + EXCLUDED_ARCHS="x86_64" \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ + -archivePath $DIST/intermediates/NativeScript.maccatalyst.xcarchive +fi -# cp -R \ -# "$DIST/NativeScript.x86_64-iphonesimulator.xcarchive" \ -# "$DIST/NativeScript.iphonesimulator.xcarchive" +if $BUILD_VISION; then -# rm "$DIST/NativeScript.iphonesimulator.xcarchive/Products/Library/Frameworks/NativeScript.framework/NativeScript" +checkpoint "Building NativeScript for visionOS Device" +xcodebuild archive -project v8ios.xcodeproj \ + -scheme "NativeScript" \ + -configuration Release \ + -destination "generic/platform=visionOS" \ + $QUIET \ + EXCLUDED_ARCHS="i386 x86_64" \ + VALID_ARCHS=arm64 \ + DEVELOPMENT_TEAM=$DEV_TEAM \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ + -archivePath $DIST/intermediates/NativeScript.xros.xcarchive -# lipo -create \ -# "$DIST/NativeScript.x86_64-iphonesimulator.xcarchive/Products/Library/Frameworks/NativeScript.framework/NativeScript" \ -# "$DIST/NativeScript.arm64-iphonesimulator.xcarchive/Products/Library/Frameworks/NativeScript.framework/NativeScript" \ -# -output \ -# "$DIST/NativeScript.iphonesimulator.xcarchive/Products/Library/Frameworks/NativeScript.framework/NativeScript" +checkpoint "Building NativeScript for visionOS Simulators" +xcodebuild archive -project v8ios.xcodeproj \ + -scheme "NativeScript" \ + -configuration Release \ + -destination "generic/platform=visionOS Simulator" \ + $QUIET \ + EXCLUDED_ARCHS="i386 x86_64" \ + VALID_ARCHS=arm64 \ + DEVELOPMENT_TEAM=$DEV_TEAM \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ + -archivePath $DIST/intermediates/NativeScript.xrsimulator.xcarchive fi XCFRAMEWORKS=() @@ -152,6 +147,13 @@ if $BUILD_IPHONE; then -debug-symbols "$DIST/intermediates/NativeScript.iphoneos.xcarchive/dSYMs/NativeScript.framework.dSYM" ) fi +if $BUILD_VISION; then + XCFRAMEWORKS+=( -framework "$DIST/intermediates/NativeScript.xros.xcarchive/Products/Library/Frameworks/NativeScript.framework" \ + -debug-symbols "$DIST/intermediates/NativeScript.xros.xcarchive/dSYMs/NativeScript.framework.dSYM" ) + XCFRAMEWORKS+=( -framework "$DIST/intermediates/NativeScript.xrsimulator.xcarchive/Products/Library/Frameworks/NativeScript.framework" \ + -debug-symbols "$DIST/intermediates/NativeScript.xrsimulator.xcarchive/dSYMs/NativeScript.framework.dSYM" ) +fi + checkpoint "Creating NativeScript.xcframework" OUTPUT_DIR="$DIST/NativeScript.xcframework" rm -rf $OUTPUT_DIR diff --git a/build_npm.sh b/build_npm_ios.sh similarity index 83% rename from build_npm.sh rename to build_npm_ios.sh index 38b2cf41..8f36cbb0 100755 --- a/build_npm.sh +++ b/build_npm_ios.sh @@ -1,12 +1,15 @@ #!/bin/bash set -e +source "$(dirname "$0")/build_utils.sh" +checkpoint "Preparing npm package for iOS..." OUTPUT_DIR="dist/npm" rm -rf "$OUTPUT_DIR" mkdir -p "$OUTPUT_DIR" mkdir -p "$OUTPUT_DIR/framework" cp ./package.json "$OUTPUT_DIR" -cp -r "./project-template/" "$OUTPUT_DIR/framework" + +cp -r "./project-template-ios/" "$OUTPUT_DIR/framework" cp -r "dist/NativeScript.xcframework" "$OUTPUT_DIR/framework/internal" cp -r "dist/TKLiveSync.xcframework" "$OUTPUT_DIR/framework/internal" @@ -28,4 +31,6 @@ cp -r "metadata-generator/dist/arm64/." "$OUTPUT_DIR/framework/internal/metadata pushd "$OUTPUT_DIR" npm pack mv *.tgz ../ -popd \ No newline at end of file +popd + +checkpoint "npm package created." \ No newline at end of file diff --git a/build_npm_vision.sh b/build_npm_vision.sh new file mode 100755 index 00000000..8685cbcf --- /dev/null +++ b/build_npm_vision.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -e +source "$(dirname "$0")/build_utils.sh" + +checkpoint "Preparing npm package for visionOS..." +OUTPUT_DIR="dist/npm" +rm -rf "$OUTPUT_DIR" +mkdir -p "$OUTPUT_DIR" +mkdir -p "$OUTPUT_DIR/framework" +cp ./package.json "$OUTPUT_DIR" + +cp -r "./project-template-vision/" "$OUTPUT_DIR/framework" + +cp -r "dist/NativeScript.xcframework" "$OUTPUT_DIR/framework/internal" +cp -r "dist/TKLiveSync.xcframework" "$OUTPUT_DIR/framework/internal" + +mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64" +cp -r "metadata-generator/dist/x86_64/." "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64" + +mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-arm64" +cp -r "metadata-generator/dist/arm64/." "$OUTPUT_DIR/framework/internal/metadata-generator-arm64" + +# Add xcframeworks to .zip (NPM modules do not support symlinks, unzipping is done by {N} CLI) +( + set -e + cd $OUTPUT_DIR/framework/internal + zip -qr --symlinks XCFrameworks.zip *.xcframework + rm -rf *.xcframework +) + +pushd "$OUTPUT_DIR" +npm pack +mv *.tgz ../ +popd + +checkpoint "npm package created." \ No newline at end of file diff --git a/build_tklivesync.sh b/build_tklivesync.sh index c9b5ec8a..e24a0e3b 100755 --- a/build_tklivesync.sh +++ b/build_tklivesync.sh @@ -2,6 +2,48 @@ set -e source "$(dirname "$0")/build_utils.sh" +function to_bool() { + local arg="$1" + case "$(echo "$arg" | tr '[:upper:]' '[:lower:]')" in + [0-9]+) + if [ $arg -eq 0 ]; then + echo false + else + echo true + fi + ;; + n|no|f|false) echo false ;; + y|yes|t|true) echo true ;; + * ) + if [ -n "$arg" ]; then + echo "warning: invalid boolean argument ('$arg'). Expected true or false" >&2 + fi + echo false + ;; + esac; +} + +BUILD_CATALYST=$(to_bool ${BUILD_CATALYST:=true}) +BUILD_IPHONE=$(to_bool ${BUILD_IPHONE:=true}) +BUILD_SIMULATOR=$(to_bool ${BUILD_SIMULATOR:=true}) +BUILD_VISION=$(to_bool ${BUILD_VISION:=true}) +VERBOSE=$(to_bool ${VERBOSE:=false}) + +for arg in $@; do + case $arg in + --catalyst|--maccatalyst) BUILD_CATALYST=true ;; + --no-catalyst|--no-maccatalyst) BUILD_CATALYST=false ;; + --sim|--simulator) BUILD_SIMULATOR=true ;; + --no-sim|--no-simulator) BUILD_SIMULATOR=false ;; + --iphone|--device) BUILD_IPHONE=true ;; + --no-iphone|--no-device) BUILD_IPHONE=false ;; + --xr|--vision) BUILD_VISION=true ;; + --no-xr|--no-vision) BUILD_VISION=false ;; + --verbose|-v) VERBOSE=true ;; + *) ;; + esac +done + DIST=$(PWD)/dist mkdir -p $DIST @@ -14,56 +56,67 @@ xcodebuild -project v8ios.xcodeproj \ -configuration Release clean \ -quiet -#generates library for Mac Catalyst target -checkpoint "Building TKLiveSync for Mac Catalyst" -xcodebuild archive -project v8ios.xcodeproj \ - -scheme TKLiveSync \ - -configuration Release \ - -destination "platform=macOS,variant=Mac Catalyst" \ - -quiet \ - SKIP_INSTALL=NO \ - -archivePath $DIST/intermediates/TKLiveSync.maccatalyst.xcarchive - -# #generates library for x86_64 simulator target -# xcodebuild archive -project v8ios.xcodeproj \ -# -scheme TKLiveSync \ -# -configuration Release \ -# -sdk iphonesimulator \ -# -quiet \ -# SKIP_INSTALL=NO \ -# -archivePath $DIST/TKLiveSync.x86_64-iphonesimulator.xcarchive - -# #generates library for arm64 simulator target -# xcodebuild archive -project v8ios.xcodeproj \ -# -scheme TKLiveSync \ -# -configuration Release \ -# -sdk iphonesimulator \ -# -arch arm64 \ -# -quiet \ -# SKIP_INSTALL=NO \ -# -archivePath $DIST/TKLiveSync.arm64-iphonesimulator.xcarchive - +if $BUILD_SIMULATOR; then # generates library for simulator targets (usually includes arm64, x86_64) checkpoint "Building TKLiveSync for iphone simulators (multi-arch)" xcodebuild archive -project v8ios.xcodeproj \ -scheme TKLiveSync \ -configuration Release \ -destination "generic/platform=iOS Simulator" \ - -sdk iphonesimulator \ -quiet \ SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ -archivePath $DIST/intermediates/TKLiveSync.iphonesimulator.xcarchive +fi +if $BUILD_IPHONE; then #generates library for device target checkpoint "Building TKLiveSync for ARM64 device" xcodebuild archive -project v8ios.xcodeproj \ -scheme TKLiveSync \ -configuration Release \ -destination "generic/platform=iOS" \ - -sdk iphoneos \ -quiet \ SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ -archivePath $DIST/intermediates/TKLiveSync.iphoneos.xcarchive +fi + +if $BUILD_CATALYST; then +#generates library for Mac Catalyst target +checkpoint "Building TKLiveSync for Mac Catalyst" +xcodebuild archive -project v8ios.xcodeproj \ + -scheme TKLiveSync \ + -configuration Release \ + -destination "generic/platform=macOS,variant=Mac Catalyst" \ + -quiet \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ + -archivePath $DIST/intermediates/TKLiveSync.maccatalyst.xcarchive +fi + +if $BUILD_VISION; then +#generates library for visionOS targets +checkpoint "Building TKLiveSync for visionOS Simulators" +xcodebuild archive -project v8ios.xcodeproj \ + -scheme "TKLiveSync" \ + -configuration Release \ + -destination "generic/platform=visionOS Simulator" \ + -quiet \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ + -archivePath $DIST/intermediates/TKLiveSync.xrsimulator.xcarchive + +checkpoint "Building TKLiveSync for visionOS Device" +xcodebuild archive -project v8ios.xcodeproj \ + -scheme "TKLiveSync" \ + -configuration Release \ + -destination "generic/platform=visionOS" \ + -quiet \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ + -archivePath $DIST/intermediates/TKLiveSync.xros.xcarchive +fi #Creates directory for fat-library OUTPUT_DIR="$DIST/TKLiveSync.xcframework" @@ -85,15 +138,34 @@ rm -rf "${OUTPUT_PATH}" # "$DIST/TKLiveSync.iphonesimulator.xcarchive/Products/Library/Frameworks/TKLiveSync.framework/TKLiveSync" #Creates xcframework +XCFRAMEWORKS=() +if $BUILD_CATALYST; then + XCFRAMEWORKS+=( -framework "$DIST/intermediates/TKLiveSync.maccatalyst.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \ + -debug-symbols "$DIST/intermediates/TKLiveSync.maccatalyst.xcarchive/dSYMs/TKLiveSync.framework.dSYM" ) +fi + +if $BUILD_SIMULATOR; then + XCFRAMEWORKS+=( -framework "$DIST/intermediates/TKLiveSync.iphonesimulator.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \ + -debug-symbols "$DIST/intermediates/TKLiveSync.iphonesimulator.xcarchive/dSYMs/TKLiveSync.framework.dSYM" ) +fi + +if $BUILD_IPHONE; then + XCFRAMEWORKS+=( -framework "$DIST/intermediates/TKLiveSync.iphoneos.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \ + -debug-symbols "$DIST/intermediates/TKLiveSync.iphoneos.xcarchive/dSYMs/TKLiveSync.framework.dSYM" ) +fi + +if $BUILD_VISION; then + XCFRAMEWORKS+=( -framework "$DIST/intermediates/TKLiveSync.xros.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \ + -debug-symbols "$DIST/intermediates/TKLiveSync.xros.xcarchive/dSYMs/TKLiveSync.framework.dSYM" ) + XCFRAMEWORKS+=( -framework "$DIST/intermediates/TKLiveSync.xrsimulator.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \ + -debug-symbols "$DIST/intermediates/TKLiveSync.xrsimulator.xcarchive/dSYMs/TKLiveSync.framework.dSYM" ) +fi + checkpoint "Creating TKLiveSync.xcframework" -xcodebuild -create-xcframework \ - -framework "$DIST/intermediates/TKLiveSync.maccatalyst.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \ - -debug-symbols "$DIST/intermediates/TKLiveSync.maccatalyst.xcarchive/dSYMs/TKLiveSync.framework.dSYM" \ - -framework "$DIST/intermediates/TKLiveSync.iphonesimulator.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \ - -debug-symbols "$DIST/intermediates/TKLiveSync.iphonesimulator.xcarchive/dSYMs/TKLiveSync.framework.dSYM" \ - -framework "$DIST/intermediates/TKLiveSync.iphoneos.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \ - -debug-symbols "$DIST/intermediates/TKLiveSync.iphoneos.xcarchive/dSYMs/TKLiveSync.framework.dSYM" \ - -output "$OUTPUT_DIR" +OUTPUT_DIR="$DIST/TKLiveSync.xcframework" +rm -rf $OUTPUT_DIR +echo xcodebuild -create-xcframework ${XCFRAMEWORKS[@]} -output "$OUTPUT_DIR" +xcodebuild -create-xcframework ${XCFRAMEWORKS[@]} -output "$OUTPUT_DIR" rm -rf "$DIST/intermediates" diff --git a/build_v8_source.sh b/build_v8_source.sh index a23ae281..53363616 100755 --- a/build_v8_source.sh +++ b/build_v8_source.sh @@ -4,7 +4,7 @@ source "$(dirname "$0")/build_utils.sh" pushd v8 -ARCH_ARR=(x64-simulator arm64-simulator arm64-device) +ARCH_ARR=(x64-simulator arm64-simulator arm64-xrsimulator arm64-device) MODULES=( cppgc_base torque_generated_definitions diff --git a/metadata-generator/CMakeLists.txt b/metadata-generator/CMakeLists.txt index 49c3f365..5c6dc8d4 100644 --- a/metadata-generator/CMakeLists.txt +++ b/metadata-generator/CMakeLists.txt @@ -14,7 +14,7 @@ if (NOT LIBXML2_FOUND) endif () get_filename_component(LLVM_ROOT "../../llvm/15.0.7" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") -set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0) +set(CMAKE_OSX_DEPLOYMENT_TARGET 13.0) set(LLVM_SYSTEM_LIBS "-lz -lcurses -lm -lxml2") set(LLVM_PREPROCESSOR_FLAGS "-I${LLVM_ROOT}/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS") diff --git a/metadata-generator/build-step-metadata-generator.py b/metadata-generator/build-step-metadata-generator.py index ede0531f..bcf373f2 100755 --- a/metadata-generator/build-step-metadata-generator.py +++ b/metadata-generator/build-step-metadata-generator.py @@ -47,6 +47,14 @@ def map_and_list(func, iterable): docset_platform = "maccatalyst" default_deployment_target_flag_name = "-mmaccatalyst-version-min" default_deployment_target_clang_env_name = "MACCATALYST_DEPLOYMENT_TARGET" +elif effective_platform_name == "-xrsimulator": + docset_platform = "xros" + default_deployment_target_flag_name = "-mxrossimulator-version-min" + default_deployment_target_clang_env_name = "XROS_DEPLOYMENT_TARGET" +elif effective_platform_name == "-xros": + docset_platform = "xros" + default_deployment_target_flag_name = "-mxros-version-min" + default_deployment_target_clang_env_name = "XROS_DEPLOYMENT_TARGET" elif effective_platform_name == "-watchos": docset_platform = "watchOS" default_deployment_target_flag_name = "-mwatchos-version-min" diff --git a/package.json b/package.json index 8213ba21..a1fa597f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nativescript/ios", "description": "NativeScript Runtime for iOS", - "version": "8.7.0-alpha.0", + "version": "8.7.0-rc.1", "keywords": [ "NativeScript", "iOS", @@ -23,7 +23,8 @@ "apply-patches": "./apply_patches.sh", "build-v8-source": "./build_v8_source.sh", "build-v8-source-catalyst": "./build_v8_source_catalyst.sh", - "build": "./build_all.sh", + "build-ios": "node prepare-target ios && ./build_all_ios.sh", + "build-vision": "node prepare-target visionos && ./build_all_vision.sh", "setup-ci": "./build_metadata_generator.sh", "update-version": "./update_version.sh", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", @@ -35,4 +36,4 @@ "dayjs": "^1.11.7", "semver": "^7.5.0" } -} +} \ No newline at end of file diff --git a/prepare-target.js b/prepare-target.js new file mode 100644 index 00000000..45d816c2 --- /dev/null +++ b/prepare-target.js @@ -0,0 +1,13 @@ +const path = require('path'); +const fs = require('fs'); + +const cmdArgs = process.argv.slice(2); +const target = cmdArgs[0]; // ios or visionos + +const packagePath = path.join('package.json'); +const packageJson = JSON.parse(fs.readFileSync(packagePath)); + +packageJson.name = `@nativescript/${target}`; +packageJson.description = `NativeScript Runtime for ${target === 'ios' ? 'iOS' : 'visionOS'}`; + +fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2)); \ No newline at end of file diff --git a/project-template/__PROJECT_NAME__.xcodeproj/project.pbxproj b/project-template-ios/__PROJECT_NAME__.xcodeproj/project.pbxproj similarity index 93% rename from project-template/__PROJECT_NAME__.xcodeproj/project.pbxproj rename to project-template-ios/__PROJECT_NAME__.xcodeproj/project.pbxproj index 764e6acd..8e2eaa92 100644 --- a/project-template/__PROJECT_NAME__.xcodeproj/project.pbxproj +++ b/project-template-ios/__PROJECT_NAME__.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 858B842D18CA22B800AB12DE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 858B833A18CA111C00AB12DE /* InfoPlist.strings */; }; + AAA0AADB2A54B96B00EE55A4 /* NativeScriptStart.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */; }; CD45EE7C18DC2D5800FB50C0 /* app in Resources */ = {isa = PBXBuildFile; fileRef = CD45EE7A18DC2D5800FB50C0 /* app */; }; CD62955D1BB2678900AE3A93 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CD62955C1BB2678900AE3A93 /* main.m */; }; /* End PBXBuildFile section */ @@ -47,6 +48,9 @@ 858B833F18CA111C00AB12DE /* __PROJECT_NAME__-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "__PROJECT_NAME__-Prefix.pch"; sourceTree = ""; }; 858B843318CA22B800AB12DE /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = __PROJECT_NAME__.app; sourceTree = BUILT_PRODUCTS_DIR; }; 930F05DB22671AE300D269DC /* Swift-ObjC-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Swift-ObjC-Bridging-Header.h"; path = "internal/Swift-ObjC-Bridging-Header.h"; sourceTree = SOURCE_ROOT; }; + AA5E89E22B5C318D008AFA28 /* macros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = macros.h; path = internal/macros.h; sourceTree = SOURCE_ROOT; }; + AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = NativeScriptStart.m; path = internal/NativeScriptStart.m; sourceTree = SOURCE_ROOT; }; + AAA0AADC2A54B97E00EE55A4 /* NativeScriptStart.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeScriptStart.h; path = internal/NativeScriptStart.h; sourceTree = SOURCE_ROOT; }; CD45EE7A18DC2D5800FB50C0 /* app */ = {isa = PBXFileReference; lastKnownFileType = folder; path = app; sourceTree = ""; }; CD62955C1BB2678900AE3A93 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = internal/main.m; sourceTree = SOURCE_ROOT; }; CDD59A261BB43B5D00EC2671 /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "build-debug.xcconfig"; sourceTree = ""; }; @@ -68,7 +72,10 @@ 39940D8E22C4EBCC0050DDE1 /* Sources */ = { isa = PBXGroup; children = ( + AA5E89E22B5C318D008AFA28 /* macros.h */, CD62955C1BB2678900AE3A93 /* main.m */, + AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */, + AAA0AADC2A54B97E00EE55A4 /* NativeScriptStart.h */, 858B833F18CA111C00AB12DE /* __PROJECT_NAME__-Prefix.pch */, ); name = Sources; @@ -179,11 +186,13 @@ 858B832618CA111C00AB12DE /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; CLASSPREFIX = NSC; - LastUpgradeCheck = 1330; + LastUpgradeCheck = 1500; ORGANIZATIONNAME = NativeScript; TargetAttributes = { 858B83EF18CA22B800AB12DE = { + LastSwiftMigration = 1520; ProvisioningStyle = Automatic; }; }; @@ -279,6 +288,7 @@ buildActionMask = 2147483647; files = ( CD62955D1BB2678900AE3A93 /* main.m in Sources */, + AAA0AADB2A54B96B00EE55A4 /* NativeScriptStart.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -304,7 +314,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_MODULES = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -331,6 +341,7 @@ DERIVE_UIKITFORMAC_PRODUCT_BUNDLE_IDENTIFIER = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -345,7 +356,6 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - STRIP_SWIFT_SYMBOLS = NO; SUPPORTS_UIKITFORMAC = YES; SWIFT_OBJC_BRIDGING_HEADER = "$SRCROOT/internal/Swift-ObjC-Bridging-Header.h"; SWIFT_VERSION = 4.2; @@ -360,7 +370,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_MODULES = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -387,6 +397,7 @@ DERIVE_UIKITFORMAC_PRODUCT_BUNDLE_IDENTIFIER = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -397,7 +408,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; SDKROOT = iphoneos; - STRIP_SWIFT_SYMBOLS = NO; SUPPORTS_UIKITFORMAC = YES; SWIFT_OBJC_BRIDGING_HEADER = "$SRCROOT/internal/Swift-ObjC-Bridging-Header.h"; SWIFT_VERSION = 4.2; @@ -418,6 +428,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", "DEBUG=1", + "NS_SWIFTUI_BOOT=$(NS_SWIFTUI_BOOT:default=0)", ); HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -444,6 +455,10 @@ "ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "__PROJECT_NAME__/__PROJECT_NAME__-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "NS_SWIFTUI_BOOT=$(NS_SWIFTUI_BOOT:default=0)", + ); HEADER_SEARCH_PATHS = ( "$(inherited)", "$SRCROOT/internal/Swift-Modules", diff --git a/project-template/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme b/project-template-ios/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme similarity index 99% rename from project-template/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme rename to project-template-ios/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme index b51c69cc..ecbb26ff 100644 --- a/project-template/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme +++ b/project-template-ios/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme @@ -1,6 +1,6 @@ + com.apple.security.app-sandbox + com.apple.security.cs.allow-unsigned-executable-memory com.apple.security.network.client - \ No newline at end of file + diff --git a/project-template/__PROJECT_NAME__/build-debug.xcconfig b/project-template-ios/__PROJECT_NAME__/build-debug.xcconfig similarity index 100% rename from project-template/__PROJECT_NAME__/build-debug.xcconfig rename to project-template-ios/__PROJECT_NAME__/build-debug.xcconfig diff --git a/project-template/__PROJECT_NAME__/build-release.xcconfig b/project-template-ios/__PROJECT_NAME__/build-release.xcconfig similarity index 100% rename from project-template/__PROJECT_NAME__/build-release.xcconfig rename to project-template-ios/__PROJECT_NAME__/build-release.xcconfig diff --git a/project-template/__PROJECT_NAME__/build.xcconfig b/project-template-ios/__PROJECT_NAME__/build.xcconfig similarity index 100% rename from project-template/__PROJECT_NAME__/build.xcconfig rename to project-template-ios/__PROJECT_NAME__/build.xcconfig diff --git a/project-template/__PROJECT_NAME__/en.lproj/InfoPlist.strings b/project-template-ios/__PROJECT_NAME__/en.lproj/InfoPlist.strings similarity index 100% rename from project-template/__PROJECT_NAME__/en.lproj/InfoPlist.strings rename to project-template-ios/__PROJECT_NAME__/en.lproj/InfoPlist.strings diff --git a/project-template-ios/internal/NativeScriptStart.h b/project-template-ios/internal/NativeScriptStart.h new file mode 100644 index 00000000..d55d0693 --- /dev/null +++ b/project-template-ios/internal/NativeScriptStart.h @@ -0,0 +1,19 @@ +// +// NativeScriptStart.h +// +// Created by Team nStudio on 7/5/23. +// Copyright © 2023 NativeScript. All rights reserved. +// + +#ifndef NativeScriptStart_h +#define NativeScriptStart_h + + +#endif /* NativeScriptStart_h */ + +@interface NativeScriptStart : NSObject + ++ (void)setup; ++ (void)boot; + +@end diff --git a/project-template-ios/internal/NativeScriptStart.m b/project-template-ios/internal/NativeScriptStart.m new file mode 100644 index 00000000..563251a7 --- /dev/null +++ b/project-template-ios/internal/NativeScriptStart.m @@ -0,0 +1,73 @@ +// +// NativeScriptStart.m +// +// Created by Team nStudio on 7/5/23. +// Copyright © 2023 NativeScript. All rights reserved. +// + +#import +#import +#import + +#ifdef DEBUG +#include +#include +#include "macros.h" +#endif + +extern char startOfMetadataSection __asm("section$start$__DATA$__TNSMetadata"); +NativeScript* nativescriptStart; + +@implementation NativeScriptStart + ++(void)setup{ + @autoreleasepool { + NSString* baseDir = [[NSBundle mainBundle] resourcePath]; + + #ifdef DEBUG + int refreshRequestSubscription; + notify_register_dispatch(NOTIFICATION("RefreshRequest"), &refreshRequestSubscription, dispatch_get_main_queue(), ^(int token) { + notify_post(NOTIFICATION("AppRefreshStarted")); + bool success = [nativescriptStart liveSync]; + if (success) { + notify_post(NOTIFICATION("AppRefreshSucceeded")); + } else { + NSLog(@"__onLiveSync call failed"); + notify_post(NOTIFICATION("AppRefreshFailed")); + } + }); + + TNSInitializeLiveSync(); + if (getenv("TNSBaseDir")) { + baseDir = @(getenv("TNSBaseDir")); + } + #endif + + void* metadataPtr = &startOfMetadataSection; + + bool isDebug = + #ifdef DEBUG + true; + #else + false; + #endif + + Config* config = [[Config alloc] init]; + config.IsDebug = isDebug; + config.LogToSystemConsole = isDebug; + config.MetadataPtr = metadataPtr; + config.BaseDir = baseDir; +// config.ArgumentsCount = argc; +// config.Arguments = argv; + + nativescriptStart = [[NativeScript alloc] initWithConfig:config]; + + } + +} ++(void)boot{ + [nativescriptStart runMainApplication]; +} +@end + + diff --git a/project-template/internal/README.md b/project-template-ios/internal/README.md similarity index 100% rename from project-template/internal/README.md rename to project-template-ios/internal/README.md diff --git a/project-template/internal/Swift-ObjC-Bridging-Header.h b/project-template-ios/internal/Swift-ObjC-Bridging-Header.h similarity index 84% rename from project-template/internal/Swift-ObjC-Bridging-Header.h rename to project-template-ios/internal/Swift-ObjC-Bridging-Header.h index 91fe0da3..7db14b65 100644 --- a/project-template/internal/Swift-ObjC-Bridging-Header.h +++ b/project-template-ios/internal/Swift-ObjC-Bridging-Header.h @@ -9,3 +9,6 @@ // Intentionally left blank. Needed for the generation of all Swift classes in // the *-Swift.h*. // https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_objective-c_into_swift + +#import "NativeScript/NativeScript.h" +#import "NativeScriptStart.h" diff --git a/project-template-ios/internal/macros.h b/project-template-ios/internal/macros.h new file mode 100644 index 00000000..03082095 --- /dev/null +++ b/project-template-ios/internal/macros.h @@ -0,0 +1,17 @@ +// +// macros.h +// sampleng +// +// Created by Team nStudio on 1/19/24. +// Copyright © 2024 NativeScript. All rights reserved. +// + +#ifndef macros_h +#define macros_h + +#define NOTIFICATION(name) \ + [[NSString stringWithFormat:@"%@:NativeScript.Debug.%s", \ + [[NSBundle mainBundle] bundleIdentifier], name] UTF8String] + + +#endif /* macros_h */ diff --git a/project-template-ios/internal/main.m b/project-template-ios/internal/main.m new file mode 100644 index 00000000..f9da2556 --- /dev/null +++ b/project-template-ios/internal/main.m @@ -0,0 +1,67 @@ +// +// Any changes in this file will be removed after you update your platform! +// +#import +#import + +#ifdef DEBUG +#include +#include +#include "macros.h" +#endif + +#if NS_SWIFTUI_BOOT == 0 +// Users can disable Obj-C bootstrapping by defining NS_SWIFTUI_BOOT = 1 in their project's build.xcconfig file +// This requires a NativeScriptApp.swift to be setup in the project and embedding enabled in @nativescript/core bootstrap + +extern char startOfMetadataSection __asm("section$start$__DATA$__TNSMetadata"); +NativeScript* nativescript; + +int main(int argc, char *argv[]) { + @autoreleasepool { + NSString* baseDir = [[NSBundle mainBundle] resourcePath]; + +#ifdef DEBUG + int refreshRequestSubscription; + notify_register_dispatch(NOTIFICATION("RefreshRequest"), &refreshRequestSubscription, dispatch_get_main_queue(), ^(int token) { + notify_post(NOTIFICATION("AppRefreshStarted")); + bool success = [nativescript liveSync]; + if (success) { + notify_post(NOTIFICATION("AppRefreshSucceeded")); + } else { + NSLog(@"__onLiveSync call failed"); + notify_post(NOTIFICATION("AppRefreshFailed")); + } + }); + + TNSInitializeLiveSync(); + if (getenv("TNSBaseDir")) { + baseDir = @(getenv("TNSBaseDir")); + } +#endif + + void* metadataPtr = &startOfMetadataSection; + + bool isDebug = +#ifdef DEBUG + true; +#else + false; +#endif + + Config* config = [[Config alloc] init]; + config.IsDebug = isDebug; + config.LogToSystemConsole = isDebug; + config.MetadataPtr = metadataPtr; + config.BaseDir = baseDir; + config.ArgumentsCount = argc; + config.Arguments = argv; + + nativescript = [[NativeScript alloc] initWithConfig:config]; + [nativescript runMainApplication]; + + return 0; + } +} + +#endif diff --git a/project-template/internal/nativescript-build.xcconfig b/project-template-ios/internal/nativescript-build.xcconfig similarity index 100% rename from project-template/internal/nativescript-build.xcconfig rename to project-template-ios/internal/nativescript-build.xcconfig diff --git a/project-template/internal/nativescript-post-build b/project-template-ios/internal/nativescript-post-build similarity index 100% rename from project-template/internal/nativescript-post-build rename to project-template-ios/internal/nativescript-post-build diff --git a/project-template/internal/nativescript-pre-build b/project-template-ios/internal/nativescript-pre-build similarity index 100% rename from project-template/internal/nativescript-pre-build rename to project-template-ios/internal/nativescript-pre-build diff --git a/project-template/internal/nativescript-pre-link b/project-template-ios/internal/nativescript-pre-link similarity index 100% rename from project-template/internal/nativescript-pre-link rename to project-template-ios/internal/nativescript-pre-link diff --git a/project-template/internal/nsld.sh b/project-template-ios/internal/nsld.sh similarity index 100% rename from project-template/internal/nsld.sh rename to project-template-ios/internal/nsld.sh diff --git a/project-template/internal/strip-dynamic-framework-architectures.sh b/project-template-ios/internal/strip-dynamic-framework-architectures.sh similarity index 100% rename from project-template/internal/strip-dynamic-framework-architectures.sh rename to project-template-ios/internal/strip-dynamic-framework-architectures.sh diff --git a/project-template-vision/__PROJECT_NAME__.xcodeproj/project.pbxproj b/project-template-vision/__PROJECT_NAME__.xcodeproj/project.pbxproj new file mode 100644 index 00000000..01de986a --- /dev/null +++ b/project-template-vision/__PROJECT_NAME__.xcodeproj/project.pbxproj @@ -0,0 +1,509 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 858B842D18CA22B800AB12DE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 858B833A18CA111C00AB12DE /* InfoPlist.strings */; }; + AAA0AADB2A54B96B00EE55A4 /* NativeScriptStart.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */; }; + CD45EE7C18DC2D5800FB50C0 /* app in Resources */ = {isa = PBXBuildFile; fileRef = CD45EE7A18DC2D5800FB50C0 /* app */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 85F5BDFC1A9363BE006B9701 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */, + 39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 391174B521F1D7BF00BA2583 /* nativescript-build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "nativescript-build.xcconfig"; path = "internal/nativescript-build.xcconfig"; sourceTree = SOURCE_ROOT; }; + 391174B721F1D99900BA2583 /* plugins-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "plugins-release.xcconfig"; sourceTree = SOURCE_ROOT; }; + 391174B821F1D99900BA2583 /* plugins-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "plugins-debug.xcconfig"; sourceTree = SOURCE_ROOT; }; + 39940D8122C4E84C0050DDE1 /* __PROJECT_NAME__.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = __PROJECT_NAME__.entitlements; sourceTree = ""; }; + 39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = NativeScript.xcframework; path = internal/NativeScript.xcframework; sourceTree = ""; }; + 39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TKLiveSync.xcframework; path = internal/TKLiveSync.xcframework; sourceTree = ""; }; + 42C751E2232B769100186695 /* nativescript-pre-link */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "nativescript-pre-link"; path = "internal/nativescript-pre-link"; sourceTree = SOURCE_ROOT; }; + 42C751E3232B769100186695 /* strip-dynamic-framework-architectures.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "strip-dynamic-framework-architectures.sh"; path = "internal/strip-dynamic-framework-architectures.sh"; sourceTree = SOURCE_ROOT; }; + 42C751E4232B769100186695 /* nsld.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = nsld.sh; path = internal/nsld.sh; sourceTree = SOURCE_ROOT; }; + 42C751E5232B769100186695 /* nativescript-post-build */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "nativescript-post-build"; path = "internal/nativescript-post-build"; sourceTree = SOURCE_ROOT; }; + 42C751E6232B769100186695 /* nativescript-pre-build */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "nativescript-pre-build"; path = "internal/nativescript-pre-build"; sourceTree = SOURCE_ROOT; }; + 858B832E18CA111C00AB12DE /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = __PROJECT_NAME__.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 858B833918CA111C00AB12DE /* __PROJECT_NAME__-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "__PROJECT_NAME__-Info.plist"; sourceTree = ""; }; + 858B833B18CA111C00AB12DE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 858B833F18CA111C00AB12DE /* __PROJECT_NAME__-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "__PROJECT_NAME__-Prefix.pch"; sourceTree = ""; }; + 858B843318CA22B800AB12DE /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = __PROJECT_NAME__.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 930F05DB22671AE300D269DC /* Swift-ObjC-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Swift-ObjC-Bridging-Header.h"; path = "internal/Swift-ObjC-Bridging-Header.h"; sourceTree = SOURCE_ROOT; }; + AA5E89E32B5C3482008AFA28 /* macros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = macros.h; path = internal/macros.h; sourceTree = SOURCE_ROOT; }; + AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = NativeScriptStart.m; path = internal/NativeScriptStart.m; sourceTree = SOURCE_ROOT; }; + AAA0AADC2A54B97E00EE55A4 /* NativeScriptStart.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeScriptStart.h; path = internal/NativeScriptStart.h; sourceTree = SOURCE_ROOT; }; + CD45EE7A18DC2D5800FB50C0 /* app */ = {isa = PBXFileReference; lastKnownFileType = folder; path = app; sourceTree = ""; }; + CDD59A261BB43B5D00EC2671 /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "build-debug.xcconfig"; sourceTree = ""; }; + CDD59A271BB43B5D00EC2671 /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "build-release.xcconfig"; sourceTree = ""; }; + CDF4743E1BA4855C0087EA85 /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = build.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 858B83F418CA22B800AB12DE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 39940D8E22C4EBCC0050DDE1 /* Sources */ = { + isa = PBXGroup; + children = ( + AA5E89E32B5C3482008AFA28 /* macros.h */, + AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */, + AAA0AADC2A54B97E00EE55A4 /* NativeScriptStart.h */, + 858B833F18CA111C00AB12DE /* __PROJECT_NAME__-Prefix.pch */, + ); + name = Sources; + sourceTree = ""; + }; + 42C751E1232B767700186695 /* Build Scripts */ = { + isa = PBXGroup; + children = ( + 42C751E5232B769100186695 /* nativescript-post-build */, + 42C751E6232B769100186695 /* nativescript-pre-build */, + 42C751E2232B769100186695 /* nativescript-pre-link */, + 42C751E4232B769100186695 /* nsld.sh */, + 42C751E3232B769100186695 /* strip-dynamic-framework-architectures.sh */, + ); + name = "Build Scripts"; + sourceTree = ""; + }; + 858B832518CA111C00AB12DE = { + isa = PBXGroup; + children = ( + E070579D1B39A9D000214BF1 /* Resources */, + 858B833718CA111C00AB12DE /* __PROJECT_NAME__ */, + 858B833018CA111C00AB12DE /* Frameworks */, + 858B832F18CA111C00AB12DE /* Products */, + ); + sourceTree = ""; + }; + 858B832F18CA111C00AB12DE /* Products */ = { + isa = PBXGroup; + children = ( + 858B832E18CA111C00AB12DE /* __PROJECT_NAME__.app */, + 858B843318CA22B800AB12DE /* __PROJECT_NAME__.app */, + ); + name = Products; + sourceTree = ""; + }; + 858B833018CA111C00AB12DE /* Frameworks */ = { + isa = PBXGroup; + children = ( + 39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */, + 39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 858B833718CA111C00AB12DE /* __PROJECT_NAME__ */ = { + isa = PBXGroup; + children = ( + 39940D8E22C4EBCC0050DDE1 /* Sources */, + 39940D8122C4E84C0050DDE1 /* __PROJECT_NAME__.entitlements */, + CD45EE7A18DC2D5800FB50C0 /* app */, + 858B833818CA111C00AB12DE /* Supporting Files */, + ); + path = __PROJECT_NAME__; + sourceTree = ""; + }; + 858B833818CA111C00AB12DE /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 42C751E1232B767700186695 /* Build Scripts */, + 391174B821F1D99900BA2583 /* plugins-debug.xcconfig */, + 391174B721F1D99900BA2583 /* plugins-release.xcconfig */, + CDF4743E1BA4855C0087EA85 /* build.xcconfig */, + CDD59A261BB43B5D00EC2671 /* build-debug.xcconfig */, + CDD59A271BB43B5D00EC2671 /* build-release.xcconfig */, + 391174B521F1D7BF00BA2583 /* nativescript-build.xcconfig */, + 858B833918CA111C00AB12DE /* __PROJECT_NAME__-Info.plist */, + 858B833A18CA111C00AB12DE /* InfoPlist.strings */, + 930F05DB22671AE300D269DC /* Swift-ObjC-Bridging-Header.h */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + E070579D1B39A9D000214BF1 /* Resources */ = { + isa = PBXGroup; + children = ( + ); + name = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 858B83EF18CA22B800AB12DE /* __PROJECT_NAME__ */ = { + isa = PBXNativeTarget; + buildConfigurationList = 858B843018CA22B800AB12DE /* Build configuration list for PBXNativeTarget "__PROJECT_NAME__" */; + buildPhases = ( + C97FD7AC1ADE5369004DB2A4 /* NativeScript PreBuild */, + 858B83F218CA22B800AB12DE /* Sources */, + CD62955B1BB2651D00AE3A93 /* NativeScript PreLink */, + 858B83F418CA22B800AB12DE /* Frameworks */, + 858B842C18CA22B800AB12DE /* Resources */, + 85F5BDFC1A9363BE006B9701 /* Embed Frameworks */, + CD3EAD351B05FF060042DBFC /* NativeScript PostBuild */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = __PROJECT_NAME__; + productName = JDBridgeApp; + productReference = 858B843318CA22B800AB12DE /* __PROJECT_NAME__.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 858B832618CA111C00AB12DE /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + CLASSPREFIX = NSC; + LastUpgradeCheck = 1500; + ORGANIZATIONNAME = NativeScript; + TargetAttributes = { + 858B83EF18CA22B800AB12DE = { + LastSwiftMigration = 1520; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 858B832918CA111C00AB12DE /* Build configuration list for PBXProject "__PROJECT_NAME__" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 858B832518CA111C00AB12DE; + productRefGroup = 858B832F18CA111C00AB12DE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 858B83EF18CA22B800AB12DE /* __PROJECT_NAME__ */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 858B842C18CA22B800AB12DE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD45EE7C18DC2D5800FB50C0 /* app in Resources */, + 858B842D18CA22B800AB12DE /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + C97FD7AC1ADE5369004DB2A4 /* NativeScript PreBuild */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "NativeScript PreBuild"; + outputPaths = ( + "$CONFIGURATION_BUILD_DIR/metadata-arm64.bin", + "$CONFIGURATION_BUILD_DIR/metadata-arm64e.bin", + "$CONFIGURATION_BUILD_DIR/metadata-i386.bin", + "$CONFIGURATION_BUILD_DIR/metadata-x86_64.bin", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$SRCROOT/internal/nativescript-pre-build\"\n"; + showEnvVarsInLog = 0; + }; + CD3EAD351B05FF060042DBFC /* NativeScript PostBuild */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "NativeScript PostBuild"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$SRCROOT/internal/nativescript-post-build\"\n"; + showEnvVarsInLog = 0; + }; + CD62955B1BB2651D00AE3A93 /* NativeScript PreLink */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "NativeScript PreLink"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$SRCROOT/internal/nativescript-pre-link\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 858B83F218CA22B800AB12DE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AAA0AADB2A54B96B00EE55A4 /* NativeScriptStart.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 858B833A18CA111C00AB12DE /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 858B833B18CA111C00AB12DE /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 858B835818CA111C00AB12DE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DERIVE_UIKITFORMAC_PRODUCT_BUNDLE_IDENTIFIER = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SUPPORTS_UIKITFORMAC = YES; + SWIFT_OBJC_BRIDGING_HEADER = "$SRCROOT/internal/Swift-ObjC-Bridging-Header.h"; + SWIFT_VERSION = 4.2; + }; + name = Debug; + }; + 858B835918CA111C00AB12DE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + DERIVE_UIKITFORMAC_PRODUCT_BUNDLE_IDENTIFIER = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + SDKROOT = iphoneos; + SUPPORTS_UIKITFORMAC = YES; + SWIFT_OBJC_BRIDGING_HEADER = "$SRCROOT/internal/Swift-ObjC-Bridging-Header.h"; + SWIFT_VERSION = 4.2; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 858B843118CA22B800AB12DE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CDD59A261BB43B5D00EC2671 /* build-debug.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ENABLE_MODULES = NO; + CODE_SIGN_ENTITLEMENTS = __PROJECT_NAME__/__PROJECT_NAME__.entitlements; + ENABLE_BITCODE = NO; + "ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "__PROJECT_NAME__/__PROJECT_NAME__-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "DEBUG=1", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"$SRCROOT/internal/Swift-Modules\"", + "\"$(SRCROOT)/internal\"", + ); + INFOPLIST_FILE = "$(SRCROOT)/__PROJECT_NAME__/__PROJECT_NAME__-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_NAME = __PROJECT_NAME__; + SUPPORTED_PLATFORMS = "xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 7; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 858B843218CA22B800AB12DE /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CDD59A271BB43B5D00EC2671 /* build-release.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ENABLE_MODULES = NO; + CODE_SIGN_ENTITLEMENTS = __PROJECT_NAME__/__PROJECT_NAME__.entitlements; + ENABLE_BITCODE = NO; + "ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "__PROJECT_NAME__/__PROJECT_NAME__-Prefix.pch"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$SRCROOT/internal/Swift-Modules", + "$(SRCROOT)/internal", + ); + INFOPLIST_FILE = "$(SRCROOT)/__PROJECT_NAME__/__PROJECT_NAME__-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_NAME = __PROJECT_NAME__; + SUPPORTED_PLATFORMS = "xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 7; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 858B832918CA111C00AB12DE /* Build configuration list for PBXProject "__PROJECT_NAME__" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 858B835818CA111C00AB12DE /* Debug */, + 858B835918CA111C00AB12DE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 858B843018CA22B800AB12DE /* Build configuration list for PBXNativeTarget "__PROJECT_NAME__" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 858B843118CA22B800AB12DE /* Debug */, + 858B843218CA22B800AB12DE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 858B832618CA111C00AB12DE /* Project object */; +} diff --git a/project-template-vision/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme b/project-template-vision/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme new file mode 100644 index 00000000..ecbb26ff --- /dev/null +++ b/project-template-vision/__PROJECT_NAME__.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/project-template-vision/__PROJECT_NAME__/__PROJECT_NAME__-Prefix.pch b/project-template-vision/__PROJECT_NAME__/__PROJECT_NAME__-Prefix.pch new file mode 100644 index 00000000..6759b6c7 --- /dev/null +++ b/project-template-vision/__PROJECT_NAME__/__PROJECT_NAME__-Prefix.pch @@ -0,0 +1,12 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/project-template-vision/__PROJECT_NAME__/__PROJECT_NAME__.entitlements b/project-template-vision/__PROJECT_NAME__/__PROJECT_NAME__.entitlements new file mode 100644 index 00000000..f9105be8 --- /dev/null +++ b/project-template-vision/__PROJECT_NAME__/__PROJECT_NAME__.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.network.client + + + diff --git a/project-template-vision/__PROJECT_NAME__/build-debug.xcconfig b/project-template-vision/__PROJECT_NAME__/build-debug.xcconfig new file mode 100644 index 00000000..4526c022 --- /dev/null +++ b/project-template-vision/__PROJECT_NAME__/build-debug.xcconfig @@ -0,0 +1,3 @@ +// @COCOAPODS_SILENCE_WARNINGS@ // +#include "build.xcconfig" +#include "../plugins-debug.xcconfig" diff --git a/project-template-vision/__PROJECT_NAME__/build-release.xcconfig b/project-template-vision/__PROJECT_NAME__/build-release.xcconfig new file mode 100644 index 00000000..f65f3e98 --- /dev/null +++ b/project-template-vision/__PROJECT_NAME__/build-release.xcconfig @@ -0,0 +1,3 @@ +// @COCOAPODS_SILENCE_WARNINGS@ // +#include "build.xcconfig" +#include "../plugins-release.xcconfig" diff --git a/project-template-vision/__PROJECT_NAME__/build.xcconfig b/project-template-vision/__PROJECT_NAME__/build.xcconfig new file mode 100644 index 00000000..65686340 --- /dev/null +++ b/project-template-vision/__PROJECT_NAME__/build.xcconfig @@ -0,0 +1,3 @@ +#include "../internal/nativescript-build.xcconfig" +CLANG_ENABLE_MODULES = NO; +CLANG_MODULES_AUTOLINK = NO; diff --git a/project-template-vision/__PROJECT_NAME__/en.lproj/InfoPlist.strings b/project-template-vision/__PROJECT_NAME__/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..477b28ff --- /dev/null +++ b/project-template-vision/__PROJECT_NAME__/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/project-template-vision/internal/NativeScriptStart.h b/project-template-vision/internal/NativeScriptStart.h new file mode 100644 index 00000000..d55d0693 --- /dev/null +++ b/project-template-vision/internal/NativeScriptStart.h @@ -0,0 +1,19 @@ +// +// NativeScriptStart.h +// +// Created by Team nStudio on 7/5/23. +// Copyright © 2023 NativeScript. All rights reserved. +// + +#ifndef NativeScriptStart_h +#define NativeScriptStart_h + + +#endif /* NativeScriptStart_h */ + +@interface NativeScriptStart : NSObject + ++ (void)setup; ++ (void)boot; + +@end diff --git a/project-template-vision/internal/NativeScriptStart.m b/project-template-vision/internal/NativeScriptStart.m new file mode 100644 index 00000000..563251a7 --- /dev/null +++ b/project-template-vision/internal/NativeScriptStart.m @@ -0,0 +1,73 @@ +// +// NativeScriptStart.m +// +// Created by Team nStudio on 7/5/23. +// Copyright © 2023 NativeScript. All rights reserved. +// + +#import +#import +#import + +#ifdef DEBUG +#include +#include +#include "macros.h" +#endif + +extern char startOfMetadataSection __asm("section$start$__DATA$__TNSMetadata"); +NativeScript* nativescriptStart; + +@implementation NativeScriptStart + ++(void)setup{ + @autoreleasepool { + NSString* baseDir = [[NSBundle mainBundle] resourcePath]; + + #ifdef DEBUG + int refreshRequestSubscription; + notify_register_dispatch(NOTIFICATION("RefreshRequest"), &refreshRequestSubscription, dispatch_get_main_queue(), ^(int token) { + notify_post(NOTIFICATION("AppRefreshStarted")); + bool success = [nativescriptStart liveSync]; + if (success) { + notify_post(NOTIFICATION("AppRefreshSucceeded")); + } else { + NSLog(@"__onLiveSync call failed"); + notify_post(NOTIFICATION("AppRefreshFailed")); + } + }); + + TNSInitializeLiveSync(); + if (getenv("TNSBaseDir")) { + baseDir = @(getenv("TNSBaseDir")); + } + #endif + + void* metadataPtr = &startOfMetadataSection; + + bool isDebug = + #ifdef DEBUG + true; + #else + false; + #endif + + Config* config = [[Config alloc] init]; + config.IsDebug = isDebug; + config.LogToSystemConsole = isDebug; + config.MetadataPtr = metadataPtr; + config.BaseDir = baseDir; +// config.ArgumentsCount = argc; +// config.Arguments = argv; + + nativescriptStart = [[NativeScript alloc] initWithConfig:config]; + + } + +} ++(void)boot{ + [nativescriptStart runMainApplication]; +} +@end + + diff --git a/project-template-vision/internal/README.md b/project-template-vision/internal/README.md new file mode 100644 index 00000000..cab084cb --- /dev/null +++ b/project-template-vision/internal/README.md @@ -0,0 +1,2 @@ +The contents of this folder is specific for the current version of the runtime. +It will be wiped and replaced on each platform update. diff --git a/project-template-vision/internal/Swift-ObjC-Bridging-Header.h b/project-template-vision/internal/Swift-ObjC-Bridging-Header.h new file mode 100644 index 00000000..7db14b65 --- /dev/null +++ b/project-template-vision/internal/Swift-ObjC-Bridging-Header.h @@ -0,0 +1,14 @@ +// +// Swift-ObjC-Bridging-Header.h +// __PROJECT_NAME__ +// +// Created by Teodor Dermendzhiev on 4/17/19. +// Copyright © 2019 Progress. All rights reserved. +// + +// Intentionally left blank. Needed for the generation of all Swift classes in +// the *-Swift.h*. +// https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_objective-c_into_swift + +#import "NativeScript/NativeScript.h" +#import "NativeScriptStart.h" diff --git a/project-template-vision/internal/macros.h b/project-template-vision/internal/macros.h new file mode 100644 index 00000000..03082095 --- /dev/null +++ b/project-template-vision/internal/macros.h @@ -0,0 +1,17 @@ +// +// macros.h +// sampleng +// +// Created by Team nStudio on 1/19/24. +// Copyright © 2024 NativeScript. All rights reserved. +// + +#ifndef macros_h +#define macros_h + +#define NOTIFICATION(name) \ + [[NSString stringWithFormat:@"%@:NativeScript.Debug.%s", \ + [[NSBundle mainBundle] bundleIdentifier], name] UTF8String] + + +#endif /* macros_h */ diff --git a/project-template-vision/internal/nativescript-build.xcconfig b/project-template-vision/internal/nativescript-build.xcconfig new file mode 100644 index 00000000..8a3fc311 --- /dev/null +++ b/project-template-vision/internal/nativescript-build.xcconfig @@ -0,0 +1,29 @@ +// * NativeScript build related flags +// * Add [sdk=*] after each one to avoid conflict with CocoaPods flags +OTHER_LDFLAGS[sdk=*] = $(inherited) -ObjC -sectcreate __DATA __TNSMetadata "$(CONFIGURATION_BUILD_DIR)/metadata-$(CURRENT_ARCH).bin" -framework NativeScript -framework TKLiveSync -F"$(SRCROOT)/internal" -licucore -lz -lc++ -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreServices -framework Security + +// We need to add CONFIGURATION_BUILD_DIR here so that we can explicitly quote-escape any paths in it, because the implicitly added path by Xcode is not always escaped +FRAMEWORK_SEARCH_PATHS[sdk=*] = $(inherited) "$(SRCROOT)/internal/" "$(CONFIGURATION_BUILD_DIR)" + +// Launch custom linker script in order to generate metadata binary file and link it in the executable +LD = $SRCROOT/internal/nsld.sh +LDPLUSPLUS = $SRCROOT/internal/nsld.sh + +// * Uncomment this setting to generate TypeScript declarations for the iOS SDK and all linked libraries. +// * They will be generated on each build, so you can find them after running "ns build ios" in "YOUR_APP/platforms/ios". +// NS_TYPESCRIPT_DECLARATIONS_PATH = $(SRCROOT)/typescript-declarations + +// * Uncomment this setting to generate human readable metadata for the iOS SDK and all linked libraries. +// * You can learn more about NativeScript metadata in the docs: http://docs.nativescript.org/runtimes/ios/Overview#metadata +// * It will be generated on each build, so you can find it after running "ns build ios" in "YOUR_APP/platforms/ios". +// NS_DEBUG_METADATA_PATH = $(SRCROOT)/debug-metadata + +// Xcode 12 +EXCLUDED_ARCHS_x86_64 = arm64 arm64e +EXCLUDED_ARCHS[sdk=iphonesimulator*] = i386 armv6 armv7 armv7s armv8 $(EXCLUDED_ARCHS_$(NATIVE_ARCH_64_BIT)) +EXCLUDED_ARCHS[sdk=iphoneos*] = i386 armv6 armv7 armv7s armv8 x86_64 +EXCLUDED_ARCHS[sdk=macosx*] = i386 armv6 armv7 armv7s armv8 +VALIDATE_WORKSPACE = YES + +// Default value (can be overriden by user's build.xcconfig) +TARGETED_DEVICE_FAMILY = 1,2 diff --git a/project-template-vision/internal/nativescript-post-build b/project-template-vision/internal/nativescript-post-build new file mode 100755 index 00000000..a9ed8f91 --- /dev/null +++ b/project-template-vision/internal/nativescript-post-build @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e + +pushd "$SRCROOT/internal" +./strip-dynamic-framework-architectures.sh +popd diff --git a/project-template-vision/internal/nativescript-pre-build b/project-template-vision/internal/nativescript-pre-build new file mode 100755 index 00000000..2216ef79 --- /dev/null +++ b/project-template-vision/internal/nativescript-pre-build @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Ignore errors while inserting environment variables (some could be readonly) +(echo "set +e"; echo "set +o posix"; export; echo "set -o posix"; echo "set -e";) > ./.build_env_vars.sh + +# create temporary empty metadata files for XCode LD/LDPLUSPLUS flag analysis +for arch in $VALID_ARCHS +do : + touch "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" +done diff --git a/project-template-vision/internal/nativescript-pre-link b/project-template-vision/internal/nativescript-pre-link new file mode 100755 index 00000000..26e65ac1 --- /dev/null +++ b/project-template-vision/internal/nativescript-pre-link @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -e \ No newline at end of file diff --git a/project-template-vision/internal/nsld.sh b/project-template-vision/internal/nsld.sh new file mode 100755 index 00000000..9b5dda3a --- /dev/null +++ b/project-template-vision/internal/nsld.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +source ./.build_env_vars.sh + +MODULES_DIR="$SRCROOT/internal/Swift-Modules" + +function DELETE_SWIFT_MODULES_DIR() { + rm -rf "$MODULES_DIR" +} + +function getArch() { + while [[ $# -gt 0 ]] + do + case $1 in + -arch) + printf $2 + return + ;; + -target) + printf `echo $2 | cut -f1 -d'-'` + return + ;; + esac + shift + done +} + +function GEN_MODULEMAP() { + ARCH_ARG=$1 + SWIFT_HEADER_DIR=$PER_VARIANT_OBJECT_FILE_DIR/$ARCH_ARG + + DELETE_SWIFT_MODULES_DIR + if [ -d "$SWIFT_HEADER_DIR" ]; then + HEADER_PATH=$(find "$SWIFT_HEADER_DIR" -name '*-Swift.h' 2>/dev/null) + if [ -n "$HEADER_PATH" ]; then + mkdir -p "$MODULES_DIR" + CONTENT="module nsswiftsupport { \n header \"$HEADER_PATH\" \n export * \n}" + printf "$CONTENT" > "$MODULES_DIR/module.modulemap" + else + echo "NSLD: Swift bridging header '*-Swift.h' not found under '$SWIFT_HEADER_DIR'" + fi + else + echo "NSLD: Directory for Swift headers ($SWIFT_HEADER_DIR) not found." + fi +} + +function GEN_METADATA() { + TARGET_ARCH=$1 + set -e + cpu_arch=$(uname -m) + pushd "$SRCROOT/internal/metadata-generator-${cpu_arch}/bin" + ./build-step-metadata-generator.py $TARGET_ARCH + popd +} + +# Workaround for ARCH being set to `undefined_arch` here. Extract it from command line arguments. +TARGET_ARCH=$(getArch "$@") +GEN_MODULEMAP $TARGET_ARCH +printf "Generating metadata..." +GEN_METADATA $TARGET_ARCH +DELETE_SWIFT_MODULES_DIR +NS_LD="${NS_LD:-"$TOOLCHAIN_DIR/usr/bin/clang"}" +$NS_LD "$@" diff --git a/project-template-vision/internal/strip-dynamic-framework-architectures.sh b/project-template-vision/internal/strip-dynamic-framework-architectures.sh new file mode 100755 index 00000000..1679d1a7 --- /dev/null +++ b/project-template-vision/internal/strip-dynamic-framework-architectures.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +################################################################################ +# +# Copyright 2015 Realm Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# This script strips all non-valid architectures from dynamic libraries in +# the application's `Frameworks` directory. +# +# The following environment variables are required: +# +# BUILT_PRODUCTS_DIR +# FRAMEWORKS_FOLDER_PATH +# VALID_ARCHS +# EXPANDED_CODE_SIGN_IDENTITY + + +# Signs a framework with the provided identity +code_sign() { + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" +} + +if [ ! -e "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}" ]; then + exit 0 +fi + +echo "Stripping frameworks" +cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +for file in $(find . -type f); do + # Skip non-dynamic libraries + if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then + continue + fi + # Get architectures for current file + archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$file" "$file" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" != "" ]]; then + echo "Stripped $file of architectures:$stripped" + if [ "${CODE_SIGNING_ALLOWED}" == "YES" ]; then + code_sign "${file}" + fi + fi +done diff --git a/project-template/internal/main.m b/project-template/internal/main.m deleted file mode 100644 index 03767c84..00000000 --- a/project-template/internal/main.m +++ /dev/null @@ -1,64 +0,0 @@ -// -// Any changes in this file will be removed after you update your platform! -// -#import -#import - -#ifdef DEBUG -#include -#include - -#define NOTIFICATION(name) \ - [[NSString stringWithFormat:@"%@:NativeScript.Debug.%s", \ - [[NSBundle mainBundle] bundleIdentifier], name] UTF8String] -#endif - -extern char startOfMetadataSection __asm("section$start$__DATA$__TNSMetadata"); -NativeScript* nativescript; - -int main(int argc, char *argv[]) { - @autoreleasepool { - NSString* baseDir = [[NSBundle mainBundle] resourcePath]; - -#ifdef DEBUG - int refreshRequestSubscription; - notify_register_dispatch(NOTIFICATION("RefreshRequest"), &refreshRequestSubscription, dispatch_get_main_queue(), ^(int token) { - notify_post(NOTIFICATION("AppRefreshStarted")); - bool success = [nativescript liveSync]; - if (success) { - notify_post(NOTIFICATION("AppRefreshSucceeded")); - } else { - NSLog(@"__onLiveSync call failed"); - notify_post(NOTIFICATION("AppRefreshFailed")); - } - }); - - TNSInitializeLiveSync(); - if (getenv("TNSBaseDir")) { - baseDir = @(getenv("TNSBaseDir")); - } -#endif - - void* metadataPtr = &startOfMetadataSection; - - bool isDebug = -#ifdef DEBUG - true; -#else - false; -#endif - - Config* config = [[Config alloc] init]; - config.IsDebug = isDebug; - config.LogToSystemConsole = isDebug; - config.MetadataPtr = metadataPtr; - config.BaseDir = baseDir; - config.ArgumentsCount = argc; - config.Arguments = argv; - - nativescript = [[NativeScript alloc] initWithConfig:config]; - [nativescript runMainApplication]; - - return 0; - } -} diff --git a/v8ios.xcodeproj/project.pbxproj b/v8ios.xcodeproj/project.pbxproj index bb2da20b..b9cc72ba 100644 --- a/v8ios.xcodeproj/project.pbxproj +++ b/v8ios.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 55; objects = { /* Begin PBXBuildFile section */ @@ -52,8 +52,8 @@ C22536B6241A318900192740 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = C22536B1241A318900192740 /* ffi.h */; }; C22536B7241A318900192740 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = C22536B3241A318900192740 /* ffitarget.h */; }; C22536B8241A318900192740 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = C22536B4241A318900192740 /* ffi.h */; }; - C2253789241A41C500192740 /* TKLiveSync.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2253782241A41C500192740 /* TKLiveSync.framework */; }; - C225378A241A41C500192740 /* TKLiveSync.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C2253782241A41C500192740 /* TKLiveSync.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C2253789241A41C500192740 /* TKLiveSync.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2253782241A41C500192740 /* TKLiveSync.framework */; platformFilters = (ios, xros, ); }; + C225378A241A41C500192740 /* TKLiveSync.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C2253782241A41C500192740 /* TKLiveSync.framework */; platformFilters = (ios, xros, ); settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; C2253790241A421E00192740 /* zip_fopen_index_encrypted.c in Sources */ = {isa = PBXBuildFile; fileRef = C2A5E05A2328CA6F00A91A76 /* zip_fopen_index_encrypted.c */; }; C2253791241A422400192740 /* zip_get_num_entries.c in Sources */ = {isa = PBXBuildFile; fileRef = C2A5E0422328CA6F00A91A76 /* zip_get_num_entries.c */; }; C2253805241A5C3200192740 /* zip_get_encryption_implementation.c in Sources */ = {isa = PBXBuildFile; fileRef = C2A5E0302328CA6F00A91A76 /* zip_get_encryption_implementation.c */; }; @@ -256,8 +256,8 @@ C2A6EF3123745A0B00E8FBE7 /* MetadataInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2A6EF3023745A0B00E8FBE7 /* MetadataInlines.h */; }; C2C8EE7222CE323C001F8CEC /* ConcurrentMap.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8EE7022CE323C001F8CEC /* ConcurrentMap.h */; }; C2C8EE7422CE3266001F8CEC /* ConcurrentQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C8EE7322CE3266001F8CEC /* ConcurrentQueue.cpp */; }; - C2C8EE7522CE54EE001F8CEC /* NativeScript.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DDEB32229EAB3B00345BFE /* NativeScript.framework */; }; - C2C8EE7622CE54EE001F8CEC /* NativeScript.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C2DDEB32229EAB3B00345BFE /* NativeScript.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C2C8EE7522CE54EE001F8CEC /* NativeScript.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DDEB32229EAB3B00345BFE /* NativeScript.framework */; platformFilters = (ios, xros, ); }; + C2C8EE7622CE54EE001F8CEC /* NativeScript.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C2DDEB32229EAB3B00345BFE /* NativeScript.framework */; platformFilters = (ios, xros, ); settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; C2C8EE7A22CF64E4001F8CEC /* SimpleAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C8EE7822CF64E4001F8CEC /* SimpleAllocator.cpp */; }; C2C8EE7B22CF64E4001F8CEC /* SimpleAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8EE7922CF64E4001F8CEC /* SimpleAllocator.h */; }; C2CC8EEA22BBA01E00B78928 /* FastEnumerationAdapter.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2CC8EE822BBA01E00B78928 /* FastEnumerationAdapter.mm */; }; @@ -2190,11 +2190,19 @@ /* Begin PBXTargetDependency section */ C2253788241A41C500192740 /* PBXTargetDependency */ = { isa = PBXTargetDependency; + platformFilters = ( + ios, + xros, + ); target = C2253781241A41C500192740 /* TKLiveSync */; targetProxy = C2253787241A41C500192740 /* PBXContainerItemProxy */; }; C22C091F22CA2E860080D176 /* PBXTargetDependency */ = { isa = PBXTargetDependency; + platformFilters = ( + ios, + xros, + ); target = C2DDEB31229EAB3B00345BFE /* NativeScript */; targetProxy = C22C091E22CA2E860080D176 /* PBXContainerItemProxy */; }; @@ -2216,12 +2224,12 @@ }; C293752B229FC4740075CB16 /* PBXTargetDependency */ = { isa = PBXTargetDependency; + platformFilter = ios; target = C29374E1229FC0F60075CB16 /* TestFixtures */; targetProxy = C293752A229FC4740075CB16 /* PBXContainerItemProxy */; }; C2F4CBBC22C61CF20036B56F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - platformFilter = ios; target = C2F4CBB222C60BFD0036B56F /* metadata-generator */; targetProxy = C2F4CBBB22C61CF20036B56F /* PBXContainerItemProxy */; }; @@ -2257,8 +2265,13 @@ ); PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TKLiveSync; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = ""; SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; + SUPPORTS_MACCATALYST = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + TARGETED_DEVICE_FAMILY = "1,2,7"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -2290,8 +2303,13 @@ ); PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TKLiveSync; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = ""; SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; + SUPPORTS_MACCATALYST = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + TARGETED_DEVICE_FAMILY = "1,2,7"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -2584,6 +2602,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = CS838V553Y; + EXCLUDED_ARCHS = ""; EXPORTED_SYMBOLS_FILE = "$(PROJECT_DIR)/TestFixtures/exported-symbols.txt"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -2618,8 +2637,13 @@ PRODUCT_BUNDLE_IDENTIFIER = vm.org.nativescript.TestRunner; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = iphoneos; STRIPFLAGS = "-s $(PROJECT_DIR)/TestFixtures/exported-symbols.txt"; - TARGETED_DEVICE_FAMILY = 1; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + TARGETED_DEVICE_FAMILY = "1,7"; USER_HEADER_SEARCH_PATHS = ""; }; name = Debug; @@ -2633,6 +2657,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8V7T28DG39; + EXCLUDED_ARCHS = ""; EXPORTED_SYMBOLS_FILE = "$(PROJECT_DIR)/TestFixtures/exported-symbols.txt"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -2667,8 +2692,13 @@ PRODUCT_BUNDLE_IDENTIFIER = vm.org.nativescript.TestRunner; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = iphoneos; STRIPFLAGS = "-s $(PROJECT_DIR)/TestFixtures/exported-symbols.txt"; - TARGETED_DEVICE_FAMILY = 1; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + TARGETED_DEVICE_FAMILY = "1,7"; USER_HEADER_SEARCH_PATHS = ""; }; name = Release; @@ -2687,9 +2717,12 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; EXCLUDED_ARCHS = ""; + "EXCLUDED_ARCHS[sdk=xros*]" = x86_64; + "EXCLUDED_ARCHS[sdk=xrsimulator*]" = x86_64; GCC_C_LANGUAGE_STANDARD = c11; GCC_PREFIX_HEADER = "NativeScript/NativeScript-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = NativeScript/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -2711,6 +2744,7 @@ "-fembed-bitcode", ); OTHER_LDFLAGS = ( + "-ld_classic", "-Wl,-dead_strip", "-Wl,-search_paths_first", "-fno-builtin-stpcpy", @@ -2740,8 +2774,13 @@ ); PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.NativeScript; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = ""; SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; + SUPPORTS_MACCATALYST = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + TARGETED_DEVICE_FAMILY = "1,2,7"; USER_HEADER_SEARCH_PATHS = ( "$(SRCROOT)/NativeScript", "$(SRCROOT)/NativeScript/include", @@ -2768,8 +2807,11 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; EXCLUDED_ARCHS = ""; + "EXCLUDED_ARCHS[sdk=xros*]" = x86_64; + "EXCLUDED_ARCHS[sdk=xrsimulator*]" = x86_64; GCC_C_LANGUAGE_STANDARD = c11; GCC_PREFIX_HEADER = "NativeScript/NativeScript-Prefix.pch"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = NativeScript/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -2790,6 +2832,7 @@ "-fembed-bitcode", ); OTHER_LDFLAGS = ( + "-ld_classic", "-Wl,-dead_strip", "-Wl,-search_paths_first", "-fno-builtin-stpcpy", @@ -2819,8 +2862,13 @@ ); PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.NativeScript; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = ""; SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; + SUPPORTS_MACCATALYST = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + TARGETED_DEVICE_FAMILY = "1,2,7"; USER_HEADER_SEARCH_PATHS = ( "$(SRCROOT)/NativeScript", "$(SRCROOT)/NativeScript/include",