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

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,56 @@ 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
+ function resolve_clang() {
63
+ # 1) If NS_LD is set and executable, honor it.
64
+ if [[ -n "$NS_LD" && -x "$NS_LD" ]]; then
65
+ echo "$NS_LD"
66
+ return 0
70
67
  fi
71
- fi
72
68
 
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
69
+ # 2) TOOLCHAIN_DIR (if provided)
70
+ if [[ -n "$TOOLCHAIN_DIR" && -x "$TOOLCHAIN_DIR/usr/bin/clang" ]]; then
71
+ echo "$TOOLCHAIN_DIR/usr/bin/clang"
72
+ return 0
73
+ fi
74
+
75
+ # 3) Xcode's DT_TOOLCHAIN_DIR (provided by xcodebuild)
76
+ if [[ -n "$DT_TOOLCHAIN_DIR" && -x "$DT_TOOLCHAIN_DIR/usr/bin/clang" ]]; then
77
+ echo "$DT_TOOLCHAIN_DIR/usr/bin/clang"
78
+ return 0
79
+ fi
80
+
81
+ # 4) xcrun lookup (most reliable within Xcode build env)
82
+ local xcrun_clang
83
+ xcrun_clang=$(xcrun --find clang 2>/dev/null) || true
84
+ if [[ -n "$xcrun_clang" && -x "$xcrun_clang" ]]; then
85
+ echo "$xcrun_clang"
86
+ return 0
87
+ fi
88
+
89
+ # 5) Xcode default toolchain from xcode-select
90
+ local xcode_path
91
+ xcode_path=$(xcode-select -p 2>/dev/null) || true
92
+ if [[ -n "$xcode_path" && -x "$xcode_path/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" ]]; then
93
+ echo "$xcode_path/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
94
+ return 0
95
+ fi
96
+
97
+ # 6) System fallback
98
+ if [[ -x "/usr/bin/clang" ]]; then
99
+ echo "/usr/bin/clang"
100
+ return 0
101
+ fi
102
+
103
+ return 1
104
+ }
105
+
106
+ CLANG_PATH=$(resolve_clang)
107
+ if [[ -z "$CLANG_PATH" ]]; then
108
+ echo "NSLD: ERROR: Could not locate a usable clang. TOOLCHAIN_DIR='${TOOLCHAIN_DIR}' DT_TOOLCHAIN_DIR='${DT_TOOLCHAIN_DIR}'."
109
+ exit 1
77
110
  fi
78
111
 
112
+ # For visibility downstream, set NS_LD to the resolved path and invoke.
113
+ NS_LD="$CLANG_PATH"
79
114
  "$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.6",
5
5
  "keywords": [
6
6
  "NativeScript",
7
7
  "iOS",