Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit 8faeea2

Browse files
committed
fix: xcode-12.3 build
1 parent f85a25b commit 8faeea2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+709
-143
lines changed

native-src/build-ios.sh

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,61 @@ set -e
55
# Based on https://appspector.com/blog/xcframeworks
66

77
ROOT_DIR="$(git rev-parse --show-toplevel)"
8-
NOTA_WEBVIEW_DIR="${ROOT_DIR}/native-src/ios/NotaWebViewExt"
9-
TARGET="${ROOT_DIR}/src/platforms/ios/NotaWebViewExt.xcframework"
108

11-
cd $NOTA_WEBVIEW_DIR
9+
PROJECT_NAME="NotaWebViewExt"
1210

13-
rm -rf $TARGET
11+
# set framework folder name
12+
FRAMEWORK_FOLDER_NAME="${PROJECT_NAME}"
1413

15-
# Archive for iOS
16-
xcodebuild archive -scheme NotaWebViewExt -destination="iOS" -archivePath /tmp/xcf/ios.xcarchive -derivedDataPath /tmp/iphoneos -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
14+
IOS_PROJECT_DIR="${ROOT_DIR}/native-src/ios/${FRAMEWORK_FOLDER_NAME}"
1715

18-
# Archive for simulator
19-
xcodebuild archive -scheme NotaWebViewExt -destination="iOS Simulator" -archivePath /tmp/xcf/iossimulator.xcarchive -derivedDataPath /tmp/iphoneos -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
16+
cd ${IOS_PROJECT_DIR}
2017

21-
# Build xcframework with two archives
22-
xcodebuild -create-xcframework -framework /tmp/xcf/ios.xcarchive/Products/Library/Frameworks/NotaWebViewExt.framework -framework /tmp/xcf/iossimulator.xcarchive/Products/Library/Frameworks/NotaWebViewExt.framework -output $TARGET
18+
# set framework name or read it from project by this variable
19+
FRAMEWORK_NAME="${PROJECT_NAME}"
20+
21+
# xcframework path
22+
FRAMEWORK_PATH="${ROOT_DIR}/src/platforms/ios/${FRAMEWORK_NAME}.xcframework"
23+
24+
TMP_DIR="/tmp/xcf"
25+
26+
# set path for iOS simulator archive
27+
SIMULATOR_ARCHIVE_PATH="${TMP_DIR}/${FRAMEWORK_FOLDER_NAME}/simulator.xcarchive"
28+
29+
# set path for iOS device archive
30+
IOS_DEVICE_ARCHIVE_PATH="${TMP_DIR}/${FRAMEWORK_FOLDER_NAME}/iOS.xcarchive"
31+
32+
ARCHIVE_SUBPATH="Products/Library/Frameworks/${FRAMEWORK_NAME}.framework"
33+
34+
rm -rf "${TMP_DIR}" "${FRAMEWORK_PATH}"
35+
36+
echo "Deleted ${TMP_DIR}"
37+
38+
echo "Archiving ${FRAMEWORK_NAME}"
39+
40+
xcodebuild archive \
41+
-scheme "${FRAMEWORK_NAME}" \
42+
-destination="generic/platform=iOS Simulator" \
43+
-archivePath "${SIMULATOR_ARCHIVE_PATH}" \
44+
-sdk iphonesimulator \
45+
SKIP_INSTALL=NO \
46+
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
47+
48+
xcodebuild archive \
49+
-scheme "${FRAMEWORK_FOLDER_NAME}" \
50+
-destination="generic/platform=iOS" \
51+
-archivePath "${IOS_DEVICE_ARCHIVE_PATH}" \
52+
-sdk iphoneos \
53+
SKIP_INSTALL=NO \
54+
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
55+
56+
# Creating XCFramework
57+
xcodebuild -create-xcframework \
58+
-framework "${SIMULATOR_ARCHIVE_PATH}/${ARCHIVE_SUBPATH}" \
59+
-framework "${IOS_DEVICE_ARCHIVE_PATH}/${ARCHIVE_SUBPATH}" \
60+
-output "${FRAMEWORK_PATH}"
61+
62+
rm -rf "${SIMULATOR_ARCHIVE_PATH}" "${IOS_DEVICE_ARCHIVE_PATH}"
2363

2464
## Workaround for https://github.com/Notalib/nativescript-webview-ext/issues/71
25-
rm -rf ${TARGET}/ios-armv7_arm64/NotaWebViewExt.framework/Frameworks
65+
rm -rf ${FRAMEWORK_PATH}/ios-*/NotaWebViewExt.framework/Frameworks

native-src/ios/NotaWebViewExt/NotaWebViewExt.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
291291
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
292292
SWIFT_VERSION = 5.0;
293-
VALID_ARCHS = "arm64 arm64e armv7 armv7s i386";
293+
VALID_ARCHS = "arm64 arm64e armv7 armv7s i386 x86_64";
294294
VERSIONING_SYSTEM = "apple-generic";
295295
VERSION_INFO_PREFIX = "";
296296
};
@@ -354,7 +354,7 @@
354354
SWIFT_COMPILATION_MODE = wholemodule;
355355
SWIFT_OPTIMIZATION_LEVEL = "-O";
356356
SWIFT_VERSION = 5.0;
357-
VALID_ARCHS = "arm64 arm64e armv7 armv7s i386";
357+
VALID_ARCHS = "arm64 arm64e armv7 armv7s i386 x86_64";
358358
VERSIONING_SYSTEM = "apple-generic";
359359
VERSION_INFO_PREFIX = "";
360360
};

src/platforms/ios/NotaWebViewExt.xcframework/Info.plist

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,32 @@
66
<array>
77
<dict>
88
<key>LibraryIdentifier</key>
9-
<string>ios-armv7_arm64</string>
9+
<string>ios-arm64_i386_x86_64-simulator</string>
1010
<key>LibraryPath</key>
1111
<string>NotaWebViewExt.framework</string>
1212
<key>SupportedArchitectures</key>
1313
<array>
14-
<string>armv7</string>
1514
<string>arm64</string>
15+
<string>i386</string>
16+
<string>x86_64</string>
1617
</array>
1718
<key>SupportedPlatform</key>
1819
<string>ios</string>
20+
<key>SupportedPlatformVariant</key>
21+
<string>simulator</string>
1922
</dict>
2023
<dict>
2124
<key>LibraryIdentifier</key>
22-
<string>ios-i386_x86_64-simulator</string>
25+
<string>ios-arm64_armv7</string>
2326
<key>LibraryPath</key>
2427
<string>NotaWebViewExt.framework</string>
2528
<key>SupportedArchitectures</key>
2629
<array>
27-
<string>i386</string>
28-
<string>x86_64</string>
30+
<string>arm64</string>
31+
<string>armv7</string>
2932
</array>
3033
<key>SupportedPlatform</key>
3134
<string>ios</string>
32-
<key>SupportedPlatformVariant</key>
33-
<string>simulator</string>
3435
</dict>
3536
</array>
3637
<key>CFBundlePackageType</key>
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#if 0
22
#elif defined(__arm64__) && __arm64__
3-
// Generated by Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
3+
// Generated by Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
4+
#ifndef NOTAWEBVIEWEXT_SWIFT_H
5+
#define NOTAWEBVIEWEXT_SWIFT_H
46
#pragma clang diagnostic push
57
#pragma clang diagnostic ignored "-Wgcc-compat"
68

@@ -228,9 +230,12 @@ SWIFT_CLASS("_TtC14NotaWebViewExt22CustomUrlSchemeHandler") SWIFT_AVAILABILITY(i
228230
# pragma clang attribute pop
229231
#endif
230232
#pragma clang diagnostic pop
233+
#endif
231234

232235
#elif defined(__ARM_ARCH_7A__) && __ARM_ARCH_7A__
233-
// Generated by Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
236+
// Generated by Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
237+
#ifndef NOTAWEBVIEWEXT_SWIFT_H
238+
#define NOTAWEBVIEWEXT_SWIFT_H
234239
#pragma clang diagnostic push
235240
#pragma clang diagnostic ignored "-Wgcc-compat"
236241

@@ -458,5 +463,6 @@ SWIFT_CLASS("_TtC14NotaWebViewExt22CustomUrlSchemeHandler") SWIFT_AVAILABILITY(i
458463
# pragma clang attribute pop
459464
#endif
460465
#pragma clang diagnostic pop
466+
#endif
461467

462468
#endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swift-interface-format-version: 1.0
2-
// swift-compiler-version: Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
2+
// swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
33
// swift-module-flags: -target armv7-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt
44
import Foundation
55
@_exported import NotaWebViewExt
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swift-interface-format-version: 1.0
2-
// swift-compiler-version: Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
2+
// swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
33
// swift-module-flags: -target arm64-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt
44
import Foundation
55
@_exported import NotaWebViewExt
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swift-interface-format-version: 1.0
2-
// swift-compiler-version: Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
2+
// swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
33
// swift-module-flags: -target arm64-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt
44
import Foundation
55
@_exported import NotaWebViewExt
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swift-interface-format-version: 1.0
2-
// swift-compiler-version: Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
2+
// swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
33
// swift-module-flags: -target armv7-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt
44
import Foundation
55
@_exported import NotaWebViewExt
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swift-interface-format-version: 1.0
2-
// swift-compiler-version: Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
2+
// swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
33
// swift-module-flags: -target armv7-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt
44
import Foundation
55
@_exported import NotaWebViewExt

0 commit comments

Comments
 (0)