From 8a8cc5f23021dee9e2b364c3908b623c24fc19bc Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 31 Aug 2022 14:41:27 +0100 Subject: [PATCH] chore(bindings): Use Swift package for tests. --- .github/workflows/bindings_ci.yml | 5 +- .../MatrixRustSDK.xcodeproj/project.pbxproj | 511 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcschemes/MatrixRustSDK.xcscheme | 106 ---- .../AccentColor.colorset/Contents.json | 11 - .../AppIcon.appiconset/Contents.json | 98 ---- .../Assets.xcassets/Contents.json | 6 - .../apple/MatrixRustSDK/ContentView.swift | 21 - bindings/apple/MatrixRustSDK/Info.plist | 5 - .../MatrixRustSDK/MatrixRustSDK.entitlements | 10 - .../MatrixRustSDK/MatrixRustSDKApp.swift | 17 - bindings/apple/Package.swift | 21 + .../MatrixRustSDKTests/ClientTests.swift} | 10 +- bindings/apple/debug_build_xcframework.sh | 2 +- 15 files changed, 26 insertions(+), 812 deletions(-) delete mode 100644 bindings/apple/MatrixRustSDK.xcodeproj/project.pbxproj delete mode 100644 bindings/apple/MatrixRustSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 bindings/apple/MatrixRustSDK.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 bindings/apple/MatrixRustSDK.xcodeproj/xcshareddata/xcschemes/MatrixRustSDK.xcscheme delete mode 100644 bindings/apple/MatrixRustSDK/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 bindings/apple/MatrixRustSDK/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 bindings/apple/MatrixRustSDK/Assets.xcassets/Contents.json delete mode 100644 bindings/apple/MatrixRustSDK/ContentView.swift delete mode 100644 bindings/apple/MatrixRustSDK/Info.plist delete mode 100644 bindings/apple/MatrixRustSDK/MatrixRustSDK.entitlements delete mode 100644 bindings/apple/MatrixRustSDK/MatrixRustSDKApp.swift create mode 100644 bindings/apple/Package.swift rename bindings/apple/{MatrixRustSDKTests/MatrixRustSDKTests.swift => Tests/MatrixRustSDKTests/ClientTests.swift} (87%) diff --git a/.github/workflows/bindings_ci.yml b/.github/workflows/bindings_ci.yml index 6f309b14b..f8ccf951d 100644 --- a/.github/workflows/bindings_ci.yml +++ b/.github/workflows/bindings_ci.yml @@ -165,12 +165,13 @@ jobs: args: uniffi_bindgen --git https://github.com/mozilla/uniffi-rs --rev 6d6724a26b119032588c5b3d59ac4d09f902e778 - name: Generate .xcframework - run: sh bindings/apple/debug_build_xcframework.sh x86_64 ci + working-directory: bindings/apple + run: sh ./debug_build_xcframework.sh x86_64 ci - name: Run XCTests + working-directory: bindings/apple run: | xcodebuild test \ - -project bindings/apple/MatrixRustSDK.xcodeproj \ -scheme MatrixRustSDK \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 13' diff --git a/bindings/apple/MatrixRustSDK.xcodeproj/project.pbxproj b/bindings/apple/MatrixRustSDK.xcodeproj/project.pbxproj deleted file mode 100644 index e41ef3c30..000000000 --- a/bindings/apple/MatrixRustSDK.xcodeproj/project.pbxproj +++ /dev/null @@ -1,511 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 55; - objects = { - -/* Begin PBXBuildFile section */ - 1814BEC928BF670C008CD7D1 /* matrix_sdk_ffi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1814BEC828BF670C008CD7D1 /* matrix_sdk_ffi.swift */; }; - 181AA19B27B52AB40005F102 /* MatrixSDKFFI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 181AA19A27B52AB40005F102 /* MatrixSDKFFI.xcframework */; }; - 181AA19C27B52AB40005F102 /* MatrixSDKFFI.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 181AA19A27B52AB40005F102 /* MatrixSDKFFI.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 18CE89D827B2939900CA89E1 /* MatrixRustSDKApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18CE89D727B2939900CA89E1 /* MatrixRustSDKApp.swift */; }; - 18CE89DA27B2939900CA89E1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18CE89D927B2939900CA89E1 /* ContentView.swift */; }; - 18CE89DC27B2939A00CA89E1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18CE89DB27B2939A00CA89E1 /* Assets.xcassets */; }; - 18CE89E927B2939A00CA89E1 /* MatrixRustSDKTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18CE89E827B2939A00CA89E1 /* MatrixRustSDKTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 18CE89E527B2939A00CA89E1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 18CE89CC27B2939900CA89E1 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 18CE89D327B2939900CA89E1; - remoteInfo = MatrixRustSDK; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 18CE8A1F27B2941600CA89E1 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 181AA19C27B52AB40005F102 /* MatrixSDKFFI.xcframework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1814BEC828BF670C008CD7D1 /* matrix_sdk_ffi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = matrix_sdk_ffi.swift; path = ../../../generated/swift/matrix_sdk_ffi.swift; sourceTree = ""; }; - 181AA19927B52AA60005F102 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 181AA19A27B52AB40005F102 /* MatrixSDKFFI.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MatrixSDKFFI.xcframework; path = ../../generated/MatrixSDKFFI.xcframework; sourceTree = ""; }; - 18CE89D427B2939900CA89E1 /* MatrixRustSDK.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MatrixRustSDK.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 18CE89D727B2939900CA89E1 /* MatrixRustSDKApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatrixRustSDKApp.swift; sourceTree = ""; }; - 18CE89D927B2939900CA89E1 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 18CE89DB27B2939A00CA89E1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 18CE89E427B2939A00CA89E1 /* MatrixRustSDKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MatrixRustSDKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 18CE89E827B2939A00CA89E1 /* MatrixRustSDKTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatrixRustSDKTests.swift; sourceTree = ""; }; - 18CE8A0127B293A900CA89E1 /* MatrixRustSDK.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MatrixRustSDK.entitlements; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 18CE89D127B2939900CA89E1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 181AA19B27B52AB40005F102 /* MatrixSDKFFI.xcframework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 18CE89E127B2939A00CA89E1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 189A89AB27B2E16B0048B0A5 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 181AA19A27B52AB40005F102 /* MatrixSDKFFI.xcframework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 189A89B827B40BB10048B0A5 /* Generated */ = { - isa = PBXGroup; - children = ( - 1814BEC828BF670C008CD7D1 /* matrix_sdk_ffi.swift */, - ); - name = Generated; - sourceTree = ""; - }; - 18CE89CB27B2939900CA89E1 = { - isa = PBXGroup; - children = ( - 18CE89D627B2939900CA89E1 /* MatrixRustSDK */, - 18CE89E727B2939A00CA89E1 /* MatrixRustSDKTests */, - 18CE89D527B2939900CA89E1 /* Products */, - 189A89AB27B2E16B0048B0A5 /* Frameworks */, - ); - sourceTree = ""; - }; - 18CE89D527B2939900CA89E1 /* Products */ = { - isa = PBXGroup; - children = ( - 18CE89D427B2939900CA89E1 /* MatrixRustSDK.app */, - 18CE89E427B2939A00CA89E1 /* MatrixRustSDKTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 18CE89D627B2939900CA89E1 /* MatrixRustSDK */ = { - isa = PBXGroup; - children = ( - 181AA19927B52AA60005F102 /* Info.plist */, - 189A89B827B40BB10048B0A5 /* Generated */, - 18CE89D727B2939900CA89E1 /* MatrixRustSDKApp.swift */, - 18CE89D927B2939900CA89E1 /* ContentView.swift */, - 18CE8A0127B293A900CA89E1 /* MatrixRustSDK.entitlements */, - 18CE89DB27B2939A00CA89E1 /* Assets.xcassets */, - ); - path = MatrixRustSDK; - sourceTree = ""; - }; - 18CE89E727B2939A00CA89E1 /* MatrixRustSDKTests */ = { - isa = PBXGroup; - children = ( - 18CE89E827B2939A00CA89E1 /* MatrixRustSDKTests.swift */, - ); - path = MatrixRustSDKTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 18CE89D327B2939900CA89E1 /* MatrixRustSDK */ = { - isa = PBXNativeTarget; - buildConfigurationList = 18CE89F827B2939A00CA89E1 /* Build configuration list for PBXNativeTarget "MatrixRustSDK" */; - buildPhases = ( - 18CE89D027B2939900CA89E1 /* Sources */, - 18CE89D127B2939900CA89E1 /* Frameworks */, - 18CE89D227B2939900CA89E1 /* Resources */, - 18CE8A1F27B2941600CA89E1 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = MatrixRustSDK; - productName = MatrixRustSDK; - productReference = 18CE89D427B2939900CA89E1 /* MatrixRustSDK.app */; - productType = "com.apple.product-type.application"; - }; - 18CE89E327B2939A00CA89E1 /* MatrixRustSDKTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 18CE89FB27B2939A00CA89E1 /* Build configuration list for PBXNativeTarget "MatrixRustSDKTests" */; - buildPhases = ( - 18CE89E027B2939A00CA89E1 /* Sources */, - 18CE89E127B2939A00CA89E1 /* Frameworks */, - 18CE89E227B2939A00CA89E1 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 18CE89E627B2939A00CA89E1 /* PBXTargetDependency */, - ); - name = MatrixRustSDKTests; - productName = MatrixRustSDKTests; - productReference = 18CE89E427B2939A00CA89E1 /* MatrixRustSDKTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 18CE89CC27B2939900CA89E1 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1320; - LastUpgradeCheck = 1320; - TargetAttributes = { - 18CE89D327B2939900CA89E1 = { - CreatedOnToolsVersion = 13.2.1; - LastSwiftMigration = 1320; - }; - 18CE89E327B2939A00CA89E1 = { - CreatedOnToolsVersion = 13.2.1; - TestTargetID = 18CE89D327B2939900CA89E1; - }; - }; - }; - buildConfigurationList = 18CE89CF27B2939900CA89E1 /* Build configuration list for PBXProject "MatrixRustSDK" */; - compatibilityVersion = "Xcode 13.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 18CE89CB27B2939900CA89E1; - productRefGroup = 18CE89D527B2939900CA89E1 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 18CE89D327B2939900CA89E1 /* MatrixRustSDK */, - 18CE89E327B2939A00CA89E1 /* MatrixRustSDKTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 18CE89D227B2939900CA89E1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 18CE89DC27B2939A00CA89E1 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 18CE89E227B2939A00CA89E1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 18CE89D027B2939900CA89E1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1814BEC928BF670C008CD7D1 /* matrix_sdk_ffi.swift in Sources */, - 18CE89DA27B2939900CA89E1 /* ContentView.swift in Sources */, - 18CE89D827B2939900CA89E1 /* MatrixRustSDKApp.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 18CE89E027B2939A00CA89E1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 18CE89E927B2939A00CA89E1 /* MatrixRustSDKTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 18CE89E627B2939A00CA89E1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 18CE89D327B2939900CA89E1 /* MatrixRustSDK */; - targetProxy = 18CE89E527B2939A00CA89E1 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 18CE89F627B2939A00CA89E1 /* 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++17"; - CLANG_CXX_LIBRARY = "libc++"; - 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 = 15.0; - MACOSX_DEPLOYMENT_TARGET = 12.0; - 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; - }; - 18CE89F727B2939A00CA89E1 /* 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++17"; - CLANG_CXX_LIBRARY = "libc++"; - 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 = 15.0; - MACOSX_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 18CE89F927B2939A00CA89E1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = MatrixRustSDK/MatrixRustSDK.entitlements; - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = MatrixRustSDK/Info.plist; - 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 = org.matrix.MatrixRustSDK; - PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTS_MACCATALYST = NO; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 18CE89FA27B2939A00CA89E1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = MatrixRustSDK/MatrixRustSDK.entitlements; - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = MatrixRustSDK/Info.plist; - 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 = org.matrix.MatrixRustSDK; - PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTS_MACCATALYST = NO; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 18CE89FC27B2939A00CA89E1 /* 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 = 15.2; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = org.matrix.MatrixRustSDKTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MatrixRustSDK.app/MatrixRustSDK"; - }; - name = Debug; - }; - 18CE89FD27B2939A00CA89E1 /* 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 = 15.2; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = org.matrix.MatrixRustSDKTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MatrixRustSDK.app/MatrixRustSDK"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 18CE89CF27B2939900CA89E1 /* Build configuration list for PBXProject "MatrixRustSDK" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 18CE89F627B2939A00CA89E1 /* Debug */, - 18CE89F727B2939A00CA89E1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 18CE89F827B2939A00CA89E1 /* Build configuration list for PBXNativeTarget "MatrixRustSDK" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 18CE89F927B2939A00CA89E1 /* Debug */, - 18CE89FA27B2939A00CA89E1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 18CE89FB27B2939A00CA89E1 /* Build configuration list for PBXNativeTarget "MatrixRustSDKTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 18CE89FC27B2939A00CA89E1 /* Debug */, - 18CE89FD27B2939A00CA89E1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 18CE89CC27B2939900CA89E1 /* Project object */; -} diff --git a/bindings/apple/MatrixRustSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/bindings/apple/MatrixRustSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a62..000000000 --- a/bindings/apple/MatrixRustSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/bindings/apple/MatrixRustSDK.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/bindings/apple/MatrixRustSDK.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/bindings/apple/MatrixRustSDK.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/bindings/apple/MatrixRustSDK.xcodeproj/xcshareddata/xcschemes/MatrixRustSDK.xcscheme b/bindings/apple/MatrixRustSDK.xcodeproj/xcshareddata/xcschemes/MatrixRustSDK.xcscheme deleted file mode 100644 index fe527d24f..000000000 --- a/bindings/apple/MatrixRustSDK.xcodeproj/xcshareddata/xcschemes/MatrixRustSDK.xcscheme +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bindings/apple/MatrixRustSDK/Assets.xcassets/AccentColor.colorset/Contents.json b/bindings/apple/MatrixRustSDK/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb8789700..000000000 --- a/bindings/apple/MatrixRustSDK/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/bindings/apple/MatrixRustSDK/Assets.xcassets/AppIcon.appiconset/Contents.json b/bindings/apple/MatrixRustSDK/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 9221b9bb1..000000000 --- a/bindings/apple/MatrixRustSDK/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/bindings/apple/MatrixRustSDK/Assets.xcassets/Contents.json b/bindings/apple/MatrixRustSDK/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596a..000000000 --- a/bindings/apple/MatrixRustSDK/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/bindings/apple/MatrixRustSDK/ContentView.swift b/bindings/apple/MatrixRustSDK/ContentView.swift deleted file mode 100644 index 67f95eb10..000000000 --- a/bindings/apple/MatrixRustSDK/ContentView.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// ContentView.swift -// MatrixRustSDK -// -// Created by Stefan Ceriu on 08.02.2022. -// - -import SwiftUI - -struct ContentView: View { - var body: some View { - Text("Hello, Rust!") - .padding() - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} diff --git a/bindings/apple/MatrixRustSDK/Info.plist b/bindings/apple/MatrixRustSDK/Info.plist deleted file mode 100644 index 0c67376eb..000000000 --- a/bindings/apple/MatrixRustSDK/Info.plist +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/bindings/apple/MatrixRustSDK/MatrixRustSDK.entitlements b/bindings/apple/MatrixRustSDK/MatrixRustSDK.entitlements deleted file mode 100644 index ee95ab7e5..000000000 --- a/bindings/apple/MatrixRustSDK/MatrixRustSDK.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.network.client - - - diff --git a/bindings/apple/MatrixRustSDK/MatrixRustSDKApp.swift b/bindings/apple/MatrixRustSDK/MatrixRustSDKApp.swift deleted file mode 100644 index 69d888555..000000000 --- a/bindings/apple/MatrixRustSDK/MatrixRustSDKApp.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// MatrixRustSDKApp.swift -// MatrixRustSDK -// -// Created by Stefan Ceriu on 08.02.2022. -// - -import SwiftUI - -@main -struct MatrixRustSDKApp: App { - var body: some Scene { - WindowGroup { - ContentView() - } - } -} diff --git a/bindings/apple/Package.swift b/bindings/apple/Package.swift new file mode 100644 index 000000000..13b9a0fa4 --- /dev/null +++ b/bindings/apple/Package.swift @@ -0,0 +1,21 @@ +// swift-tools-version: 5.6 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "MatrixRustSDK", + platforms: [.iOS(.v15)], + products: [ + .library(name: "MatrixRustSDK", + targets: ["MatrixRustSDK"]), + ], + targets: [ + .binaryTarget(name: "MatrixSDKFFI", path: "generated/MatrixSDKFFI.xcframework"), + .target(name: "MatrixRustSDK", + dependencies: [.target(name: "MatrixSDKFFI")], + path: "generated/swift"), + .testTarget(name: "MatrixRustSDKTests", + dependencies: ["MatrixRustSDK"]), + ] +) diff --git a/bindings/apple/MatrixRustSDKTests/MatrixRustSDKTests.swift b/bindings/apple/Tests/MatrixRustSDKTests/ClientTests.swift similarity index 87% rename from bindings/apple/MatrixRustSDKTests/MatrixRustSDKTests.swift rename to bindings/apple/Tests/MatrixRustSDKTests/ClientTests.swift index 2a4960dbf..0350d1d92 100644 --- a/bindings/apple/MatrixRustSDKTests/MatrixRustSDKTests.swift +++ b/bindings/apple/Tests/MatrixRustSDKTests/ClientTests.swift @@ -1,15 +1,7 @@ -// -// MatrixRustSDKTests.swift -// MatrixRustSDKTests -// -// Created by Stefan Ceriu on 08.02.2022. -// - import XCTest @testable import MatrixRustSDK -class MatrixRustSDKTests: XCTestCase { - +final class ClientTests: XCTestCase { func testReadOnlyFileSystemError() { do { let client = try ClientBuilder() diff --git a/bindings/apple/debug_build_xcframework.sh b/bindings/apple/debug_build_xcframework.sh index 11494ff1e..5af747bc4 100755 --- a/bindings/apple/debug_build_xcframework.sh +++ b/bindings/apple/debug_build_xcframework.sh @@ -26,7 +26,7 @@ SRC_ROOT=../.. TARGET_DIR="${SRC_ROOT}/target" -GENERATED_DIR="${SRC_ROOT}/generated" +GENERATED_DIR="${SRC_ROOT}/bindings/apple/generated" mkdir -p ${GENERATED_DIR} REL_FLAG=""