@nativescript/ios 9.0.0-alpha.4 → 9.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -59,21 +59,57 @@ printf "Generating metadata..."
59
59
  GEN_METADATA $TARGET_ARCH
60
60
  DELETE_SWIFT_MODULES_DIR
61
61
 
62
- # Resolve linker: prefer provided NS_LD, otherwise use toolchain clang if present.
63
- DEFAULT_LD="$TOOLCHAIN_DIR/usr/bin/clang"
64
- if [[ -z "$NS_LD" ]]; then
65
- if [[ -x "$DEFAULT_LD" ]]; then
66
- NS_LD="$DEFAULT_LD"
67
- else
68
- echo "NSLD: Skipping link because toolchain clang not found: $DEFAULT_LD (TOOLCHAIN_DIR may be missing)."
69
- exit 0
62
+ # Resolve linker robustly and avoid executing an empty command.
63
+ function resolve_clang() {
64
+ # 1) If NS_LD is set and executable, honor it.
65
+ if [[ -n "$NS_LD" && -x "$NS_LD" ]]; then
66
+ echo "$NS_LD"
67
+ return 0
70
68
  fi
71
- fi
72
69
 
73
- # If NS_LD was explicitly set to the default path but it's missing, skip as well.
74
- if [[ "$NS_LD" == "$DEFAULT_LD" && ! -x "$NS_LD" ]]; then
75
- echo "NSLD: Skipping link because toolchain clang not found: $NS_LD (TOOLCHAIN_DIR may be missing)."
76
- exit 0
70
+ # 2) TOOLCHAIN_DIR (if provided)
71
+ if [[ -n "$TOOLCHAIN_DIR" && -x "$TOOLCHAIN_DIR/usr/bin/clang" ]]; then
72
+ echo "$TOOLCHAIN_DIR/usr/bin/clang"
73
+ return 0
74
+ fi
75
+
76
+ # 3) Xcode's DT_TOOLCHAIN_DIR (provided by xcodebuild)
77
+ if [[ -n "$DT_TOOLCHAIN_DIR" && -x "$DT_TOOLCHAIN_DIR/usr/bin/clang" ]]; then
78
+ echo "$DT_TOOLCHAIN_DIR/usr/bin/clang"
79
+ return 0
80
+ fi
81
+
82
+ # 4) xcrun lookup (most reliable within Xcode build env)
83
+ local xcrun_clang
84
+ xcrun_clang=$(xcrun --find clang 2>/dev/null) || true
85
+ if [[ -n "$xcrun_clang" && -x "$xcrun_clang" ]]; then
86
+ echo "$xcrun_clang"
87
+ return 0
88
+ fi
89
+
90
+ # 5) Xcode default toolchain from xcode-select
91
+ local xcode_path
92
+ xcode_path=$(xcode-select -p 2>/dev/null) || true
93
+ if [[ -n "$xcode_path" && -x "$xcode_path/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" ]]; then
94
+ echo "$xcode_path/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
95
+ return 0
96
+ fi
97
+
98
+ # 6) System fallback
99
+ if [[ -x "/usr/bin/clang" ]]; then
100
+ echo "/usr/bin/clang"
101
+ return 0
102
+ fi
103
+
104
+ return 1
105
+ }
106
+
107
+ CLANG_PATH=$(resolve_clang)
108
+ if [[ -z "$CLANG_PATH" ]]; then
109
+ echo "NSLD: ERROR: Could not locate a usable clang. TOOLCHAIN_DIR='${TOOLCHAIN_DIR}' DT_TOOLCHAIN_DIR='${DT_TOOLCHAIN_DIR}'."
110
+ exit 1
77
111
  fi
78
112
 
79
- "$NS_LD" "$@"
113
+ # For visibility downstream, set NS_LD to the resolved path and invoke.
114
+ NS_LD="$CLANG_PATH"
115
+ "$NS_LD" "$@"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nativescript/ios",
3
3
  "description": "NativeScript Runtime for iOS",
4
- "version": "9.0.0-alpha.4",
4
+ "version": "9.0.0-alpha.5",
5
5
  "keywords": [
6
6
  "NativeScript",
7
7
  "iOS",