diff --git a/rust-swift-spike/.gitignore b/rust-swift-spike/.gitignore deleted file mode 100644 index e9713f0b..00000000 --- a/rust-swift-spike/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Cargo -# will have compiled files and executables -debug/ -target/ - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - -# These are backup files generated by rustfmt -**/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information -*.pdb - -# Xcode stuff -/include - -/Example.xcframework/ios-arm64/Example.framework/* -/Example.xcframework/ios-arm64/Example.framework/Headers/* -!/Example.xcframework/ios-arm64/Example.framework/Info.plist -!/Example.xcframework/ios-arm64/Example.framework/Modules -!/Example.xcframework/ios-arm64/Example.framework/Headers -!/Example.xcframework/ios-arm64/Example.framework/Headers/exampleFFI.h - -/Example.xcframework/ios-arm64_x86_64-simulator/Example.framework/* -/Example.xcframework/ios-arm64_x86_64-simulator/Example.framework/Headers/* -!/Example.xcframework/ios-arm64_x86_64-simulator/Example.framework/Info.plist -!/Example.xcframework/ios-arm64_x86_64-simulator/Example.framework/Modules -!/Example.xcframework/ios-arm64_x86_64-simulator/Example.framework/Headers -!/Example.xcframework/ios-arm64_x86_64-simulator/Example.framework/Headers/exampleFFI.h - -*.DS_Store diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/.gitignore b/rust-swift-spike/archive/ios-app/ExampleApp/.gitignore deleted file mode 100644 index 919390f3..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/.gitignore +++ /dev/null @@ -1,94 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## User settings -xcuserdata/ - -## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) -*.xcscmblueprint -*.xccheckout - -## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) -build/ -DerivedData/ -*.moved-aside -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 - -## Obj-C/Swift specific -*.hmap - -## App packaging -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -# *.xcodeproj -# -# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata -# hence it is not needed unless you have added a package configuration file to your project -# .swiftpm - -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ -# -# Add this line if you want to avoid checking in source code from the Xcode workspace -# *.xcworkspace - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build/ - -# Accio dependency management -Dependencies/ -.accio/ - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. -# Instead, use fastlane to re-generate the screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots/**/*.png -fastlane/test_output - -# Code Injection -# -# After new code Injection tools there's a generated folder /iOSInjectionProject -# https://github.com/johnno1962/injectionforxcode - -iOSInjectionProject/ - - -# Ignore big static library for now -librust_uniffi_example.a diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.pbxproj b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.pbxproj deleted file mode 100644 index 49b3196c..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,586 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 56; - objects = { - -/* Begin PBXBuildFile section */ - CE3A9C212AA1D18400EE36D7 /* Lib in Resources */ = {isa = PBXBuildFile; fileRef = CE3A9C202AA1D18400EE36D7 /* Lib */; }; - CE6308712A9F079400F94A42 /* ExampleAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6308702A9F079400F94A42 /* ExampleAppApp.swift */; }; - CE6308732A9F079400F94A42 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6308722A9F079400F94A42 /* ContentView.swift */; }; - CE6308752A9F079500F94A42 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE6308742A9F079500F94A42 /* Assets.xcassets */; }; - CE6308782A9F079500F94A42 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE6308772A9F079500F94A42 /* Preview Assets.xcassets */; }; - CE6308822A9F079500F94A42 /* ExampleAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6308812A9F079500F94A42 /* ExampleAppTests.swift */; }; - CE63088C2A9F079500F94A42 /* ExampleAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63088B2A9F079500F94A42 /* ExampleAppUITests.swift */; }; - CE63088E2A9F079500F94A42 /* ExampleAppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63088D2A9F079500F94A42 /* ExampleAppUITestsLaunchTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - CE63087E2A9F079500F94A42 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = CE6308652A9F079400F94A42 /* Project object */; - proxyType = 1; - remoteGlobalIDString = CE63086C2A9F079400F94A42; - remoteInfo = ExampleApp; - }; - CE6308882A9F079500F94A42 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = CE6308652A9F079400F94A42 /* Project object */; - proxyType = 1; - remoteGlobalIDString = CE63086C2A9F079400F94A42; - remoteInfo = ExampleApp; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - CE3A9C202AA1D18400EE36D7 /* Lib */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Lib; sourceTree = ""; }; - CE63086D2A9F079400F94A42 /* ExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - CE6308702A9F079400F94A42 /* ExampleAppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleAppApp.swift; sourceTree = ""; }; - CE6308722A9F079400F94A42 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - CE6308742A9F079500F94A42 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - CE6308772A9F079500F94A42 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - CE63087D2A9F079500F94A42 /* ExampleAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - CE6308812A9F079500F94A42 /* ExampleAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleAppTests.swift; sourceTree = ""; }; - CE6308872A9F079500F94A42 /* ExampleAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - CE63088B2A9F079500F94A42 /* ExampleAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleAppUITests.swift; sourceTree = ""; }; - CE63088D2A9F079500F94A42 /* ExampleAppUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleAppUITestsLaunchTests.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - CE63086A2A9F079400F94A42 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE63087A2A9F079500F94A42 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE6308842A9F079500F94A42 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - CE6308642A9F079400F94A42 = { - isa = PBXGroup; - children = ( - CE3A9C202AA1D18400EE36D7 /* Lib */, - CE63086F2A9F079400F94A42 /* ExampleApp */, - CE6308802A9F079500F94A42 /* ExampleAppTests */, - CE63088A2A9F079500F94A42 /* ExampleAppUITests */, - CE63086E2A9F079400F94A42 /* Products */, - ); - sourceTree = ""; - }; - CE63086E2A9F079400F94A42 /* Products */ = { - isa = PBXGroup; - children = ( - CE63086D2A9F079400F94A42 /* ExampleApp.app */, - CE63087D2A9F079500F94A42 /* ExampleAppTests.xctest */, - CE6308872A9F079500F94A42 /* ExampleAppUITests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - CE63086F2A9F079400F94A42 /* ExampleApp */ = { - isa = PBXGroup; - children = ( - CE6308702A9F079400F94A42 /* ExampleAppApp.swift */, - CE6308722A9F079400F94A42 /* ContentView.swift */, - CE6308742A9F079500F94A42 /* Assets.xcassets */, - CE6308762A9F079500F94A42 /* Preview Content */, - ); - path = ExampleApp; - sourceTree = ""; - }; - CE6308762A9F079500F94A42 /* Preview Content */ = { - isa = PBXGroup; - children = ( - CE6308772A9F079500F94A42 /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; - CE6308802A9F079500F94A42 /* ExampleAppTests */ = { - isa = PBXGroup; - children = ( - CE6308812A9F079500F94A42 /* ExampleAppTests.swift */, - ); - path = ExampleAppTests; - sourceTree = ""; - }; - CE63088A2A9F079500F94A42 /* ExampleAppUITests */ = { - isa = PBXGroup; - children = ( - CE63088B2A9F079500F94A42 /* ExampleAppUITests.swift */, - CE63088D2A9F079500F94A42 /* ExampleAppUITestsLaunchTests.swift */, - ); - path = ExampleAppUITests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - CE63086C2A9F079400F94A42 /* ExampleApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = CE6308912A9F079500F94A42 /* Build configuration list for PBXNativeTarget "ExampleApp" */; - buildPhases = ( - CE6308692A9F079400F94A42 /* Sources */, - CE63086A2A9F079400F94A42 /* Frameworks */, - CE63086B2A9F079400F94A42 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ExampleApp; - productName = ExampleApp; - productReference = CE63086D2A9F079400F94A42 /* ExampleApp.app */; - productType = "com.apple.product-type.application"; - }; - CE63087C2A9F079500F94A42 /* ExampleAppTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = CE6308942A9F079500F94A42 /* Build configuration list for PBXNativeTarget "ExampleAppTests" */; - buildPhases = ( - CE6308792A9F079500F94A42 /* Sources */, - CE63087A2A9F079500F94A42 /* Frameworks */, - CE63087B2A9F079500F94A42 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - CE63087F2A9F079500F94A42 /* PBXTargetDependency */, - ); - name = ExampleAppTests; - productName = ExampleAppTests; - productReference = CE63087D2A9F079500F94A42 /* ExampleAppTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - CE6308862A9F079500F94A42 /* ExampleAppUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = CE6308972A9F079500F94A42 /* Build configuration list for PBXNativeTarget "ExampleAppUITests" */; - buildPhases = ( - CE6308832A9F079500F94A42 /* Sources */, - CE6308842A9F079500F94A42 /* Frameworks */, - CE6308852A9F079500F94A42 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - CE6308892A9F079500F94A42 /* PBXTargetDependency */, - ); - name = ExampleAppUITests; - productName = ExampleAppUITests; - productReference = CE6308872A9F079500F94A42 /* ExampleAppUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - CE6308652A9F079400F94A42 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1430; - LastUpgradeCheck = 1430; - TargetAttributes = { - CE63086C2A9F079400F94A42 = { - CreatedOnToolsVersion = 14.3.1; - }; - CE63087C2A9F079500F94A42 = { - CreatedOnToolsVersion = 14.3.1; - TestTargetID = CE63086C2A9F079400F94A42; - }; - CE6308862A9F079500F94A42 = { - CreatedOnToolsVersion = 14.3.1; - TestTargetID = CE63086C2A9F079400F94A42; - }; - }; - }; - buildConfigurationList = CE6308682A9F079400F94A42 /* Build configuration list for PBXProject "ExampleApp" */; - compatibilityVersion = "Xcode 14.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = CE6308642A9F079400F94A42; - productRefGroup = CE63086E2A9F079400F94A42 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - CE63086C2A9F079400F94A42 /* ExampleApp */, - CE63087C2A9F079500F94A42 /* ExampleAppTests */, - CE6308862A9F079500F94A42 /* ExampleAppUITests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - CE63086B2A9F079400F94A42 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CE3A9C212AA1D18400EE36D7 /* Lib in Resources */, - CE6308782A9F079500F94A42 /* Preview Assets.xcassets in Resources */, - CE6308752A9F079500F94A42 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE63087B2A9F079500F94A42 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE6308852A9F079500F94A42 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - CE6308692A9F079400F94A42 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CE6308732A9F079400F94A42 /* ContentView.swift in Sources */, - CE6308712A9F079400F94A42 /* ExampleAppApp.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE6308792A9F079500F94A42 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CE6308822A9F079500F94A42 /* ExampleAppTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE6308832A9F079500F94A42 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CE63088C2A9F079500F94A42 /* ExampleAppUITests.swift in Sources */, - CE63088E2A9F079500F94A42 /* ExampleAppUITestsLaunchTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - CE63087F2A9F079500F94A42 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = CE63086C2A9F079400F94A42 /* ExampleApp */; - targetProxy = CE63087E2A9F079500F94A42 /* PBXContainerItemProxy */; - }; - CE6308892A9F079500F94A42 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = CE63086C2A9F079400F94A42 /* ExampleApp */; - targetProxy = CE6308882A9F079500F94A42 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - CE63088F2A9F079500F94A42 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - CE6308902A9F079500F94A42 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - CE6308922A9F079500F94A42 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"ExampleApp/Preview Content\""; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.testing.ExampleApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - CE6308932A9F079500F94A42 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"ExampleApp/Preview Content\""; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.testing.ExampleApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - CE6308952A9F079500F94A42 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.testing.ExampleAppTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ExampleApp"; - }; - name = Debug; - }; - CE6308962A9F079500F94A42 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.testing.ExampleAppTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ExampleApp"; - }; - name = Release; - }; - CE6308982A9F079500F94A42 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.testing.ExampleAppUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = ExampleApp; - }; - name = Debug; - }; - CE6308992A9F079500F94A42 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.testing.ExampleAppUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = ExampleApp; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - CE6308682A9F079400F94A42 /* Build configuration list for PBXProject "ExampleApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CE63088F2A9F079500F94A42 /* Debug */, - CE6308902A9F079500F94A42 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CE6308912A9F079500F94A42 /* Build configuration list for PBXNativeTarget "ExampleApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CE6308922A9F079500F94A42 /* Debug */, - CE6308932A9F079500F94A42 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CE6308942A9F079500F94A42 /* Build configuration list for PBXNativeTarget "ExampleAppTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CE6308952A9F079500F94A42 /* Debug */, - CE6308962A9F079500F94A42 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CE6308972A9F079500F94A42 /* Build configuration list for PBXNativeTarget "ExampleAppUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CE6308982A9F079500F94A42 /* Debug */, - CE6308992A9F079500F94A42 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = CE6308652A9F079400F94A42 /* Project object */; -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index c62c3b93..00000000 Binary files a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 7d8ef2a4..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - ExampleApp.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/AccentColor.colorset/Contents.json b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb878970..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 13613e3e..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/Contents.json b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/ContentView.swift b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/ContentView.swift deleted file mode 100644 index d8beb11d..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/ContentView.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ContentView.swift -// ExampleApp -// -// Created by User Name on 8/30/23. -// - -import SwiftUI - -struct ContentView: View { - var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundColor(.accentColor) - Text("Hello, world!") - } - .padding() - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/ExampleAppApp.swift b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/ExampleAppApp.swift deleted file mode 100644 index 7758a35b..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/ExampleAppApp.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// ExampleAppApp.swift -// ExampleApp -// -// Created by User Name on 8/30/23. -// - -import SwiftUI - -@main -struct ExampleAppApp: App { - var body: some Scene { - WindowGroup { - ContentView() - } - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Preview Content/Preview Assets.xcassets/Contents.json b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/RustUniFFIExampleBindings.swift b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/RustUniFFIExampleBindings.swift deleted file mode 100644 index 0dd7103b..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleApp/RustUniFFIExampleBindings.swift +++ /dev/null @@ -1,404 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! -import Foundation - -// Depending on the consumer's build setup, the low-level FFI code -// might be in a separate module, or it might be compiled inline into -// this module. This is a bit of light hackery to work with both. -#if canImport(RustUniFFIExampleBindingsFFI) - import RustUniFFIExampleBindingsFFI -#endif - -//import RustUniFFIExample - -private extension RustBuffer { - // Allocate a new buffer, copying the contents of a `UInt8` array. - init(bytes: [UInt8]) { - let rbuf = bytes.withUnsafeBufferPointer { ptr in - RustBuffer.from(ptr) - } - self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data) - } - - static func from(_ ptr: UnsafeBufferPointer) -> RustBuffer { - try! rustCall { ffi_rust_uniffi_example_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } - } - - // Frees the buffer in place. - // The buffer must not be used after this is called. - func deallocate() { - try! rustCall { ffi_rust_uniffi_example_rustbuffer_free(self, $0) } - } -} - -private extension ForeignBytes { - init(bufferPointer: UnsafeBufferPointer) { - self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress) - } -} - -// For every type used in the interface, we provide helper methods for conveniently -// lifting and lowering that type from C-compatible data, and for reading and writing -// values of that type in a buffer. - -// Helper classes/extensions that don't change. -// Someday, this will be in a library of its own. - -private extension Data { - init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) - } -} - -// Define reader functionality. Normally this would be defined in a class or -// struct, but we use standalone functions instead in order to make external -// types work. -// -// With external types, one swift source file needs to be able to call the read -// method on another source file's FfiConverter, but then what visibility -// should Reader have? -// - If Reader is fileprivate, then this means the read() must also -// be fileprivate, which doesn't work with external types. -// - If Reader is internal/public, we'll get compile errors since both source -// files will try define the same type. -// -// Instead, the read() method and these helper functions input a tuple of data - -private func createReader(data: Data) -> (data: Data, offset: Data.Index) { - (data: data, offset: 0) -} - -// Reads an integer at the current offset, in big-endian order, and advances -// the offset on success. Throws if reading the integer would move the -// offset past the end of the buffer. -private func readInt(_ reader: inout (data: Data, offset: Data.Index)) throws -> T { - let range = reader.offset ..< reader.offset + MemoryLayout.size - guard reader.data.count >= range.upperBound else { - throw UniffiInternalError.bufferOverflow - } - if T.self == UInt8.self { - let value = reader.data[reader.offset] - reader.offset += 1 - return value as! T - } - var value: T = 0 - let _ = withUnsafeMutableBytes(of: &value) { reader.data.copyBytes(to: $0, from: range) } - reader.offset = range.upperBound - return value.bigEndian -} - -// Reads an arbitrary number of bytes, to be used to read -// raw bytes, this is useful when lifting strings -private func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> [UInt8] { - let range = reader.offset ..< (reader.offset + count) - guard reader.data.count >= range.upperBound else { - throw UniffiInternalError.bufferOverflow - } - var value = [UInt8](repeating: 0, count: count) - value.withUnsafeMutableBufferPointer { buffer in - reader.data.copyBytes(to: buffer, from: range) - } - reader.offset = range.upperBound - return value -} - -// Reads a float at the current offset. -private func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { - return try Float(bitPattern: readInt(&reader)) -} - -// Reads a float at the current offset. -private func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { - return try Double(bitPattern: readInt(&reader)) -} - -// Indicates if the offset has reached the end of the buffer. -private func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool { - return reader.offset < reader.data.count -} - -// Define writer functionality. Normally this would be defined in a class or -// struct, but we use standalone functions instead in order to make external -// types work. See the above discussion on Readers for details. - -private func createWriter() -> [UInt8] { - return [] -} - -private func writeBytes(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 { - writer.append(contentsOf: byteArr) -} - -// Writes an integer in big-endian order. -// -// Warning: make sure what you are trying to write -// is in the correct type! -private func writeInt(_ writer: inout [UInt8], _ value: T) { - var value = value.bigEndian - withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) } -} - -private func writeFloat(_ writer: inout [UInt8], _ value: Float) { - writeInt(&writer, value.bitPattern) -} - -private func writeDouble(_ writer: inout [UInt8], _ value: Double) { - writeInt(&writer, value.bitPattern) -} - -// Protocol for types that transfer other types across the FFI. This is -// analogous go the Rust trait of the same name. -private protocol FfiConverter { - associatedtype FfiType - associatedtype SwiftType - - static func lift(_ value: FfiType) throws -> SwiftType - static func lower(_ value: SwiftType) -> FfiType - static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType - static func write(_ value: SwiftType, into buf: inout [UInt8]) -} - -// Types conforming to `Primitive` pass themselves directly over the FFI. -private protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType {} - -extension FfiConverterPrimitive { - public static func lift(_ value: FfiType) throws -> SwiftType { - return value - } - - public static func lower(_ value: SwiftType) -> FfiType { - return value - } -} - -// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`. -// Used for complex types where it's hard to write a custom lift/lower. -private protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} - -extension FfiConverterRustBuffer { - public static func lift(_ buf: RustBuffer) throws -> SwiftType { - var reader = createReader(data: Data(rustBuffer: buf)) - let value = try read(from: &reader) - if hasRemaining(reader) { - throw UniffiInternalError.incompleteData - } - buf.deallocate() - return value - } - - public static func lower(_ value: SwiftType) -> RustBuffer { - var writer = createWriter() - write(value, into: &writer) - return RustBuffer(bytes: writer) - } -} - -// An error type for FFI errors. These errors occur at the UniFFI level, not -// the library level. -private enum UniffiInternalError: LocalizedError { - case bufferOverflow - case incompleteData - case unexpectedOptionalTag - case unexpectedEnumCase - case unexpectedNullPointer - case unexpectedRustCallStatusCode - case unexpectedRustCallError - case unexpectedStaleHandle - case rustPanic(_ message: String) - - public var errorDescription: String? { - switch self { - case .bufferOverflow: return "Reading the requested value would read past the end of the buffer" - case .incompleteData: return "The buffer still has data after lifting its containing value" - case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1" - case .unexpectedEnumCase: return "Raw enum value doesn't match any cases" - case .unexpectedNullPointer: return "Raw pointer value was null" - case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code" - case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified" - case .unexpectedStaleHandle: return "The object in the handle map has been dropped already" - case let .rustPanic(message): return message - } - } -} - -private let CALL_SUCCESS: Int8 = 0 -private let CALL_ERROR: Int8 = 1 -private let CALL_PANIC: Int8 = 2 - -private extension RustCallStatus { - init() { - self.init( - code: CALL_SUCCESS, - errorBuf: RustBuffer( - capacity: 0, - len: 0, - data: nil - ) - ) - } -} - -private func rustCall(_ callback: (UnsafeMutablePointer) -> T) throws -> T { - try makeRustCall(callback, errorHandler: nil) -} - -private func rustCallWithError( - _ errorHandler: @escaping (RustBuffer) throws -> Error, - _ callback: (UnsafeMutablePointer) -> T -) throws -> T { - try makeRustCall(callback, errorHandler: errorHandler) -} - -private func makeRustCall( - _ callback: (UnsafeMutablePointer) -> T, - errorHandler: ((RustBuffer) throws -> Error)? -) throws -> T { - uniffiEnsureInitialized() - var callStatus = RustCallStatus() - let returnedVal = callback(&callStatus) - try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler) - return returnedVal -} - -private func uniffiCheckCallStatus( - callStatus: RustCallStatus, - errorHandler: ((RustBuffer) throws -> Error)? -) throws { - switch callStatus.code { - case CALL_SUCCESS: - return - - case CALL_ERROR: - if let errorHandler = errorHandler { - throw try errorHandler(callStatus.errorBuf) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.unexpectedRustCallError - } - - case CALL_PANIC: - // When the rust code sees a panic, it tries to construct a RustBuffer - // with the message. But if that code panics, then it just sends back - // an empty buffer. - if callStatus.errorBuf.len > 0 { - throw try UniffiInternalError.rustPanic(FfiConverterString.lift(callStatus.errorBuf)) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.rustPanic("Rust panic") - } - - default: - throw UniffiInternalError.unexpectedRustCallStatusCode - } -} - -// Public interface members begin here. - -private struct FfiConverterUInt32: FfiConverterPrimitive { - typealias FfiType = UInt32 - typealias SwiftType = UInt32 - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 { - return try lift(readInt(&buf)) - } - - public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - writeInt(&buf, lower(value)) - } -} - -private struct FfiConverterString: FfiConverter { - typealias SwiftType = String - typealias FfiType = RustBuffer - - public static func lift(_ value: RustBuffer) throws -> String { - defer { - value.deallocate() - } - if value.data == nil { - return String() - } - let bytes = UnsafeBufferPointer(start: value.data!, count: Int(value.len)) - return String(bytes: bytes, encoding: String.Encoding.utf8)! - } - - public static func lower(_ value: String) -> RustBuffer { - return value.utf8CString.withUnsafeBufferPointer { ptr in - // The swift string gives us int8_t, we want uint8_t. - ptr.withMemoryRebound(to: UInt8.self) { ptr in - // The swift string gives us a trailing null byte, we don't want it. - let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1)) - return RustBuffer.from(buf) - } - } - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String { - let len: Int32 = try readInt(&buf) - return try String(bytes: readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! - } - - public static func write(_ value: String, into buf: inout [UInt8]) { - let len = Int32(value.utf8.count) - writeInt(&buf, len) - writeBytes(&buf, value.utf8) - } -} - -public func add(a: UInt32, b: UInt32) -> UInt32 { - return try! FfiConverterUInt32.lift( - try! rustCall { - uniffi_rust_uniffi_example_fn_func_add( - FfiConverterUInt32.lower(a), - FfiConverterUInt32.lower(b), $0 - ) - } - ) -} - -public func hello() -> String { - return try! FfiConverterString.lift( - try! rustCall { - uniffi_rust_uniffi_example_fn_func_hello($0) - } - ) -} - -private enum InitializationResult { - case ok - case contractVersionMismatch - case apiChecksumMismatch -} - -// Use a global variables to perform the versioning checks. Swift ensures that -// the code inside is only computed once. -private var initializationResult: InitializationResult { - // Get the bindings contract version from our ComponentInterface - let bindings_contract_version = 22 - // Get the scaffolding contract version by calling the into the dylib - let scaffolding_contract_version = ffi_rust_uniffi_example_uniffi_contract_version() - if bindings_contract_version != scaffolding_contract_version { - return InitializationResult.contractVersionMismatch - } - if uniffi_rust_uniffi_example_checksum_func_add() != 29339 { - return InitializationResult.apiChecksumMismatch - } - if uniffi_rust_uniffi_example_checksum_func_hello() != 61923 { - return InitializationResult.apiChecksumMismatch - } - - return InitializationResult.ok -} - -private func uniffiEnsureInitialized() { - switch initializationResult { - case .ok: - break - case .contractVersionMismatch: - fatalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") - case .apiChecksumMismatch: - fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppTests/ExampleAppTests.swift b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppTests/ExampleAppTests.swift deleted file mode 100644 index 20ac937a..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppTests/ExampleAppTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// ExampleAppTests.swift -// ExampleAppTests -// -// Created by User Name on 8/30/23. -// - -import XCTest -@testable import ExampleApp - -final class ExampleAppTests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - // Any test you write for XCTest can be annotated as throws and async. - // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. - // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. - } - - func testPerformanceExample() throws { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppUITests/ExampleAppUITests.swift b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppUITests/ExampleAppUITests.swift deleted file mode 100644 index a8080809..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppUITests/ExampleAppUITests.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// ExampleAppUITests.swift -// ExampleAppUITests -// -// Created by User Name on 8/30/23. -// - -import XCTest - -final class ExampleAppUITests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // UI tests must launch the application that they test. - let app = XCUIApplication() - app.launch() - - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testLaunchPerformance() throws { - if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { - // This measures how long it takes to launch your application. - measure(metrics: [XCTApplicationLaunchMetric()]) { - XCUIApplication().launch() - } - } - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppUITests/ExampleAppUITestsLaunchTests.swift b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppUITests/ExampleAppUITestsLaunchTests.swift deleted file mode 100644 index 06834809..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleAppUITests/ExampleAppUITestsLaunchTests.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// ExampleAppUITestsLaunchTests.swift -// ExampleAppUITests -// -// Created by User Name on 8/30/23. -// - -import XCTest - -final class ExampleAppUITestsLaunchTests: XCTestCase { - - override class var runsForEachTargetApplicationUIConfiguration: Bool { - true - } - - override func setUpWithError() throws { - continueAfterFailure = false - } - - func testLaunch() throws { - let app = XCUIApplication() - app.launch() - - // Insert steps here to perform after app launch but before taking a screenshot, - // such as logging into a test account or navigating somewhere in the app - - let attachment = XCTAttachment(screenshot: app.screenshot()) - attachment.name = "Launch Screen" - attachment.lifetime = .keepAlways - add(attachment) - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/Info.plist b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/Info.plist deleted file mode 100644 index 5f64e9bd..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/Info.plist +++ /dev/null @@ -1,43 +0,0 @@ - - - - - AvailableLibraries - - - HeadersPath - Headers - LibraryIdentifier - ios-arm64 - LibraryPath - librust_uniffi_example.a - SupportedArchitectures - - arm64 - - SupportedPlatform - ios - - - HeadersPath - Headers - LibraryIdentifier - ios-arm64-simulator - LibraryPath - librust_uniffi_example.a - SupportedArchitectures - - arm64 - - SupportedPlatform - ios - SupportedPlatformVariant - simulator - - - CFBundlePackageType - XFWK - XCFrameworkFormatVersion - 1.0 - - diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64-simulator/Headers/RustUniFFIExampleBindingsFFI.h b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64-simulator/Headers/RustUniFFIExampleBindingsFFI.h deleted file mode 100644 index 4625ecb5..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64-simulator/Headers/RustUniFFIExampleBindingsFFI.h +++ /dev/null @@ -1,89 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! - -#pragma once - -#include -#include -#include - -// The following structs are used to implement the lowest level -// of the FFI, and thus useful to multiple uniffied crates. -// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. -#ifdef UNIFFI_SHARED_H - // We also try to prevent mixing versions of shared uniffi header structs. - // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 - #ifndef UNIFFI_SHARED_HEADER_V4 - #error Combining helper code from multiple versions of uniffi is not supported - #endif // ndef UNIFFI_SHARED_HEADER_V4 -#else -#define UNIFFI_SHARED_H -#define UNIFFI_SHARED_HEADER_V4 -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ - -typedef struct RustBuffer -{ - int32_t capacity; - int32_t len; - uint8_t *_Nullable data; -} RustBuffer; - -typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull); - -// Task defined in Rust that Swift executes -typedef void (*UniFfiRustTaskCallback)(const void * _Nullable); - -// Callback to execute Rust tasks using a Swift Task -// -// Args: -// executor: ForeignExecutor lowered into a size_t value -// delay: Delay in MS -// task: UniFfiRustTaskCallback to call -// task_data: data to pass the task callback -typedef void (*UniFfiForeignExecutorCallback)(size_t, uint32_t, UniFfiRustTaskCallback _Nullable, const void * _Nullable); - -typedef struct ForeignBytes -{ - int32_t len; - const uint8_t *_Nullable data; -} ForeignBytes; - -// Error definitions -typedef struct RustCallStatus { - int8_t code; - RustBuffer errorBuf; -} RustCallStatus; - -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ -#endif // def UNIFFI_SHARED_H - -// Callbacks for UniFFI Futures -typedef void (*UniFfiFutureCallbackUInt32)(const void * _Nonnull, uint32_t, RustCallStatus); -typedef void (*UniFfiFutureCallbackRustBuffer)(const void * _Nonnull, RustBuffer, RustCallStatus); - -// Scaffolding functions -uint32_t uniffi_rust_uniffi_example_fn_func_add(uint32_t a, uint32_t b, RustCallStatus *_Nonnull out_status -); -RustBuffer uniffi_rust_uniffi_example_fn_func_hello(RustCallStatus *_Nonnull out_status - -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status -); -void ffi_rust_uniffi_example_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status -); -uint16_t uniffi_rust_uniffi_example_checksum_func_add(void - -); -uint16_t uniffi_rust_uniffi_example_checksum_func_hello(void - -); -uint32_t ffi_rust_uniffi_example_uniffi_contract_version(void - -); - diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64-simulator/Headers/RustUniFFIExampleBindingsFFI.modulemap b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64-simulator/Headers/RustUniFFIExampleBindingsFFI.modulemap deleted file mode 100644 index d5cfb9fd..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64-simulator/Headers/RustUniFFIExampleBindingsFFI.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! -module RustUniFFIExampleBindingsFFI { - header "RustUniFFIExampleBindingsFFI.h" - export * -} \ No newline at end of file diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64/Headers/RustUniFFIExampleBindingsFFI.h b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64/Headers/RustUniFFIExampleBindingsFFI.h deleted file mode 100644 index 4625ecb5..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64/Headers/RustUniFFIExampleBindingsFFI.h +++ /dev/null @@ -1,89 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! - -#pragma once - -#include -#include -#include - -// The following structs are used to implement the lowest level -// of the FFI, and thus useful to multiple uniffied crates. -// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. -#ifdef UNIFFI_SHARED_H - // We also try to prevent mixing versions of shared uniffi header structs. - // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 - #ifndef UNIFFI_SHARED_HEADER_V4 - #error Combining helper code from multiple versions of uniffi is not supported - #endif // ndef UNIFFI_SHARED_HEADER_V4 -#else -#define UNIFFI_SHARED_H -#define UNIFFI_SHARED_HEADER_V4 -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ - -typedef struct RustBuffer -{ - int32_t capacity; - int32_t len; - uint8_t *_Nullable data; -} RustBuffer; - -typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull); - -// Task defined in Rust that Swift executes -typedef void (*UniFfiRustTaskCallback)(const void * _Nullable); - -// Callback to execute Rust tasks using a Swift Task -// -// Args: -// executor: ForeignExecutor lowered into a size_t value -// delay: Delay in MS -// task: UniFfiRustTaskCallback to call -// task_data: data to pass the task callback -typedef void (*UniFfiForeignExecutorCallback)(size_t, uint32_t, UniFfiRustTaskCallback _Nullable, const void * _Nullable); - -typedef struct ForeignBytes -{ - int32_t len; - const uint8_t *_Nullable data; -} ForeignBytes; - -// Error definitions -typedef struct RustCallStatus { - int8_t code; - RustBuffer errorBuf; -} RustCallStatus; - -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ -#endif // def UNIFFI_SHARED_H - -// Callbacks for UniFFI Futures -typedef void (*UniFfiFutureCallbackUInt32)(const void * _Nonnull, uint32_t, RustCallStatus); -typedef void (*UniFfiFutureCallbackRustBuffer)(const void * _Nonnull, RustBuffer, RustCallStatus); - -// Scaffolding functions -uint32_t uniffi_rust_uniffi_example_fn_func_add(uint32_t a, uint32_t b, RustCallStatus *_Nonnull out_status -); -RustBuffer uniffi_rust_uniffi_example_fn_func_hello(RustCallStatus *_Nonnull out_status - -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status -); -void ffi_rust_uniffi_example_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status -); -uint16_t uniffi_rust_uniffi_example_checksum_func_add(void - -); -uint16_t uniffi_rust_uniffi_example_checksum_func_hello(void - -); -uint32_t ffi_rust_uniffi_example_uniffi_contract_version(void - -); - diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64/Headers/RustUniFFIExampleBindingsFFI.modulemap b/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64/Headers/RustUniFFIExampleBindingsFFI.modulemap deleted file mode 100644 index d5cfb9fd..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/ExampleRustBindings.xcframework/ios-arm64/Headers/RustUniFFIExampleBindingsFFI.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! -module RustUniFFIExampleBindingsFFI { - header "RustUniFFIExampleBindingsFFI.h" - export * -} \ No newline at end of file diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/Lib/Sources/RustUniFFIExampleBindings.swift b/rust-swift-spike/archive/ios-app/ExampleApp/Lib/Sources/RustUniFFIExampleBindings.swift deleted file mode 100644 index 73c1bc08..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/Lib/Sources/RustUniFFIExampleBindings.swift +++ /dev/null @@ -1,402 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! -import Foundation - -// Depending on the consumer's build setup, the low-level FFI code -// might be in a separate module, or it might be compiled inline into -// this module. This is a bit of light hackery to work with both. -#if canImport(RustUniFFIExampleBindingsFFI) - import RustUniFFIExampleBindingsFFI -#endif - -private extension RustBuffer { - // Allocate a new buffer, copying the contents of a `UInt8` array. - init(bytes: [UInt8]) { - let rbuf = bytes.withUnsafeBufferPointer { ptr in - RustBuffer.from(ptr) - } - self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data) - } - - static func from(_ ptr: UnsafeBufferPointer) -> RustBuffer { - try! rustCall { ffi_rust_uniffi_example_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } - } - - // Frees the buffer in place. - // The buffer must not be used after this is called. - func deallocate() { - try! rustCall { ffi_rust_uniffi_example_rustbuffer_free(self, $0) } - } -} - -private extension ForeignBytes { - init(bufferPointer: UnsafeBufferPointer) { - self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress) - } -} - -// For every type used in the interface, we provide helper methods for conveniently -// lifting and lowering that type from C-compatible data, and for reading and writing -// values of that type in a buffer. - -// Helper classes/extensions that don't change. -// Someday, this will be in a library of its own. - -private extension Data { - init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) - } -} - -// Define reader functionality. Normally this would be defined in a class or -// struct, but we use standalone functions instead in order to make external -// types work. -// -// With external types, one swift source file needs to be able to call the read -// method on another source file's FfiConverter, but then what visibility -// should Reader have? -// - If Reader is fileprivate, then this means the read() must also -// be fileprivate, which doesn't work with external types. -// - If Reader is internal/public, we'll get compile errors since both source -// files will try define the same type. -// -// Instead, the read() method and these helper functions input a tuple of data - -private func createReader(data: Data) -> (data: Data, offset: Data.Index) { - (data: data, offset: 0) -} - -// Reads an integer at the current offset, in big-endian order, and advances -// the offset on success. Throws if reading the integer would move the -// offset past the end of the buffer. -private func readInt(_ reader: inout (data: Data, offset: Data.Index)) throws -> T { - let range = reader.offset ..< reader.offset + MemoryLayout.size - guard reader.data.count >= range.upperBound else { - throw UniffiInternalError.bufferOverflow - } - if T.self == UInt8.self { - let value = reader.data[reader.offset] - reader.offset += 1 - return value as! T - } - var value: T = 0 - let _ = withUnsafeMutableBytes(of: &value) { reader.data.copyBytes(to: $0, from: range) } - reader.offset = range.upperBound - return value.bigEndian -} - -// Reads an arbitrary number of bytes, to be used to read -// raw bytes, this is useful when lifting strings -private func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> [UInt8] { - let range = reader.offset ..< (reader.offset + count) - guard reader.data.count >= range.upperBound else { - throw UniffiInternalError.bufferOverflow - } - var value = [UInt8](repeating: 0, count: count) - value.withUnsafeMutableBufferPointer { buffer in - reader.data.copyBytes(to: buffer, from: range) - } - reader.offset = range.upperBound - return value -} - -// Reads a float at the current offset. -private func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { - return try Float(bitPattern: readInt(&reader)) -} - -// Reads a float at the current offset. -private func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { - return try Double(bitPattern: readInt(&reader)) -} - -// Indicates if the offset has reached the end of the buffer. -private func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool { - return reader.offset < reader.data.count -} - -// Define writer functionality. Normally this would be defined in a class or -// struct, but we use standalone functions instead in order to make external -// types work. See the above discussion on Readers for details. - -private func createWriter() -> [UInt8] { - return [] -} - -private func writeBytes(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 { - writer.append(contentsOf: byteArr) -} - -// Writes an integer in big-endian order. -// -// Warning: make sure what you are trying to write -// is in the correct type! -private func writeInt(_ writer: inout [UInt8], _ value: T) { - var value = value.bigEndian - withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) } -} - -private func writeFloat(_ writer: inout [UInt8], _ value: Float) { - writeInt(&writer, value.bitPattern) -} - -private func writeDouble(_ writer: inout [UInt8], _ value: Double) { - writeInt(&writer, value.bitPattern) -} - -// Protocol for types that transfer other types across the FFI. This is -// analogous go the Rust trait of the same name. -private protocol FfiConverter { - associatedtype FfiType - associatedtype SwiftType - - static func lift(_ value: FfiType) throws -> SwiftType - static func lower(_ value: SwiftType) -> FfiType - static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType - static func write(_ value: SwiftType, into buf: inout [UInt8]) -} - -// Types conforming to `Primitive` pass themselves directly over the FFI. -private protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType {} - -extension FfiConverterPrimitive { - public static func lift(_ value: FfiType) throws -> SwiftType { - return value - } - - public static func lower(_ value: SwiftType) -> FfiType { - return value - } -} - -// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`. -// Used for complex types where it's hard to write a custom lift/lower. -private protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} - -extension FfiConverterRustBuffer { - public static func lift(_ buf: RustBuffer) throws -> SwiftType { - var reader = createReader(data: Data(rustBuffer: buf)) - let value = try read(from: &reader) - if hasRemaining(reader) { - throw UniffiInternalError.incompleteData - } - buf.deallocate() - return value - } - - public static func lower(_ value: SwiftType) -> RustBuffer { - var writer = createWriter() - write(value, into: &writer) - return RustBuffer(bytes: writer) - } -} - -// An error type for FFI errors. These errors occur at the UniFFI level, not -// the library level. -private enum UniffiInternalError: LocalizedError { - case bufferOverflow - case incompleteData - case unexpectedOptionalTag - case unexpectedEnumCase - case unexpectedNullPointer - case unexpectedRustCallStatusCode - case unexpectedRustCallError - case unexpectedStaleHandle - case rustPanic(_ message: String) - - public var errorDescription: String? { - switch self { - case .bufferOverflow: return "Reading the requested value would read past the end of the buffer" - case .incompleteData: return "The buffer still has data after lifting its containing value" - case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1" - case .unexpectedEnumCase: return "Raw enum value doesn't match any cases" - case .unexpectedNullPointer: return "Raw pointer value was null" - case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code" - case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified" - case .unexpectedStaleHandle: return "The object in the handle map has been dropped already" - case let .rustPanic(message): return message - } - } -} - -private let CALL_SUCCESS: Int8 = 0 -private let CALL_ERROR: Int8 = 1 -private let CALL_PANIC: Int8 = 2 - -private extension RustCallStatus { - init() { - self.init( - code: CALL_SUCCESS, - errorBuf: RustBuffer( - capacity: 0, - len: 0, - data: nil - ) - ) - } -} - -private func rustCall(_ callback: (UnsafeMutablePointer) -> T) throws -> T { - try makeRustCall(callback, errorHandler: nil) -} - -private func rustCallWithError( - _ errorHandler: @escaping (RustBuffer) throws -> Error, - _ callback: (UnsafeMutablePointer) -> T -) throws -> T { - try makeRustCall(callback, errorHandler: errorHandler) -} - -private func makeRustCall( - _ callback: (UnsafeMutablePointer) -> T, - errorHandler: ((RustBuffer) throws -> Error)? -) throws -> T { - uniffiEnsureInitialized() - var callStatus = RustCallStatus() - let returnedVal = callback(&callStatus) - try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler) - return returnedVal -} - -private func uniffiCheckCallStatus( - callStatus: RustCallStatus, - errorHandler: ((RustBuffer) throws -> Error)? -) throws { - switch callStatus.code { - case CALL_SUCCESS: - return - - case CALL_ERROR: - if let errorHandler = errorHandler { - throw try errorHandler(callStatus.errorBuf) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.unexpectedRustCallError - } - - case CALL_PANIC: - // When the rust code sees a panic, it tries to construct a RustBuffer - // with the message. But if that code panics, then it just sends back - // an empty buffer. - if callStatus.errorBuf.len > 0 { - throw try UniffiInternalError.rustPanic(FfiConverterString.lift(callStatus.errorBuf)) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.rustPanic("Rust panic") - } - - default: - throw UniffiInternalError.unexpectedRustCallStatusCode - } -} - -// Public interface members begin here. - -private struct FfiConverterUInt32: FfiConverterPrimitive { - typealias FfiType = UInt32 - typealias SwiftType = UInt32 - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 { - return try lift(readInt(&buf)) - } - - public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - writeInt(&buf, lower(value)) - } -} - -private struct FfiConverterString: FfiConverter { - typealias SwiftType = String - typealias FfiType = RustBuffer - - public static func lift(_ value: RustBuffer) throws -> String { - defer { - value.deallocate() - } - if value.data == nil { - return String() - } - let bytes = UnsafeBufferPointer(start: value.data!, count: Int(value.len)) - return String(bytes: bytes, encoding: String.Encoding.utf8)! - } - - public static func lower(_ value: String) -> RustBuffer { - return value.utf8CString.withUnsafeBufferPointer { ptr in - // The swift string gives us int8_t, we want uint8_t. - ptr.withMemoryRebound(to: UInt8.self) { ptr in - // The swift string gives us a trailing null byte, we don't want it. - let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1)) - return RustBuffer.from(buf) - } - } - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String { - let len: Int32 = try readInt(&buf) - return try String(bytes: readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! - } - - public static func write(_ value: String, into buf: inout [UInt8]) { - let len = Int32(value.utf8.count) - writeInt(&buf, len) - writeBytes(&buf, value.utf8) - } -} - -public func add(a: UInt32, b: UInt32) -> UInt32 { - return try! FfiConverterUInt32.lift( - try! rustCall { - uniffi_rust_uniffi_example_fn_func_add( - FfiConverterUInt32.lower(a), - FfiConverterUInt32.lower(b), $0 - ) - } - ) -} - -public func hello() -> String { - return try! FfiConverterString.lift( - try! rustCall { - uniffi_rust_uniffi_example_fn_func_hello($0) - } - ) -} - -private enum InitializationResult { - case ok - case contractVersionMismatch - case apiChecksumMismatch -} - -// Use a global variables to perform the versioning checks. Swift ensures that -// the code inside is only computed once. -private var initializationResult: InitializationResult { - // Get the bindings contract version from our ComponentInterface - let bindings_contract_version = 22 - // Get the scaffolding contract version by calling the into the dylib - let scaffolding_contract_version = ffi_rust_uniffi_example_uniffi_contract_version() - if bindings_contract_version != scaffolding_contract_version { - return InitializationResult.contractVersionMismatch - } - if uniffi_rust_uniffi_example_checksum_func_add() != 29339 { - return InitializationResult.apiChecksumMismatch - } - if uniffi_rust_uniffi_example_checksum_func_hello() != 61923 { - return InitializationResult.apiChecksumMismatch - } - - return InitializationResult.ok -} - -private func uniffiEnsureInitialized() { - switch initializationResult { - case .ok: - break - case .contractVersionMismatch: - fatalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") - case .apiChecksumMismatch: - fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } -} diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/Lib/headers/RustUniFFIExampleBindingsFFI.h b/rust-swift-spike/archive/ios-app/ExampleApp/Lib/headers/RustUniFFIExampleBindingsFFI.h deleted file mode 100644 index 4625ecb5..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/Lib/headers/RustUniFFIExampleBindingsFFI.h +++ /dev/null @@ -1,89 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! - -#pragma once - -#include -#include -#include - -// The following structs are used to implement the lowest level -// of the FFI, and thus useful to multiple uniffied crates. -// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. -#ifdef UNIFFI_SHARED_H - // We also try to prevent mixing versions of shared uniffi header structs. - // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 - #ifndef UNIFFI_SHARED_HEADER_V4 - #error Combining helper code from multiple versions of uniffi is not supported - #endif // ndef UNIFFI_SHARED_HEADER_V4 -#else -#define UNIFFI_SHARED_H -#define UNIFFI_SHARED_HEADER_V4 -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ - -typedef struct RustBuffer -{ - int32_t capacity; - int32_t len; - uint8_t *_Nullable data; -} RustBuffer; - -typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull); - -// Task defined in Rust that Swift executes -typedef void (*UniFfiRustTaskCallback)(const void * _Nullable); - -// Callback to execute Rust tasks using a Swift Task -// -// Args: -// executor: ForeignExecutor lowered into a size_t value -// delay: Delay in MS -// task: UniFfiRustTaskCallback to call -// task_data: data to pass the task callback -typedef void (*UniFfiForeignExecutorCallback)(size_t, uint32_t, UniFfiRustTaskCallback _Nullable, const void * _Nullable); - -typedef struct ForeignBytes -{ - int32_t len; - const uint8_t *_Nullable data; -} ForeignBytes; - -// Error definitions -typedef struct RustCallStatus { - int8_t code; - RustBuffer errorBuf; -} RustCallStatus; - -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ -#endif // def UNIFFI_SHARED_H - -// Callbacks for UniFFI Futures -typedef void (*UniFfiFutureCallbackUInt32)(const void * _Nonnull, uint32_t, RustCallStatus); -typedef void (*UniFfiFutureCallbackRustBuffer)(const void * _Nonnull, RustBuffer, RustCallStatus); - -// Scaffolding functions -uint32_t uniffi_rust_uniffi_example_fn_func_add(uint32_t a, uint32_t b, RustCallStatus *_Nonnull out_status -); -RustBuffer uniffi_rust_uniffi_example_fn_func_hello(RustCallStatus *_Nonnull out_status - -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status -); -void ffi_rust_uniffi_example_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status -); -uint16_t uniffi_rust_uniffi_example_checksum_func_add(void - -); -uint16_t uniffi_rust_uniffi_example_checksum_func_hello(void - -); -uint32_t ffi_rust_uniffi_example_uniffi_contract_version(void - -); - diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/Lib/headers/RustUniFFIExampleBindingsFFI.modulemap b/rust-swift-spike/archive/ios-app/ExampleApp/Lib/headers/RustUniFFIExampleBindingsFFI.modulemap deleted file mode 100644 index d5cfb9fd..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/Lib/headers/RustUniFFIExampleBindingsFFI.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! -module RustUniFFIExampleBindingsFFI { - header "RustUniFFIExampleBindingsFFI.h" - export * -} \ No newline at end of file diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/headers/RustUniFFIExampleBindingsFFI.h b/rust-swift-spike/archive/ios-app/ExampleApp/headers/RustUniFFIExampleBindingsFFI.h deleted file mode 100644 index 4625ecb5..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/headers/RustUniFFIExampleBindingsFFI.h +++ /dev/null @@ -1,89 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! - -#pragma once - -#include -#include -#include - -// The following structs are used to implement the lowest level -// of the FFI, and thus useful to multiple uniffied crates. -// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. -#ifdef UNIFFI_SHARED_H - // We also try to prevent mixing versions of shared uniffi header structs. - // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 - #ifndef UNIFFI_SHARED_HEADER_V4 - #error Combining helper code from multiple versions of uniffi is not supported - #endif // ndef UNIFFI_SHARED_HEADER_V4 -#else -#define UNIFFI_SHARED_H -#define UNIFFI_SHARED_HEADER_V4 -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ - -typedef struct RustBuffer -{ - int32_t capacity; - int32_t len; - uint8_t *_Nullable data; -} RustBuffer; - -typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull); - -// Task defined in Rust that Swift executes -typedef void (*UniFfiRustTaskCallback)(const void * _Nullable); - -// Callback to execute Rust tasks using a Swift Task -// -// Args: -// executor: ForeignExecutor lowered into a size_t value -// delay: Delay in MS -// task: UniFfiRustTaskCallback to call -// task_data: data to pass the task callback -typedef void (*UniFfiForeignExecutorCallback)(size_t, uint32_t, UniFfiRustTaskCallback _Nullable, const void * _Nullable); - -typedef struct ForeignBytes -{ - int32_t len; - const uint8_t *_Nullable data; -} ForeignBytes; - -// Error definitions -typedef struct RustCallStatus { - int8_t code; - RustBuffer errorBuf; -} RustCallStatus; - -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ -#endif // def UNIFFI_SHARED_H - -// Callbacks for UniFFI Futures -typedef void (*UniFfiFutureCallbackUInt32)(const void * _Nonnull, uint32_t, RustCallStatus); -typedef void (*UniFfiFutureCallbackRustBuffer)(const void * _Nonnull, RustBuffer, RustCallStatus); - -// Scaffolding functions -uint32_t uniffi_rust_uniffi_example_fn_func_add(uint32_t a, uint32_t b, RustCallStatus *_Nonnull out_status -); -RustBuffer uniffi_rust_uniffi_example_fn_func_hello(RustCallStatus *_Nonnull out_status - -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status -); -void ffi_rust_uniffi_example_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status -); -uint16_t uniffi_rust_uniffi_example_checksum_func_add(void - -); -uint16_t uniffi_rust_uniffi_example_checksum_func_hello(void - -); -uint32_t ffi_rust_uniffi_example_uniffi_contract_version(void - -); - diff --git a/rust-swift-spike/archive/ios-app/ExampleApp/headers/RustUniFFIExampleBindingsFFI.modulemap b/rust-swift-spike/archive/ios-app/ExampleApp/headers/RustUniFFIExampleBindingsFFI.modulemap deleted file mode 100644 index d5cfb9fd..00000000 --- a/rust-swift-spike/archive/ios-app/ExampleApp/headers/RustUniFFIExampleBindingsFFI.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! -module RustUniFFIExampleBindingsFFI { - header "RustUniFFIExampleBindingsFFI.h" - export * -} \ No newline at end of file diff --git a/rust-swift-spike/archive/munchausen-numbers/Cargo.toml b/rust-swift-spike/archive/munchausen-numbers/Cargo.toml deleted file mode 100644 index 4a83853a..00000000 --- a/rust-swift-spike/archive/munchausen-numbers/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "munchausen" -version = "0.1.0" -edition = "2021" -crate-type = ["staticlib"] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/rust-swift-spike/archive/munchausen-numbers/include/module.modulemap b/rust-swift-spike/archive/munchausen-numbers/include/module.modulemap deleted file mode 100644 index 48921893..00000000 --- a/rust-swift-spike/archive/munchausen-numbers/include/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -module Munchausen { - header "munchausen.h" - export * -} \ No newline at end of file diff --git a/rust-swift-spike/archive/munchausen-numbers/include/munchausen.h b/rust-swift-spike/archive/munchausen-numbers/include/munchausen.h deleted file mode 100644 index da2dc3c2..00000000 --- a/rust-swift-spike/archive/munchausen-numbers/include/munchausen.h +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include -#include -#include - -int32_t (*rust_munchausen_numbers(void))[4]; diff --git a/rust-swift-spike/archive/munchausen-numbers/src/lib.rs b/rust-swift-spike/archive/munchausen-numbers/src/lib.rs deleted file mode 100644 index 55cb72b0..00000000 --- a/rust-swift-spike/archive/munchausen-numbers/src/lib.rs +++ /dev/null @@ -1,68 +0,0 @@ -#[no_mangle] -pub extern "C" fn rust_munchausen_numbers() -> *mut [i32; 4] { - // Pre-caching the power for all of the digits; 0⁰ is initially in the cache array. - let mut cache = [0; 10]; - let mut index = 0; - let mut munchausen_num: [i32; 4] = [0; 4]; - let munchausen_num_ptr: *mut [i32; 4] = &mut munchausen_num; - - for n in 1..=9 { - cache[n] = (n as i32).pow(n as u32); - } - - // Searching for Munchausen numbers iterating through a long range containing all of them. - for n in 0..500000000 { - if is_munchausen_number(n, &cache) { - munchausen_num[index] = n; - index += 1; - } - } - - munchausen_num_ptr -} - -fn is_munchausen_number(number: i32, cache: &[i32; 10]) -> bool { - let mut current_number = number; - let mut sum = 0; - - // The calculation details: Do until we go through all of the digits. - while current_number > 0 { - // Take the last digit of a number. - let digit = current_number % 10; - // Add the cached power of the digit to the overall sum. - sum += cache[digit as usize]; - - if sum > number { - return false; - } - // "Cut" the last digit - current_number /= 10; - } - - number == sum -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_munchausen_numbers() { - let mut cache = [0; 10]; - let mut index = 0; - let mut munchausen_num: [i32; 4] = [0; 4]; - - for n in 1..=9 { - cache[n] = (n as i32).pow(n as u32); - } - - for n in 0..500000000 { - if is_munchausen_number(n, &cache) { - munchausen_num[index] = n; - index += 1; - } - } - - assert_eq!(munchausen_num, [0, 1, 3435, 438579088]); - } -} diff --git a/rust-swift-spike/ios-app/FooBar/.gitignore b/rust-swift-spike/ios-app/FooBar/.gitignore deleted file mode 100644 index 919390f3..00000000 --- a/rust-swift-spike/ios-app/FooBar/.gitignore +++ /dev/null @@ -1,94 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## User settings -xcuserdata/ - -## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) -*.xcscmblueprint -*.xccheckout - -## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) -build/ -DerivedData/ -*.moved-aside -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 - -## Obj-C/Swift specific -*.hmap - -## App packaging -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -# *.xcodeproj -# -# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata -# hence it is not needed unless you have added a package configuration file to your project -# .swiftpm - -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ -# -# Add this line if you want to avoid checking in source code from the Xcode workspace -# *.xcworkspace - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build/ - -# Accio dependency management -Dependencies/ -.accio/ - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. -# Instead, use fastlane to re-generate the screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots/**/*.png -fastlane/test_output - -# Code Injection -# -# After new code Injection tools there's a generated folder /iOSInjectionProject -# https://github.com/johnno1962/injectionforxcode - -iOSInjectionProject/ - - -# Ignore big static library for now -librust_uniffi_example.a diff --git a/rust-swift-spike/ios-app/FooBar/FooBar-Bridging-Header.h b/rust-swift-spike/ios-app/FooBar/FooBar-Bridging-Header.h deleted file mode 100644 index c6700ec8..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar-Bridging-Header.h +++ /dev/null @@ -1,11 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -#ifndef IOSApp_Bridging_Header_h -#define IOSApp_Bridging_Header_h - -#import "RustUniFFIExampleFFI.h" - -#endif /* FooBar_Bridging_Header_h */ diff --git a/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.pbxproj b/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.pbxproj deleted file mode 100644 index 1e6d714d..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.pbxproj +++ /dev/null @@ -1,668 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 56; - objects = { - -/* Begin PBXBuildFile section */ - CE3A9C3D2AA1E98D00EE36D7 /* FooBarApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE3A9C3C2AA1E98D00EE36D7 /* FooBarApp.swift */; }; - CE3A9C3F2AA1E98D00EE36D7 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE3A9C3E2AA1E98D00EE36D7 /* ContentView.swift */; }; - CE3A9C412AA1E98E00EE36D7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE3A9C402AA1E98E00EE36D7 /* Assets.xcassets */; }; - CE3A9C442AA1E98E00EE36D7 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE3A9C432AA1E98E00EE36D7 /* Preview Assets.xcassets */; }; - CE3A9C4E2AA1E98E00EE36D7 /* FooBarTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE3A9C4D2AA1E98E00EE36D7 /* FooBarTests.swift */; }; - CE3A9C582AA1E98E00EE36D7 /* FooBarUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE3A9C572AA1E98E00EE36D7 /* FooBarUITests.swift */; }; - CE3A9C5A2AA1E98E00EE36D7 /* FooBarUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE3A9C592AA1E98E00EE36D7 /* FooBarUITestsLaunchTests.swift */; }; - CE6AF1CA2AA2152C00B6B55E /* RustUniFFIExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6AF1C82AA2152C00B6B55E /* RustUniFFIExample.swift */; }; - CE6AF1D32AA2EA5E00B6B55E /* librust_uniffi_example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE6AF1D22AA2EA5E00B6B55E /* librust_uniffi_example.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXBuildRule section */ - CE3A9C672AA1ECEE00EE36D7 /* PBXBuildRule */ = { - isa = PBXBuildRule; - compilerSpec = com.apple.compilers.proxy.script; - filePatterns = "*.udl"; - fileType = pattern.proxy; - inputFiles = ( - ); - isEditable = 1; - outputFiles = ( - "$(SRCROOT)/Generated/$(INPUT_FILE_BASE).swift", - "$(SRCROOT)/Generated/$(INPUT_FILE_BASE)FFI.h", - ); - script = "# Generate swift bindings for the rust-uniffi-example library.\necho \"Generating files for $INPUT_FILE_PATH\"\nINPUT_FILE_PATH=\"../../rust-uniffi-example\"\n\n# Assume in $PATH\nuniffi-bindgen generate \\ \"$INPUT_FILE_PATH/src/rust_uniffi_example.udl\" --language swift --out-dir $\"SRCROOT/Generated\"\n"; - }; -/* End PBXBuildRule section */ - -/* Begin PBXContainerItemProxy section */ - CE3A9C4A2AA1E98E00EE36D7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = CE3A9C312AA1E98D00EE36D7 /* Project object */; - proxyType = 1; - remoteGlobalIDString = CE3A9C382AA1E98D00EE36D7; - remoteInfo = FooBar; - }; - CE3A9C542AA1E98E00EE36D7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = CE3A9C312AA1E98D00EE36D7 /* Project object */; - proxyType = 1; - remoteGlobalIDString = CE3A9C382AA1E98D00EE36D7; - remoteInfo = FooBar; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - CE3A9C392AA1E98D00EE36D7 /* FooBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FooBar.app; sourceTree = BUILT_PRODUCTS_DIR; }; - CE3A9C3C2AA1E98D00EE36D7 /* FooBarApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooBarApp.swift; sourceTree = ""; }; - CE3A9C3E2AA1E98D00EE36D7 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - CE3A9C402AA1E98E00EE36D7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - CE3A9C432AA1E98E00EE36D7 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - CE3A9C492AA1E98E00EE36D7 /* FooBarTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FooBarTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - CE3A9C4D2AA1E98E00EE36D7 /* FooBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooBarTests.swift; sourceTree = ""; }; - CE3A9C532AA1E98E00EE36D7 /* FooBarUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FooBarUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - CE3A9C572AA1E98E00EE36D7 /* FooBarUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooBarUITests.swift; sourceTree = ""; }; - CE3A9C592AA1E98E00EE36D7 /* FooBarUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooBarUITestsLaunchTests.swift; sourceTree = ""; }; - CE6AF1B92AA1EF9300B6B55E /* FooBar-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FooBar-Bridging-Header.h"; sourceTree = ""; }; - CE6AF1BB2AA1FFEB00B6B55E /* rust_uniffi_example.udl */ = {isa = PBXFileReference; lastKnownFileType = text; name = rust_uniffi_example.udl; path = "../../rust-uniffi-example/src/rust_uniffi_example.udl"; sourceTree = ""; }; - CE6AF1C72AA2152C00B6B55E /* RustUniFFIExampleFFI.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = RustUniFFIExampleFFI.modulemap; sourceTree = ""; }; - CE6AF1C82AA2152C00B6B55E /* RustUniFFIExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RustUniFFIExample.swift; sourceTree = ""; }; - CE6AF1C92AA2152C00B6B55E /* RustUniFFIExampleFFI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RustUniFFIExampleFFI.h; sourceTree = ""; }; - CE6AF1D22AA2EA5E00B6B55E /* librust_uniffi_example.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = librust_uniffi_example.a; path = "../../../rust-uniffi-example/target/ios-combined/librust_uniffi_example.a"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - CE3A9C362AA1E98D00EE36D7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - CE6AF1D32AA2EA5E00B6B55E /* librust_uniffi_example.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE3A9C462AA1E98E00EE36D7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE3A9C502AA1E98E00EE36D7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - CE3A9C302AA1E98D00EE36D7 = { - isa = PBXGroup; - children = ( - CE6AF1D12AA2EA4100B6B55E /* Frameworks */, - CE6AF1C62AA2152C00B6B55E /* Generated */, - CE6AF1BB2AA1FFEB00B6B55E /* rust_uniffi_example.udl */, - CE6AF1B92AA1EF9300B6B55E /* FooBar-Bridging-Header.h */, - CE3A9C3B2AA1E98D00EE36D7 /* FooBar */, - CE3A9C4C2AA1E98E00EE36D7 /* FooBarTests */, - CE3A9C562AA1E98E00EE36D7 /* FooBarUITests */, - CE3A9C3A2AA1E98D00EE36D7 /* Products */, - ); - sourceTree = ""; - }; - CE3A9C3A2AA1E98D00EE36D7 /* Products */ = { - isa = PBXGroup; - children = ( - CE3A9C392AA1E98D00EE36D7 /* FooBar.app */, - CE3A9C492AA1E98E00EE36D7 /* FooBarTests.xctest */, - CE3A9C532AA1E98E00EE36D7 /* FooBarUITests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - CE3A9C3B2AA1E98D00EE36D7 /* FooBar */ = { - isa = PBXGroup; - children = ( - CE3A9C3C2AA1E98D00EE36D7 /* FooBarApp.swift */, - CE3A9C3E2AA1E98D00EE36D7 /* ContentView.swift */, - CE3A9C402AA1E98E00EE36D7 /* Assets.xcassets */, - CE3A9C422AA1E98E00EE36D7 /* Preview Content */, - ); - path = FooBar; - sourceTree = ""; - }; - CE3A9C422AA1E98E00EE36D7 /* Preview Content */ = { - isa = PBXGroup; - children = ( - CE3A9C432AA1E98E00EE36D7 /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; - CE3A9C4C2AA1E98E00EE36D7 /* FooBarTests */ = { - isa = PBXGroup; - children = ( - CE3A9C4D2AA1E98E00EE36D7 /* FooBarTests.swift */, - ); - path = FooBarTests; - sourceTree = ""; - }; - CE3A9C562AA1E98E00EE36D7 /* FooBarUITests */ = { - isa = PBXGroup; - children = ( - CE3A9C572AA1E98E00EE36D7 /* FooBarUITests.swift */, - CE3A9C592AA1E98E00EE36D7 /* FooBarUITestsLaunchTests.swift */, - ); - path = FooBarUITests; - sourceTree = ""; - }; - CE6AF1C62AA2152C00B6B55E /* Generated */ = { - isa = PBXGroup; - children = ( - CE6AF1C72AA2152C00B6B55E /* RustUniFFIExampleFFI.modulemap */, - CE6AF1C82AA2152C00B6B55E /* RustUniFFIExample.swift */, - CE6AF1C92AA2152C00B6B55E /* RustUniFFIExampleFFI.h */, - ); - path = Generated; - sourceTree = ""; - }; - CE6AF1D12AA2EA4100B6B55E /* Frameworks */ = { - isa = PBXGroup; - children = ( - CE6AF1D22AA2EA5E00B6B55E /* librust_uniffi_example.a */, - ); - path = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - CE3A9C382AA1E98D00EE36D7 /* FooBar */ = { - isa = PBXNativeTarget; - buildConfigurationList = CE3A9C5D2AA1E98E00EE36D7 /* Build configuration list for PBXNativeTarget "FooBar" */; - buildPhases = ( - CE6AF1BA2AA1FAE600B6B55E /* Build Universal Binary for rust-uniffi-example */, - CE3A9C352AA1E98D00EE36D7 /* Sources */, - CE3A9C362AA1E98D00EE36D7 /* Frameworks */, - CE3A9C372AA1E98D00EE36D7 /* Resources */, - ); - buildRules = ( - CE3A9C672AA1ECEE00EE36D7 /* PBXBuildRule */, - ); - dependencies = ( - ); - name = FooBar; - productName = FooBar; - productReference = CE3A9C392AA1E98D00EE36D7 /* FooBar.app */; - productType = "com.apple.product-type.application"; - }; - CE3A9C482AA1E98E00EE36D7 /* FooBarTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = CE3A9C602AA1E98E00EE36D7 /* Build configuration list for PBXNativeTarget "FooBarTests" */; - buildPhases = ( - CE3A9C452AA1E98E00EE36D7 /* Sources */, - CE3A9C462AA1E98E00EE36D7 /* Frameworks */, - CE3A9C472AA1E98E00EE36D7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - CE3A9C4B2AA1E98E00EE36D7 /* PBXTargetDependency */, - ); - name = FooBarTests; - productName = FooBarTests; - productReference = CE3A9C492AA1E98E00EE36D7 /* FooBarTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - CE3A9C522AA1E98E00EE36D7 /* FooBarUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = CE3A9C632AA1E98E00EE36D7 /* Build configuration list for PBXNativeTarget "FooBarUITests" */; - buildPhases = ( - CE3A9C4F2AA1E98E00EE36D7 /* Sources */, - CE3A9C502AA1E98E00EE36D7 /* Frameworks */, - CE3A9C512AA1E98E00EE36D7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - CE3A9C552AA1E98E00EE36D7 /* PBXTargetDependency */, - ); - name = FooBarUITests; - productName = FooBarUITests; - productReference = CE3A9C532AA1E98E00EE36D7 /* FooBarUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - CE3A9C312AA1E98D00EE36D7 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1430; - LastUpgradeCheck = 1430; - TargetAttributes = { - CE3A9C382AA1E98D00EE36D7 = { - CreatedOnToolsVersion = 14.3.1; - }; - CE3A9C482AA1E98E00EE36D7 = { - CreatedOnToolsVersion = 14.3.1; - TestTargetID = CE3A9C382AA1E98D00EE36D7; - }; - CE3A9C522AA1E98E00EE36D7 = { - CreatedOnToolsVersion = 14.3.1; - TestTargetID = CE3A9C382AA1E98D00EE36D7; - }; - }; - }; - buildConfigurationList = CE3A9C342AA1E98D00EE36D7 /* Build configuration list for PBXProject "FooBar" */; - compatibilityVersion = "Xcode 14.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = CE3A9C302AA1E98D00EE36D7; - productRefGroup = CE3A9C3A2AA1E98D00EE36D7 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - CE3A9C382AA1E98D00EE36D7 /* FooBar */, - CE3A9C482AA1E98E00EE36D7 /* FooBarTests */, - CE3A9C522AA1E98E00EE36D7 /* FooBarUITests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - CE3A9C372AA1E98D00EE36D7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CE3A9C442AA1E98E00EE36D7 /* Preview Assets.xcassets in Resources */, - CE3A9C412AA1E98E00EE36D7 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE3A9C472AA1E98E00EE36D7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE3A9C512AA1E98E00EE36D7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - CE6AF1BA2AA1FAE600B6B55E /* Build Universal Binary for rust-uniffi-example */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Build Universal Binary for rust-uniffi-example"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "set -x\n\necho $CONFIGURATION\necho $SRCROOT\nbash $SRCROOT/xc-universal-binary.sh rust-uniffi-example $SRCROOT/../../rust-uniffi-example $CONFIGURATION\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - CE3A9C352AA1E98D00EE36D7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CE3A9C3F2AA1E98D00EE36D7 /* ContentView.swift in Sources */, - CE6AF1CA2AA2152C00B6B55E /* RustUniFFIExample.swift in Sources */, - CE3A9C3D2AA1E98D00EE36D7 /* FooBarApp.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE3A9C452AA1E98E00EE36D7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CE3A9C4E2AA1E98E00EE36D7 /* FooBarTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CE3A9C4F2AA1E98E00EE36D7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CE3A9C582AA1E98E00EE36D7 /* FooBarUITests.swift in Sources */, - CE3A9C5A2AA1E98E00EE36D7 /* FooBarUITestsLaunchTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - CE3A9C4B2AA1E98E00EE36D7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = CE3A9C382AA1E98D00EE36D7 /* FooBar */; - targetProxy = CE3A9C4A2AA1E98E00EE36D7 /* PBXContainerItemProxy */; - }; - CE3A9C552AA1E98E00EE36D7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = CE3A9C382AA1E98D00EE36D7 /* FooBar */; - targetProxy = CE3A9C542AA1E98E00EE36D7 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - CE3A9C5B2AA1E98E00EE36D7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - CE3A9C5C2AA1E98E00EE36D7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - CE3A9C5E2AA1E98E00EE36D7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"FooBar/Preview Content\""; - DEVELOPMENT_TEAM = 2699K68G5P; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - "LIBRARY_SEARCH_PATHS[sdk=iphoneos*][arch=arm64]" = "../../rust-uniffi-example/target/aarch64-apple-ios/debug"; - "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=arm64]" = "../../rust-uniffi-example/target/aarch64-apple-ios-sim/debug"; - "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=x86_64]" = "../../rust-uniffi-example/target/x86_64-apple-ios/debug"; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.foobar23412123.FooBar; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OBJC_BRIDGING_HEADER = "FooBar-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - CE3A9C5F2AA1E98E00EE36D7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"FooBar/Preview Content\""; - DEVELOPMENT_TEAM = 2699K68G5P; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - "LIBRARY_SEARCH_PATHS[sdk=iphoneos*][arch=arm64]" = "../../rust-uniffi-example/target/aarch64-apple-ios/release"; - "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=arm64]" = "../../rust-uniffi-example/target/aarch64-apple-ios-sim/release"; - "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=x86_64]" = "../../rust-uniffi-example/target/x86_64-apple-ios/release"; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.foobar23412123.FooBar; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OBJC_BRIDGING_HEADER = "FooBar-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - CE3A9C612AA1E98E00EE36D7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2699K68G5P; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.foobar23412123.FooBarTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FooBar.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/FooBar"; - }; - name = Debug; - }; - CE3A9C622AA1E98E00EE36D7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2699K68G5P; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.foobar23412123.FooBarTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FooBar.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/FooBar"; - }; - name = Release; - }; - CE3A9C642AA1E98E00EE36D7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2699K68G5P; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.foobar23412123.FooBarUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = FooBar; - }; - name = Debug; - }; - CE3A9C652AA1E98E00EE36D7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2699K68G5P; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.foobar23412123.FooBarUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = FooBar; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - CE3A9C342AA1E98D00EE36D7 /* Build configuration list for PBXProject "FooBar" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CE3A9C5B2AA1E98E00EE36D7 /* Debug */, - CE3A9C5C2AA1E98E00EE36D7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CE3A9C5D2AA1E98E00EE36D7 /* Build configuration list for PBXNativeTarget "FooBar" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CE3A9C5E2AA1E98E00EE36D7 /* Debug */, - CE3A9C5F2AA1E98E00EE36D7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CE3A9C602AA1E98E00EE36D7 /* Build configuration list for PBXNativeTarget "FooBarTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CE3A9C612AA1E98E00EE36D7 /* Debug */, - CE3A9C622AA1E98E00EE36D7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CE3A9C632AA1E98E00EE36D7 /* Build configuration list for PBXNativeTarget "FooBarUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CE3A9C642AA1E98E00EE36D7 /* Debug */, - CE3A9C652AA1E98E00EE36D7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = CE3A9C312AA1E98D00EE36D7 /* Project object */; -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/AccentColor.colorset/Contents.json b/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb878970..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/AppIcon.appiconset/Contents.json b/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 13613e3e..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/Contents.json b/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBar/ContentView.swift b/rust-swift-spike/ios-app/FooBar/FooBar/ContentView.swift deleted file mode 100644 index 79c34bf2..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar/ContentView.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// ContentView.swift -// FooBar -// -// Created by User Name on 9/1/23. -// - -import SwiftUI - -struct ContentView: View { - let greeting: String = hello() - let sum: UInt32 = add(a: 5, b: 3) - - - var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundColor(.accentColor) - Text("Hello, world!") - Text(greeting) - Text("5 + 3 = \(sum)") - } - .padding() - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBar/FooBarApp.swift b/rust-swift-spike/ios-app/FooBar/FooBar/FooBarApp.swift deleted file mode 100644 index 00f99a6a..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar/FooBarApp.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// FooBarApp.swift -// FooBar -// -// Created by User Name on 9/1/23. -// - -import SwiftUI - -@main -struct FooBarApp: App { - var body: some Scene { - WindowGroup { - ContentView() - } - } -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBar/Preview Content/Preview Assets.xcassets/Contents.json b/rust-swift-spike/ios-app/FooBar/FooBar/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBar/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBarTests/FooBarTests.swift b/rust-swift-spike/ios-app/FooBar/FooBarTests/FooBarTests.swift deleted file mode 100644 index 5d591df5..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBarTests/FooBarTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// FooBarTests.swift -// FooBarTests -// -// Created by User Name on 9/1/23. -// - -import XCTest -@testable import FooBar - -final class FooBarTests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - // Any test you write for XCTest can be annotated as throws and async. - // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. - // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. - } - - func testPerformanceExample() throws { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBarUITests/FooBarUITests.swift b/rust-swift-spike/ios-app/FooBar/FooBarUITests/FooBarUITests.swift deleted file mode 100644 index 68b03438..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBarUITests/FooBarUITests.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// FooBarUITests.swift -// FooBarUITests -// -// Created by User Name on 9/1/23. -// - -import XCTest - -final class FooBarUITests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // UI tests must launch the application that they test. - let app = XCUIApplication() - app.launch() - - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testLaunchPerformance() throws { - if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { - // This measures how long it takes to launch your application. - measure(metrics: [XCTApplicationLaunchMetric()]) { - XCUIApplication().launch() - } - } - } -} diff --git a/rust-swift-spike/ios-app/FooBar/FooBarUITests/FooBarUITestsLaunchTests.swift b/rust-swift-spike/ios-app/FooBar/FooBarUITests/FooBarUITestsLaunchTests.swift deleted file mode 100644 index 2e8db3bc..00000000 --- a/rust-swift-spike/ios-app/FooBar/FooBarUITests/FooBarUITestsLaunchTests.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// FooBarUITestsLaunchTests.swift -// FooBarUITests -// -// Created by User Name on 9/1/23. -// - -import XCTest - -final class FooBarUITestsLaunchTests: XCTestCase { - - override class var runsForEachTargetApplicationUIConfiguration: Bool { - true - } - - override func setUpWithError() throws { - continueAfterFailure = false - } - - func testLaunch() throws { - let app = XCUIApplication() - app.launch() - - // Insert steps here to perform after app launch but before taking a screenshot, - // such as logging into a test account or navigating somewhere in the app - - let attachment = XCTAttachment(screenshot: app.screenshot()) - attachment.name = "Launch Screen" - attachment.lifetime = .keepAlways - add(attachment) - } -} diff --git a/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExample.swift b/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExample.swift deleted file mode 100644 index 011b99c6..00000000 --- a/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExample.swift +++ /dev/null @@ -1,402 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! -import Foundation - -// Depending on the consumer's build setup, the low-level FFI code -// might be in a separate module, or it might be compiled inline into -// this module. This is a bit of light hackery to work with both. -#if canImport(RustUniFFIExampleFFI) - import RustUniFFIExampleFFI -#endif - -private extension RustBuffer { - // Allocate a new buffer, copying the contents of a `UInt8` array. - init(bytes: [UInt8]) { - let rbuf = bytes.withUnsafeBufferPointer { ptr in - RustBuffer.from(ptr) - } - self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data) - } - - static func from(_ ptr: UnsafeBufferPointer) -> RustBuffer { - try! rustCall { ffi_rust_uniffi_example_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } - } - - // Frees the buffer in place. - // The buffer must not be used after this is called. - func deallocate() { - try! rustCall { ffi_rust_uniffi_example_rustbuffer_free(self, $0) } - } -} - -private extension ForeignBytes { - init(bufferPointer: UnsafeBufferPointer) { - self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress) - } -} - -// For every type used in the interface, we provide helper methods for conveniently -// lifting and lowering that type from C-compatible data, and for reading and writing -// values of that type in a buffer. - -// Helper classes/extensions that don't change. -// Someday, this will be in a library of its own. - -private extension Data { - init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) - } -} - -// Define reader functionality. Normally this would be defined in a class or -// struct, but we use standalone functions instead in order to make external -// types work. -// -// With external types, one swift source file needs to be able to call the read -// method on another source file's FfiConverter, but then what visibility -// should Reader have? -// - If Reader is fileprivate, then this means the read() must also -// be fileprivate, which doesn't work with external types. -// - If Reader is internal/public, we'll get compile errors since both source -// files will try define the same type. -// -// Instead, the read() method and these helper functions input a tuple of data - -private func createReader(data: Data) -> (data: Data, offset: Data.Index) { - (data: data, offset: 0) -} - -// Reads an integer at the current offset, in big-endian order, and advances -// the offset on success. Throws if reading the integer would move the -// offset past the end of the buffer. -private func readInt(_ reader: inout (data: Data, offset: Data.Index)) throws -> T { - let range = reader.offset ..< reader.offset + MemoryLayout.size - guard reader.data.count >= range.upperBound else { - throw UniffiInternalError.bufferOverflow - } - if T.self == UInt8.self { - let value = reader.data[reader.offset] - reader.offset += 1 - return value as! T - } - var value: T = 0 - let _ = withUnsafeMutableBytes(of: &value) { reader.data.copyBytes(to: $0, from: range) } - reader.offset = range.upperBound - return value.bigEndian -} - -// Reads an arbitrary number of bytes, to be used to read -// raw bytes, this is useful when lifting strings -private func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> [UInt8] { - let range = reader.offset ..< (reader.offset + count) - guard reader.data.count >= range.upperBound else { - throw UniffiInternalError.bufferOverflow - } - var value = [UInt8](repeating: 0, count: count) - value.withUnsafeMutableBufferPointer { buffer in - reader.data.copyBytes(to: buffer, from: range) - } - reader.offset = range.upperBound - return value -} - -// Reads a float at the current offset. -private func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { - return try Float(bitPattern: readInt(&reader)) -} - -// Reads a float at the current offset. -private func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { - return try Double(bitPattern: readInt(&reader)) -} - -// Indicates if the offset has reached the end of the buffer. -private func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool { - return reader.offset < reader.data.count -} - -// Define writer functionality. Normally this would be defined in a class or -// struct, but we use standalone functions instead in order to make external -// types work. See the above discussion on Readers for details. - -private func createWriter() -> [UInt8] { - return [] -} - -private func writeBytes(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 { - writer.append(contentsOf: byteArr) -} - -// Writes an integer in big-endian order. -// -// Warning: make sure what you are trying to write -// is in the correct type! -private func writeInt(_ writer: inout [UInt8], _ value: T) { - var value = value.bigEndian - withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) } -} - -private func writeFloat(_ writer: inout [UInt8], _ value: Float) { - writeInt(&writer, value.bitPattern) -} - -private func writeDouble(_ writer: inout [UInt8], _ value: Double) { - writeInt(&writer, value.bitPattern) -} - -// Protocol for types that transfer other types across the FFI. This is -// analogous go the Rust trait of the same name. -private protocol FfiConverter { - associatedtype FfiType - associatedtype SwiftType - - static func lift(_ value: FfiType) throws -> SwiftType - static func lower(_ value: SwiftType) -> FfiType - static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType - static func write(_ value: SwiftType, into buf: inout [UInt8]) -} - -// Types conforming to `Primitive` pass themselves directly over the FFI. -private protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType {} - -extension FfiConverterPrimitive { - public static func lift(_ value: FfiType) throws -> SwiftType { - return value - } - - public static func lower(_ value: SwiftType) -> FfiType { - return value - } -} - -// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`. -// Used for complex types where it's hard to write a custom lift/lower. -private protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} - -extension FfiConverterRustBuffer { - public static func lift(_ buf: RustBuffer) throws -> SwiftType { - var reader = createReader(data: Data(rustBuffer: buf)) - let value = try read(from: &reader) - if hasRemaining(reader) { - throw UniffiInternalError.incompleteData - } - buf.deallocate() - return value - } - - public static func lower(_ value: SwiftType) -> RustBuffer { - var writer = createWriter() - write(value, into: &writer) - return RustBuffer(bytes: writer) - } -} - -// An error type for FFI errors. These errors occur at the UniFFI level, not -// the library level. -private enum UniffiInternalError: LocalizedError { - case bufferOverflow - case incompleteData - case unexpectedOptionalTag - case unexpectedEnumCase - case unexpectedNullPointer - case unexpectedRustCallStatusCode - case unexpectedRustCallError - case unexpectedStaleHandle - case rustPanic(_ message: String) - - public var errorDescription: String? { - switch self { - case .bufferOverflow: return "Reading the requested value would read past the end of the buffer" - case .incompleteData: return "The buffer still has data after lifting its containing value" - case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1" - case .unexpectedEnumCase: return "Raw enum value doesn't match any cases" - case .unexpectedNullPointer: return "Raw pointer value was null" - case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code" - case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified" - case .unexpectedStaleHandle: return "The object in the handle map has been dropped already" - case let .rustPanic(message): return message - } - } -} - -private let CALL_SUCCESS: Int8 = 0 -private let CALL_ERROR: Int8 = 1 -private let CALL_PANIC: Int8 = 2 - -private extension RustCallStatus { - init() { - self.init( - code: CALL_SUCCESS, - errorBuf: RustBuffer( - capacity: 0, - len: 0, - data: nil - ) - ) - } -} - -private func rustCall(_ callback: (UnsafeMutablePointer) -> T) throws -> T { - try makeRustCall(callback, errorHandler: nil) -} - -private func rustCallWithError( - _ errorHandler: @escaping (RustBuffer) throws -> Error, - _ callback: (UnsafeMutablePointer) -> T -) throws -> T { - try makeRustCall(callback, errorHandler: errorHandler) -} - -private func makeRustCall( - _ callback: (UnsafeMutablePointer) -> T, - errorHandler: ((RustBuffer) throws -> Error)? -) throws -> T { - uniffiEnsureInitialized() - var callStatus = RustCallStatus() - let returnedVal = callback(&callStatus) - try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler) - return returnedVal -} - -private func uniffiCheckCallStatus( - callStatus: RustCallStatus, - errorHandler: ((RustBuffer) throws -> Error)? -) throws { - switch callStatus.code { - case CALL_SUCCESS: - return - - case CALL_ERROR: - if let errorHandler = errorHandler { - throw try errorHandler(callStatus.errorBuf) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.unexpectedRustCallError - } - - case CALL_PANIC: - // When the rust code sees a panic, it tries to construct a RustBuffer - // with the message. But if that code panics, then it just sends back - // an empty buffer. - if callStatus.errorBuf.len > 0 { - throw try UniffiInternalError.rustPanic(FfiConverterString.lift(callStatus.errorBuf)) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.rustPanic("Rust panic") - } - - default: - throw UniffiInternalError.unexpectedRustCallStatusCode - } -} - -// Public interface members begin here. - -private struct FfiConverterUInt32: FfiConverterPrimitive { - typealias FfiType = UInt32 - typealias SwiftType = UInt32 - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 { - return try lift(readInt(&buf)) - } - - public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - writeInt(&buf, lower(value)) - } -} - -private struct FfiConverterString: FfiConverter { - typealias SwiftType = String - typealias FfiType = RustBuffer - - public static func lift(_ value: RustBuffer) throws -> String { - defer { - value.deallocate() - } - if value.data == nil { - return String() - } - let bytes = UnsafeBufferPointer(start: value.data!, count: Int(value.len)) - return String(bytes: bytes, encoding: String.Encoding.utf8)! - } - - public static func lower(_ value: String) -> RustBuffer { - return value.utf8CString.withUnsafeBufferPointer { ptr in - // The swift string gives us int8_t, we want uint8_t. - ptr.withMemoryRebound(to: UInt8.self) { ptr in - // The swift string gives us a trailing null byte, we don't want it. - let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1)) - return RustBuffer.from(buf) - } - } - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String { - let len: Int32 = try readInt(&buf) - return try String(bytes: readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! - } - - public static func write(_ value: String, into buf: inout [UInt8]) { - let len = Int32(value.utf8.count) - writeInt(&buf, len) - writeBytes(&buf, value.utf8) - } -} - -public func add(a: UInt32, b: UInt32) -> UInt32 { - return try! FfiConverterUInt32.lift( - try! rustCall { - uniffi_rust_uniffi_example_fn_func_add( - FfiConverterUInt32.lower(a), - FfiConverterUInt32.lower(b), $0 - ) - } - ) -} - -public func hello() -> String { - return try! FfiConverterString.lift( - try! rustCall { - uniffi_rust_uniffi_example_fn_func_hello($0) - } - ) -} - -private enum InitializationResult { - case ok - case contractVersionMismatch - case apiChecksumMismatch -} - -// Use a global variables to perform the versioning checks. Swift ensures that -// the code inside is only computed once. -private var initializationResult: InitializationResult { - // Get the bindings contract version from our ComponentInterface - let bindings_contract_version = 22 - // Get the scaffolding contract version by calling the into the dylib - let scaffolding_contract_version = ffi_rust_uniffi_example_uniffi_contract_version() - if bindings_contract_version != scaffolding_contract_version { - return InitializationResult.contractVersionMismatch - } - if uniffi_rust_uniffi_example_checksum_func_add() != 29339 { - return InitializationResult.apiChecksumMismatch - } - if uniffi_rust_uniffi_example_checksum_func_hello() != 61923 { - return InitializationResult.apiChecksumMismatch - } - - return InitializationResult.ok -} - -private func uniffiEnsureInitialized() { - switch initializationResult { - case .ok: - break - case .contractVersionMismatch: - fatalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") - case .apiChecksumMismatch: - fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } -} diff --git a/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExampleFFI.h b/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExampleFFI.h deleted file mode 100644 index 4625ecb5..00000000 --- a/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExampleFFI.h +++ /dev/null @@ -1,89 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! - -#pragma once - -#include -#include -#include - -// The following structs are used to implement the lowest level -// of the FFI, and thus useful to multiple uniffied crates. -// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. -#ifdef UNIFFI_SHARED_H - // We also try to prevent mixing versions of shared uniffi header structs. - // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 - #ifndef UNIFFI_SHARED_HEADER_V4 - #error Combining helper code from multiple versions of uniffi is not supported - #endif // ndef UNIFFI_SHARED_HEADER_V4 -#else -#define UNIFFI_SHARED_H -#define UNIFFI_SHARED_HEADER_V4 -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ - -typedef struct RustBuffer -{ - int32_t capacity; - int32_t len; - uint8_t *_Nullable data; -} RustBuffer; - -typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull); - -// Task defined in Rust that Swift executes -typedef void (*UniFfiRustTaskCallback)(const void * _Nullable); - -// Callback to execute Rust tasks using a Swift Task -// -// Args: -// executor: ForeignExecutor lowered into a size_t value -// delay: Delay in MS -// task: UniFfiRustTaskCallback to call -// task_data: data to pass the task callback -typedef void (*UniFfiForeignExecutorCallback)(size_t, uint32_t, UniFfiRustTaskCallback _Nullable, const void * _Nullable); - -typedef struct ForeignBytes -{ - int32_t len; - const uint8_t *_Nullable data; -} ForeignBytes; - -// Error definitions -typedef struct RustCallStatus { - int8_t code; - RustBuffer errorBuf; -} RustCallStatus; - -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ -#endif // def UNIFFI_SHARED_H - -// Callbacks for UniFFI Futures -typedef void (*UniFfiFutureCallbackUInt32)(const void * _Nonnull, uint32_t, RustCallStatus); -typedef void (*UniFfiFutureCallbackRustBuffer)(const void * _Nonnull, RustBuffer, RustCallStatus); - -// Scaffolding functions -uint32_t uniffi_rust_uniffi_example_fn_func_add(uint32_t a, uint32_t b, RustCallStatus *_Nonnull out_status -); -RustBuffer uniffi_rust_uniffi_example_fn_func_hello(RustCallStatus *_Nonnull out_status - -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status -); -void ffi_rust_uniffi_example_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status -); -RustBuffer ffi_rust_uniffi_example_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status -); -uint16_t uniffi_rust_uniffi_example_checksum_func_add(void - -); -uint16_t uniffi_rust_uniffi_example_checksum_func_hello(void - -); -uint32_t ffi_rust_uniffi_example_uniffi_contract_version(void - -); - diff --git a/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExampleFFI.modulemap b/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExampleFFI.modulemap deleted file mode 100644 index 0cb2653a..00000000 --- a/rust-swift-spike/ios-app/FooBar/Generated/RustUniFFIExampleFFI.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! -module RustUniFFIExampleFFI { - header "RustUniFFIExampleFFI.h" - export * -} \ No newline at end of file diff --git a/rust-swift-spike/ios-app/FooBar/xc-universal-binary.sh b/rust-swift-spike/ios-app/FooBar/xc-universal-binary.sh deleted file mode 100755 index 4b5b874f..00000000 --- a/rust-swift-spike/ios-app/FooBar/xc-universal-binary.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -set -eEuvx - -function error_help() -{ - ERROR_MSG="It looks like something went wrong building the Example App Universal Binary." - echo "error: ${ERROR_MSG}" -} -trap error_help ERR - -# XCode tries to be helpful and overwrites the PATH. Reset that. -PATH="$(bash -l -c 'echo $PATH')" - -# This should be invoked from inside xcode, not manually -if [[ "${#}" -ne 3 ]] -then - echo "Usage (note: only call inside xcode!):" - echo "path/to/build-scripts/xc-universal-binary.sh " - exit 1 -fi -# what to pass to cargo build -p, e.g. logins_ffi -FFI_TARGET=${1} -# path to source code root -SRC_ROOT=${2} -# buildvariant from our xcconfigs -BUILDVARIANT=$(echo "${3}" | tr '[:upper:]' '[:lower:]') - -RELFLAG= -if [[ "${BUILDVARIANT}" != "debug" ]]; then - RELFLAG=--release -fi - -if [[ -n "${SDK_DIR:-}" ]]; then - # Assume we're in Xcode, which means we're probably cross-compiling. - # In this case, we need to add an extra library search path for build scripts and proc-macros, - # which run on the host instead of the target. - # (macOS Big Sur does not have linkable libraries in /usr/lib/.) - export LIBRARY_PATH="${SDK_DIR}/usr/lib:${LIBRARY_PATH:-}" -fi - -IS_SIMULATOR=0 -if [ "${LLVM_TARGET_TRIPLE_SUFFIX-}" = "-simulator" ]; then - IS_SIMULATOR=1 -fi - -# cd into $SRC_ROOT -cd "${SRC_ROOT}" - -for arch in $ARCHS; do - case "$arch" in - x86_64) - if [ $IS_SIMULATOR -eq 0 ]; then - echo "Building for x86_64, but not a simulator build. What's going on?" >&2 - exit 2 - fi - - # Intel iOS simulator - export CFLAGS_x86_64_apple_ios="-target x86_64-apple-ios" - $HOME/.cargo/bin/cargo rustc -p "${FFI_TARGET}" --lib --crate-type staticlib $RELFLAG --target x86_64-apple-ios - ;; - - arm64) - if [ $IS_SIMULATOR -eq 0 ]; then - # Hardware iOS targets - $HOME/.cargo/bin/cargo rustc -p "${FFI_TARGET}" --lib --crate-type staticlib $RELFLAG --target aarch64-apple-ios - else - # M1 iOS simulator - $HOME/.cargo/bin/cargo rustc -p "${FFI_TARGET}" --lib --crate-type staticlib $RELFLAG --target aarch64-apple-ios-sim - fi - esac -done diff --git a/rust-swift-spike/rust-uniffi-example/Cargo.toml b/rust-swift-spike/rust-uniffi-example/Cargo.toml deleted file mode 100644 index f637af6e..00000000 --- a/rust-swift-spike/rust-uniffi-example/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "rust-uniffi-example" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -crate-type = ["cdylib", "staticlib"] -name = "rust_uniffi_example" - -[[bin]] -name = "uniffi-bindgen" -path = "uniffi-bindgen.rs" - -[dependencies] -uniffi = { version = "0.24", features = ["cli"] } - -[build-dependencies] -uniffi = { version = "0.24", features = ["build"] } diff --git a/rust-swift-spike/rust-uniffi-example/build.rs b/rust-swift-spike/rust-uniffi-example/build.rs deleted file mode 100644 index 86348574..00000000 --- a/rust-swift-spike/rust-uniffi-example/build.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - uniffi::generate_scaffolding("./src/rust_uniffi_example.udl") - .expect("Building the UDL file failed"); -} diff --git a/rust-swift-spike/rust-uniffi-example/src/lib.rs b/rust-swift-spike/rust-uniffi-example/src/lib.rs deleted file mode 100644 index b95c6286..00000000 --- a/rust-swift-spike/rust-uniffi-example/src/lib.rs +++ /dev/null @@ -1,10 +0,0 @@ -// "example" is the name of the .udl file -uniffi::include_scaffolding!("rust_uniffi_example"); - -fn add(a: u32, b: u32) -> u32 { - a + b -} - -fn hello() -> String { - "This is a hello from the rust library".to_string() -} diff --git a/rust-swift-spike/rust-uniffi-example/src/rust_uniffi_example.udl b/rust-swift-spike/rust-uniffi-example/src/rust_uniffi_example.udl deleted file mode 100644 index 93aeb13f..00000000 --- a/rust-swift-spike/rust-uniffi-example/src/rust_uniffi_example.udl +++ /dev/null @@ -1,4 +0,0 @@ -namespace rust_uniffi_example { - u32 add(u32 a, u32 b); - string hello(); -}; diff --git a/rust-swift-spike/rust-uniffi-example/uniffi-bindgen.rs b/rust-swift-spike/rust-uniffi-example/uniffi-bindgen.rs deleted file mode 100644 index f6cff6cf..00000000 --- a/rust-swift-spike/rust-uniffi-example/uniffi-bindgen.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - uniffi::uniffi_bindgen_main() -} diff --git a/rust-swift-spike/rust-uniffi-example/uniffi.toml b/rust-swift-spike/rust-uniffi-example/uniffi.toml deleted file mode 100644 index 996f720c..00000000 --- a/rust-swift-spike/rust-uniffi-example/uniffi.toml +++ /dev/null @@ -1,2 +0,0 @@ -[bindings.swift] -module_name = "RustUniFFIExample"