diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..cb38eb7 --- /dev/null +++ b/Package.swift @@ -0,0 +1,42 @@ +// swift-tools-version: 6.0 +// AUTO-SCAFFOLDED by react-native spm scaffold — safe to edit & commit via patch-package. +// AUTO-SCAFFOLDED-VERSION: 19 +// Cache slot: 0.87.1/dual-flavor +// Edit the contents below if needed and re-run `npx patch-package ` +// to persist across `npm install`. To regenerate from the podspec, remove +// this file (or just this marker) and re-run `npx react-native spm scaffold`. +// +// Package references are plain relative paths, computed when this file was +// scaffolded. They stay correct because the file is re-scaffolded per app +// and cache slot, and any node_modules relayout reinstalls this package +// (dropping the file) anyway. + +import PackageDescription + +let package = Package( + name: "ReactNativeZipArchive", + platforms: [.iOS(.v15)], + products: [ + .library(name: "ReactNativeZipArchive", targets: ["ReactNativeZipArchive"]), + ], + dependencies: [ + .package(name: "ReactNative", path: "../../../../xcframeworks"), + .package(name: "React-GeneratedCode", path: "../../../ios"), + ], + targets: [ + .target( + name: "ReactNativeZipArchive", + dependencies: [.product(name: "ReactHeaders", package: "ReactNative"), .product(name: "ReactNativeHeaders", package: "ReactNative"), .product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"), .product(name: "ReactAppHeaders", package: "React-GeneratedCode")], + path: ".", + sources: [ + "ios/RNZipArchive.h", + "ios/RNZipArchive.mm", + ], + publicHeadersPath: "ios", + cSettings: [.headerSearchPath("ios"), .headerSearchPath("."), .unsafeFlags(["-include", "react-native-spm-prefix.h"])], + cxxSettings: [.headerSearchPath("ios"), .headerSearchPath("."), .unsafeFlags(["-include", "react-native-spm-prefix.h"]), .define("DEBUG", .when(configuration: .debug)), .define("NDEBUG", .when(configuration: .release))], + linkerSettings: [.linkedFramework("UIKit"), .linkedFramework("Foundation"), .linkedFramework("CoreGraphics")] + ), + ], + cxxLanguageStandard: .cxx20 +) diff --git a/react-native-spm-prefix.h b/react-native-spm-prefix.h new file mode 100644 index 0000000..af5cea0 --- /dev/null +++ b/react-native-spm-prefix.h @@ -0,0 +1,10 @@ +// AUTO-SCAFFOLDED by react-native spm scaffold — mirrors CocoaPods' default +// prefix header so ObjC sources that rely on an implicit Foundation/UIKit +// import compile under SPM (which has no prefix-header mechanism). Safe to +// delete + regenerate via `npx react-native spm scaffold`. +#ifdef __OBJC__ +#import +#if __has_include() +#import +#endif +#endif