Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
87 lines (83 loc) · 3.14 KB
/
Copy pathPackage.swift
File metadata and controls
87 lines (83 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// swift-tools-version: 6.0
import PackageDescription
// Header search paths for quoted cross-directory imports (SPM has no CocoaPods header maps).
// Keep in sync when adding new ios/ subdirectories that contain headers.
let headerSearchPaths: [String] = [
"ios",
"ios/bridging",
"ios/conversion",
"ios/helpers/container",
"ios/helpers/image",
"ios/helpers/scroll-view",
"ios/legacy",
"ios/legacy/events",
"ios/legacy/integrations",
"ios/legacy/utils",
"ios/modals/form-sheet",
"ios/modals/utils",
"ios/safe-area",
"ios/scroll-to-top-guard",
"ios/scroll-view-marker",
"ios/scroll-view-marker/conversion",
"ios/split",
"ios/split/conversion",
"ios/stack",
"ios/stack/conversion",
"ios/stack/header",
"ios/stack/host",
"ios/stack/screen",
"ios/tabs",
"ios/tabs/bottom-accessory",
"ios/tabs/conversion",
"ios/tabs/extensions",
"ios/tabs/host",
"ios/tabs/screen",
"ios/utils",
"ios/utils/extensions",
"common/cpp",
"cpp/legacy",
]
let cSettings: [CSetting] = headerSearchPaths.map { .headerSearchPath($0) }
let cxxSettings: [CXXSetting] = [
.define("DEBUG", .when(configuration: .debug)),
.define("NDEBUG", .when(configuration: .release)),
] + headerSearchPaths.map { .headerSearchPath($0) }
let package = Package(
name: "RNScreens",
platforms: [.iOS(.v15)],
products: [
.library(name: "RNScreens", targets: ["RNScreens"]),
],
dependencies: [
// Resolved from the autolinker symlink `<app>/ios/build/generated/autolinking/libs/RNScreens`,
// not from node_modules: `../../../../xcframeworks` -> `<app>/ios/build/xcframeworks`,
// `../../../ios` -> `<app>/ios/build/generated/ios`. Same layout `npx react-native spm scaffold` emits.
// Making this self-contained (remote RN package URL + shipping our own codegen output) is blocked
// on RN publishing a remote SPM package and would require `codegenConfig.includesGeneratedCode`, see:
// https://github.com/react/react-native/blob/v0.87.1/packages/react-native/scripts/spm/__docs__/spm-header-paths-contract.md#hand-authored-community-library-contract
.package(name: "ReactNative", path: "../../../../xcframeworks"),
.package(name: "React-GeneratedCode", path: "../../../ios"),
],
targets: [
.target(
name: "RNScreens",
dependencies: [
.product(name: "ReactHeaders", package: "ReactNative"),
.product(name: "ReactNativeHeaders", package: "ReactNative"),
.product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"),
.product(name: "ReactAppHeaders", package: "React-GeneratedCode"),
],
path: ".",
exclude: ["ios/RNScreens.xcodeproj"],
sources: ["ios", "common/cpp", "cpp"],
publicHeadersPath: "ios",
cSettings: cSettings,
cxxSettings: cxxSettings,
linkerSettings: [
.linkedFramework("UIKit"),
.linkedFramework("Foundation"),
]
),
],
cxxLanguageStandard: .cxx20
)