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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 25 additions & 17 deletions .github/workflows/npm_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ permissions:
# (github.com/NativeScript/ios-spm) at them via binaryTarget(url:checksum:). The
# slim npm package only carries the Xcode project template + metadata generator.
#
# Flow: setup → build (ios, visionos) → test → github-release (assets) →
# Flow: setup → build (ios, visionos, tvos) → test → github-release (assets) →
# spm-update (generate manifest + tag ios-spm) → publish (npm) → verify-spm
#
# The release half (github-release, spm-update, publish, verify-spm) is gated on
Expand Down Expand Up @@ -74,10 +74,13 @@ jobs:
needs: setup
strategy:
fail-fast: false
# Computed in `setup`: ios always; visionos only for real releases
# (npm_tag != "next"), never for the rolling "next" channel. Each entry
# carries `target` (package identity, @nativescript/<target>) and `script`
# (the npm build script; note the vision script is build-vision).
# Computed in `setup`: ios always; visionos and tvos only for real
# releases (npm_tag != "next"), never for the rolling "next" channel. Each
# entry carries `target` (package identity, @nativescript/<target>) and
# `script` (the npm build script; note the vision script is build-vision).
# The tvos leg installs the pinned V8 release's tvOS slices
# (download_v8.sh --tvos), so V8_RELEASE must point at a
# v8-buildscripts release that ships them.
matrix: ${{ fromJSON(needs.setup.outputs.build_matrix) }}
env:
NPM_VERSION: ${{ needs.setup.outputs.npm_version }}
Expand Down Expand Up @@ -323,9 +326,9 @@ jobs:
- name: Generate Package.swift
# The generator emits the WHOLE manifest, shaped by the checksums it
# finds: "next" builds produce only checksums-ios.env, so the next
# manifest omits the visionOS product/targets whose Release assets
# don't exist (SwiftPM eagerly downloads every binaryTarget in a
# resolved manifest — an unshipped asset 404s for every consumer).
# manifest omits the visionOS and tvOS products/targets whose Release
# assets don't exist (SwiftPM eagerly downloads every binaryTarget in
# a resolved manifest — an unshipped asset 404s for every consumer).
# Any non-"next" --channel requires the full checksum set, so a real
# release can never silently ship an iOS-only manifest.
run: |
Expand Down Expand Up @@ -367,9 +370,9 @@ jobs:
id-token: write
strategy:
fail-fast: false
# Same targets as the build matrix (computed in `setup`): visionos is
# published only for real releases, never for the "next" channel. The
# unused `script` key on each entry is harmless here.
# Same targets as the build matrix (computed in `setup`): visionos and
# tvos are published only for real releases, never for the "next"
# channel. The unused `script` key on each entry is harmless here.
matrix: ${{ fromJSON(needs.setup.outputs.build_matrix) }}
env:
NPM_VERSION: ${{ needs.setup.outputs.npm_version }}
Expand All @@ -395,8 +398,11 @@ jobs:
test "$(npm --version)" = "11.5.1"
test "$(npx --version)" = "11.5.1"
- name: Resolve package name
run: |
if [ "${{ matrix.target }}" = "ios" ]; then echo "PKG=ios" >> $GITHUB_ENV; else echo "PKG=visionos" >> $GITHUB_ENV; fi
# matrix.target is the package suffix: @nativescript/<target>
env:
# env indirection keeps matrix values out of shell interpolation
TARGET: ${{ matrix.target }}
run: echo "PKG=$TARGET" >> $GITHUB_ENV
- name: Publish package (OIDC trusted publishing)
if: ${{ vars.USE_NPM_TOKEN != 'true' }}
run: |
Expand All @@ -422,9 +428,10 @@ jobs:
# One probe for every channel, against the REAL released manifest. The
# manifest's target set is channel-shaped by generate-spm-manifest.mjs
# ("next" manifests only declare the iOS targets, because next Releases have
# no visionos assets), so resolving ios-spm at the released tag exercises
# exactly the artifact set a consumer's xcodebuild will download: iOS-only on
# next, iOS + visionos on real releases (v* tag / manual version).
# no visionos/tvos assets), so resolving ios-spm at the released tag
# exercises exactly the artifact set a consumer's xcodebuild will download:
# iOS-only on next, iOS + visionos + tvos on real releases (v* tag / manual
# version).
verify-spm:
name: Verify SPM resolution
runs-on: macos-15
Expand Down Expand Up @@ -466,6 +473,7 @@ jobs:
# Resolution fetches each binaryTarget's zip and verifies its SHA-256
# against the manifest checksum; a mismatch or a missing release asset
# fails the release here. For next the manifest declares the iOS
# artifacts only; real releases also declare (and verify) visionos.
# artifacts only; real releases also declare (and verify) visionos
# and tvos.
swift package resolve
echo "ios-spm@$NPM_VERSION resolved and checksum-verified."
7 changes: 7 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
path: ./llvm
key: ${{ hashFiles('download_llvm.sh') }}
- uses: ./.github/actions/setup-build-env
- name: Template and SwiftPM manifest checks
# tvOS is not built on PRs (like visionOS), but its template must stay
# the iOS template plus the tvOS settings, and the ios-spm manifest
# generator must still accept every platform's checksums.
run: |
python3 tests/tvos/template.py
python3 tests/spm/manifest.py
- name: Get Current Version
run: |
echo NPM_VERSION=$(node -e "console.log(require('./package.json').version);") >> $GITHUB_ENV
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ v8_build
/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
/project-template-tvos/.build_env_vars.sh
/project-template-tvos/__PROJECT_NAME__.xcodeproj/project.xcworkspace/

# V8 prebuilts, fetched by download_v8.sh from the release
# pinned in V8_RELEASE. Not committed: the full matrix cannot be built
Expand Down Expand Up @@ -93,3 +95,4 @@ NativeScript/inspector/absl/
#AI agents
.claude/*
!.claude/settings.json
NativeScript/lib/.tvos-v8-version
Binary file added NativeScript/lib/arm64-appletvos/libffi.a
Binary file not shown.
Binary file added NativeScript/lib/arm64-appletvsimulator/libffi.a
Binary file not shown.
3 changes: 3 additions & 0 deletions NativeScript/runtime/NativeScriptException.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1469,8 +1469,11 @@ static void ShowErrorModalSynchronously(const std::string& title, const std::str
alpha:1.0]; // Terminal green
stackTraceTextView.backgroundColor = [UIColor clearColor];
stackTraceTextView.font = [UIFont fontWithName:@"Menlo" size:16]; // Monospace
#if !TARGET_OS_TV
// tvOS UITextView is never editable/selectable; the properties do not exist there.
stackTraceTextView.editable = NO;
stackTraceTextView.selectable = YES;
#endif
stackTraceTextView.scrollEnabled = YES;
stackTraceTextView.contentInset = UIEdgeInsetsMake(15, 15, 15, 15);
stackTraceTextView.translatesAutoresizingMaskIntoConstraints = NO;
Expand Down
2 changes: 1 addition & 1 deletion V8_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8-14.9.207.39-7
v8-14.9.207.39-8
34 changes: 34 additions & 0 deletions build_all_tvos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -e

# Arguments (e.g. --spm-mode <embedded|remote>) are forwarded to
# build_npm_tvos.sh; run it with --help for details.
for arg in "$@"; do
if [ "$arg" = "-h" ] || [ "$arg" = "--help" ]; then
echo "Usage: ./build_all_tvos.sh [--spm-mode <embedded|remote>]"
echo "Arguments are forwarded to build_npm_tvos.sh (see ./build_npm_tvos.sh --help)."
echo ""
echo "V8: the pinned release's tvOS slices are installed with download_v8.sh --tvos."
echo "Set V8_TVOS_BUILD to a built NativeScript/v8-buildscripts checkout to use a"
echo "source build instead (see scripts/install-tvos-v8.sh)."
exit 0
fi
done

if [ -n "${V8_TVOS_BUILD:-}" ]; then
./scripts/install-tvos-v8.sh "$V8_TVOS_BUILD"
# The source build supplied the archives, headers and inspector sources;
# the pinned release must not overwrite them from here on.
export V8_SKIP_DOWNLOAD=1
else
./download_v8.sh --tvos
fi

rm -rf ./dist
./update_version.sh
./build_metadata_generator.sh
./build_nativescript.sh --no-catalyst --no-iphone --no-sim --no-vision --tvos
./build_tklivesync.sh --no-catalyst --no-iphone --no-sim --no-vision --tvos
./prepare_dSYMs.sh
./build_spm_artifacts.sh tvos
./build_npm_tvos.sh "$@"
9 changes: 9 additions & 0 deletions build_libffi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ BUILD_ROOT="$SCRIPT_DIR/build/libffi"
DIST_DIR="$BUILD_ROOT/dist"

ALL_SLICES=(
arm64-appletvos
arm64-appletvsimulator
arm64-iphoneos
arm64-iphonesimulator
arm64-xros
Expand All @@ -29,6 +31,7 @@ ALL_SLICES=(
x86_64-maccatalyst
)

TVOS_MIN=13.0
IOS_MIN=13.0
XROS_MIN=2.0
CATALYST_MIN=13.3
Expand Down Expand Up @@ -98,6 +101,12 @@ slice_config() {
arm64-iphonesimulator)
echo "iphonesimulator|aarch64-apple-darwin|-arch arm64 -mios-simulator-version-min=$IOS_MIN"
;;
arm64-appletvos)
echo "appletvos|aarch64-apple-darwin|-target arm64-apple-tvos$TVOS_MIN"
;;
arm64-appletvsimulator)
echo "appletvsimulator|aarch64-apple-darwin|-target arm64-apple-tvos$TVOS_MIN-simulator"
;;
arm64-xros)
echo "xros|aarch64-apple-darwin|-target arm64-apple-xros$XROS_MIN"
;;
Expand Down
53 changes: 46 additions & 7 deletions build_nativescript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ 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})
BUILD_TVOS=$(to_bool ${BUILD_TVOS:=false})
VERBOSE=$(to_bool ${VERBOSE:=false})

for arg in $@; do
Expand All @@ -43,6 +44,8 @@ for arg in $@; do
--no-iphone|--no-device) BUILD_IPHONE=false ;;
--xr|--vision) BUILD_VISION=true ;;
--no-xr|--no-vision) BUILD_VISION=false ;;
--tv|--tvos) BUILD_TVOS=true ;;
--no-tv|--no-tvos) BUILD_TVOS=false ;;
--verbose|-v) VERBOSE=true ;;
*) ;;
esac
Expand All @@ -60,14 +63,14 @@ mkdir -p $DIST
mkdir -p $DIST/intermediates

checkpoint "Cleanup NativeScript"
xcodebuild -project v8ios.xcodeproj \
xcodebuild SYMROOT="$DIST/build" -project v8ios.xcodeproj \
-target "NativeScript" \
-configuration Release clean \
$QUIET

if $BUILD_CATALYST; then
checkpoint "Building NativeScript for Mac Catalyst"
xcodebuild archive -project v8ios.xcodeproj \
xcodebuild archive -derivedDataPath "$DIST/DerivedData" -project v8ios.xcodeproj \
-scheme "NativeScript" \
-configuration Release \
-destination "platform=macOS,variant=Mac Catalyst" \
Expand All @@ -81,7 +84,7 @@ fi

if $BUILD_SIMULATOR; then
checkpoint "Building NativeScript for iphone simulators (multi-arch)"
xcodebuild archive -project v8ios.xcodeproj \
xcodebuild archive -derivedDataPath "$DIST/DerivedData" -project v8ios.xcodeproj \
-scheme "NativeScript" \
-configuration Release \
-destination "generic/platform=iOS Simulator" \
Expand All @@ -96,7 +99,7 @@ fi

if $BUILD_IPHONE; then
checkpoint "Building NativeScript for ARM64 device"
xcodebuild archive -project v8ios.xcodeproj \
xcodebuild archive -derivedDataPath "$DIST/DerivedData" -project v8ios.xcodeproj \
-scheme "NativeScript" \
-configuration Release \
-destination "generic/platform=iOS" \
Expand All @@ -111,7 +114,7 @@ fi

if $BUILD_CATALYST; then
checkpoint "Building NativeScript for Mac Catalyst"
xcodebuild archive -project v8ios.xcodeproj \
xcodebuild archive -derivedDataPath "$DIST/DerivedData" -project v8ios.xcodeproj \
-scheme "NativeScript" \
-configuration Release \
-destination "generic/platform=macOS,variant=Mac Catalyst" \
Expand All @@ -125,7 +128,7 @@ fi
if $BUILD_VISION; then

checkpoint "Building NativeScript for visionOS Device"
xcodebuild archive -project v8ios.xcodeproj \
xcodebuild archive -derivedDataPath "$DIST/DerivedData" -project v8ios.xcodeproj \
-scheme "NativeScript" \
-configuration Release \
-destination "generic/platform=visionOS" \
Expand All @@ -138,7 +141,7 @@ xcodebuild archive -project v8ios.xcodeproj \
-archivePath $DIST/intermediates/NativeScript.xros.xcarchive

checkpoint "Building NativeScript for visionOS Simulators"
xcodebuild archive -project v8ios.xcodeproj \
xcodebuild archive -derivedDataPath "$DIST/DerivedData" -project v8ios.xcodeproj \
-scheme "NativeScript" \
-configuration Release \
-destination "generic/platform=visionOS Simulator" \
Expand All @@ -151,6 +154,35 @@ xcodebuild archive -project v8ios.xcodeproj \
-archivePath $DIST/intermediates/NativeScript.xrsimulator.xcarchive
fi

if $BUILD_TVOS; then

checkpoint "Building NativeScript for tvOS Device"
xcodebuild archive -derivedDataPath "$DIST/DerivedData" -project v8ios.xcodeproj \
-scheme "NativeScript" \
-configuration Release \
-destination "generic/platform=tvOS" \
$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.appletvos.xcarchive

checkpoint "Building NativeScript for tvOS Simulators"
xcodebuild archive -derivedDataPath "$DIST/DerivedData" -project v8ios.xcodeproj \
-scheme "NativeScript" \
-configuration Release \
-destination "generic/platform=tvOS 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.appletvsimulator.xcarchive
fi

XCFRAMEWORKS=()
if $BUILD_CATALYST; then
XCFRAMEWORKS+=( -framework "$DIST/intermediates/NativeScript.maccatalyst.xcarchive/Products/Library/Frameworks/NativeScript.framework" \
Expand All @@ -174,6 +206,13 @@ if $BUILD_VISION; then
-debug-symbols "$DIST/intermediates/NativeScript.xrsimulator.xcarchive/dSYMs/NativeScript.framework.dSYM" )
fi

if $BUILD_TVOS; then
XCFRAMEWORKS+=( -framework "$DIST/intermediates/NativeScript.appletvos.xcarchive/Products/Library/Frameworks/NativeScript.framework" \
-debug-symbols "$DIST/intermediates/NativeScript.appletvos.xcarchive/dSYMs/NativeScript.framework.dSYM" )
XCFRAMEWORKS+=( -framework "$DIST/intermediates/NativeScript.appletvsimulator.xcarchive/Products/Library/Frameworks/NativeScript.framework" \
-debug-symbols "$DIST/intermediates/NativeScript.appletvsimulator.xcarchive/dSYMs/NativeScript.framework.dSYM" )
fi

checkpoint "Creating NativeScript.xcframework"
OUTPUT_DIR="$DIST/NativeScript.xcframework"
rm -rf $OUTPUT_DIR
Expand Down
Loading