From c5f91c7bc4b869743b6abb0cbafd5b7222ed4908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20C=CC=8Cech?= Date: Mon, 5 Oct 2026 17:55:40 +0200 Subject: [PATCH] feat!: groundwork for 4.0: cleanup, CI, Dependency Injection as a package trait Removes tooling that no longer runs (Travis, Danger, Carthage bootstrap, jazzy, .swift-version, .ruby-version, Objective-C headers, an empty file and a Quick spec that never compiled). The package fetches ios-dependency-injection over https, so it resolves without SSH access to GitHub, and GitHub Actions builds it. The DeallocTestsDIFree product compiled the same sources through a symlinked target and switched Dependency Injection on with canImport, which depends on whatever else is in the build. One target now does it with the DependencyInjection package trait (Swift 6.1), on by default, accepting STRV Dependency Injection 1.0.4 up to 2.x. The DIFree sample uses the trait and gets the @MainActor/await it needed to compile under Swift 6. BREAKING CHANGE: the DeallocTestsDIFree product is removed; link DeallocTests with the default traits disabled. Swift 6.1 is required. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/ci.yml | 35 +++++++ .jazzy.yml | 8 -- .ruby-version | 1 - .swift-version | 1 - .travis.yml | 95 ------------------- Dangerfile | 9 -- Package.resolved | 8 +- Package.swift | 34 ++++--- .../project.pbxproj | 23 +++-- .../xcshareddata/swiftpm/Package.resolved | 15 --- .../DeallocTestConformances.swift | 2 +- .../MainCoordinatorDeallocTester.swift | 5 +- .../project.pbxproj | 11 ++- Sources/DeallocTests.h | 17 ---- Sources/DeallocTests/DeallocTester.swift | 14 +-- Sources/DeallocTests/DeallocTests.h | 17 ---- Sources/DeallocTests/DeallocTests.swift | 0 Sources/DeallocTestsDIFree | 1 - Tests/DeallocTestsSpec.swift | 17 ---- scripts/bootstrap | 1 - 20 files changed, 91 insertions(+), 223 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .jazzy.yml delete mode 100644 .ruby-version delete mode 100644 .swift-version delete mode 100644 .travis.yml delete mode 100644 Dangerfile delete mode 100644 SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved delete mode 100644 Sources/DeallocTests.h delete mode 100644 Sources/DeallocTests/DeallocTests.h delete mode 100644 Sources/DeallocTests/DeallocTests.swift delete mode 120000 Sources/DeallocTestsDIFree delete mode 100644 Tests/DeallocTestsSpec.swift delete mode 100644 scripts/bootstrap diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8bfc16f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + package: + name: Package build (macOS, ${{ matrix.traits.name }}) + runs-on: macos-15 + strategy: + matrix: + traits: + - { name: "DependencyInjection (default)", flags: "" } + - { name: "without DependencyInjection", flags: "--disable-default-traits" } + steps: + - uses: actions/checkout@v4 + - name: Build + run: swift build ${{ matrix.traits.flags }} + + package-ios: + name: Package build (iOS Simulator) + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + - name: Build + run: | + xcodebuild build \ + -scheme DeallocTests \ + -destination 'generic/platform=iOS Simulator' diff --git a/.jazzy.yml b/.jazzy.yml deleted file mode 100644 index e7a6b02..0000000 --- a/.jazzy.yml +++ /dev/null @@ -1,8 +0,0 @@ -author: Daniel Cech -author_url: https://twitter.com/DanielCech -github_url: https://github.com/DanielCech/DeallocTests -root_url: https://DanielCech.github.io/DeallocTests/ -module: DeallocTests -output: docs -theme: fullwidth -xcodebuild_arguments: [-workspace, 'DeallocTests.xcworkspace', -scheme, 'DeallocTests-iOS'] diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 49cdd66..0000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.7.6 diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 819e07a..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -5.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5c859be..0000000 --- a/.travis.yml +++ /dev/null @@ -1,95 +0,0 @@ -language: objective-c -osx_image: xcode10.2 -branches: - only: - - master - - develop - - /^v\d+\.\d+(\.\d+)?(-\S*)?$/ -cache: - directories: - - $HOME/Library/Caches/org.carthage.CarthageKit/dependencies - - Carthage - - vendor/bundle - -before_install: - - bundle install --path vendor/bundle - - gem install xcpretty - - brew update - - brew outdated carthage || brew upgrade carthage - -env: - global: - - LC_CTYPE=en_US.UTF-8 - - LANG=en_US.UTF-8 - - WORKSPACE=DeallocTests.xcworkspace - - IOS_FRAMEWORK_SCHEME="DeallocTests-iOS" - - OSX_FRAMEWORK_SCHEME="DeallocTests-macOS" - - TVOS_FRAMEWORK_SCHEME="DeallocTests-tvOS" - - WATCHOS_FRAMEWORK_SCHEME="DeallocTests-watchOS" - matrix: - - DESTINATION="OS=12.2,name=iPhone XS" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="OS=11.4,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="arch=x86_64" SCHEME="$OSX_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="OS=12.2,name=Apple TV 4K (at 1080p)" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="OS=11.4,name=Apple TV 4K (at 1080p)" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="OS=10.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="OS=9.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" - - DESTINATION="OS=5.2,name=Apple Watch Series 4 - 44mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" - - DESTINATION="OS=4.2,name=Apple Watch Series 3 - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" - - DESTINATION="OS=3.1,name=Apple Watch Series 2 - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" - - DESTINATION="OS=2.0,name=Apple Watch - 38mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" - -before_script: - - sh scripts/bootstrap - -script: - - set -o pipefail - - xcodebuild -version - - xcodebuild -showsdks - - # Build Framework in Debug and Run Tests if specified - - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty -c; - else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Framework in Release and Run Tests if specified - - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty -c; - else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - -jobs: - include: - - stage: Danger - script: bundle exec danger - - stage: Pod lib lint - script: bundle exec pod lib lint --verbose --allow-warnings - - stage: Deploy Github - script: skip - before_deploy: - - carthage build --no-skip-current --cache-builds - - carthage archive DeallocTests - deploy: - - provider: releases - api_key: - secure: # https://docs.travis-ci.com/user/deployment/releases/ - file: - - DeallocTests.framework.zip - skip_cleanup: true - overwrite: true - on: - repo: DanielCech/DeallocTests - tags: true - - stage: Deploy Cocoapods - script: skip - deploy: - - provider: script # https://fuller.li/posts/automated-cocoapods-releases-with-ci/ - script: bundle exec pod trunk push - skip_cleanup: true - on: - tags: true diff --git a/Dangerfile b/Dangerfile deleted file mode 100644 index 3907e84..0000000 --- a/Dangerfile +++ /dev/null @@ -1,9 +0,0 @@ -# Sometimes it's a README fix, or something like that - which isn't relevant for -# including in a project's CHANGELOG for example -declared_trivial = github.pr_title.include? "#trivial" - -# Make it more obvious that a PR is a work in progress and shouldn't be merged yet -warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]" - -# Warn when there is a big PR -warn("Big PR") if git.lines_of_code > 500 diff --git a/Package.resolved b/Package.resolved index fbff33d..6e6c454 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "1ecfde1ad21f8a051770df0d5ded503e30660f902976d02be63c6740811b36fd", + "originHash" : "9f36501074bd40bb7dd10098138fafe7ad6aeb7dc867f8cfcfa8519e927df92d", "pins" : [ { "identity" : "ios-dependency-injection", "kind" : "remoteSourceControl", - "location" : "git@github.com:strvcom/ios-dependency-injection.git", + "location" : "https://github.com/strvcom/ios-dependency-injection.git", "state" : { - "revision" : "e70e77a882f66888cb664ea53014f0bef7c04f95", - "version" : "2.0.0" + "revision" : "bff058aab9f85fd687be3daddb0d38d094b56e7b", + "version" : "2.0.1" } } ], diff --git a/Package.swift b/Package.swift index bd62083..90619ab 100644 --- a/Package.swift +++ b/Package.swift @@ -1,6 +1,6 @@ -// swift-tools-version:6.0.0 +// swift-tools-version:6.1 // -// DeallocTests.swift +// Package.swift // DeallocTests // // Created by Daniel Cech on 01/04/19. @@ -20,29 +20,27 @@ let package = Package( name: "DeallocTests", targets: ["DeallocTests"] ), - .library( - name: "DeallocTestsDIFree", - targets: ["DeallocTestsDIFree"] + ], + traits: [ + .trait( + name: "DependencyInjection", + description: "Integration with STRV Dependency Injection: the AsyncContainer in DeallocTester" ), + .default(enabledTraits: ["DependencyInjection"]), ], dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "git@github.com:strvcom/ios-dependency-injection.git", .upToNextMajor(from: "2.0.0")) + .package(url: "https://github.com/strvcom/ios-dependency-injection.git", "1.0.4" ..< "3.0.0") ], targets: [ .target( name: "DeallocTests", - dependencies: [.product(name: "DependencyInjection", package: "ios-dependency-injection")], - path: "Sources/DeallocTests" - ), - .target( - name: "DeallocTestsDIFree", - path: "Sources/DeallocTestsDIFree" - ), - .testTarget( - name: "DeallocTestsTests", - dependencies: ["DeallocTests"], - path: "Tests" + dependencies: [ + .product( + name: "DependencyInjection", + package: "ios-dependency-injection", + condition: .when(traits: ["DependencyInjection"]) + ) + ] ), ], swiftLanguageModes: [.v6] diff --git a/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPM.xcodeproj/project.pbxproj b/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPM.xcodeproj/project.pbxproj index e69854b..3f8a716 100644 --- a/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPM.xcodeproj/project.pbxproj +++ b/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPM.xcodeproj/project.pbxproj @@ -21,7 +21,7 @@ 27A08053245CBA7A0037F1DB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A08052245CBA790037F1DB /* SceneDelegate.swift */; }; 27A08055245CBBD10037F1DB /* DeallocTestConformances.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A08054245CBBD10037F1DB /* DeallocTestConformances.swift */; }; 27A08057245CBBFA0037F1DB /* MainCoordinatorDeallocTester.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A08056245CBBFA0037F1DB /* MainCoordinatorDeallocTester.swift */; }; - ADCB58E527FD840C009E0DEB /* DeallocTestsDIFree in Frameworks */ = {isa = PBXBuildFile; productRef = ADCB58E427FD840C009E0DEB /* DeallocTestsDIFree */; }; + ADCB58E527FD840C009E0DEB /* DeallocTests in Frameworks */ = {isa = PBXBuildFile; productRef = ADCB58E427FD840C009E0DEB /* DeallocTests */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -54,7 +54,6 @@ 27A08054245CBBD10037F1DB /* DeallocTestConformances.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeallocTestConformances.swift; sourceTree = ""; }; 27A08056245CBBFA0037F1DB /* MainCoordinatorDeallocTester.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainCoordinatorDeallocTester.swift; sourceTree = ""; }; 7E877B2A5D7E5C94D45AE696 /* Pods_DeallocTestsAppCocoapodsTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DeallocTestsAppCocoapodsTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - ADCB58E327FD82B4009E0DEB /* DeallocTests */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = DeallocTests; path = ../..; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -69,7 +68,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - ADCB58E527FD840C009E0DEB /* DeallocTestsDIFree in Frameworks */, + ADCB58E527FD840C009E0DEB /* DeallocTests in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -153,7 +152,6 @@ ADCB58E227FD82B4009E0DEB /* Packages */ = { isa = PBXGroup; children = ( - ADCB58E327FD82B4009E0DEB /* DeallocTests */, ); name = Packages; sourceTree = ""; @@ -195,7 +193,7 @@ ); name = DeallocTestsAppSPMTests; packageProductDependencies = ( - ADCB58E427FD840C009E0DEB /* DeallocTestsDIFree */, + ADCB58E427FD840C009E0DEB /* DeallocTests */, ); productName = DeallocTestsAppCocoapodsTests; productReference = 27A08039245C859E0037F1DB /* DeallocTestsAppSPMTests.xctest */; @@ -230,6 +228,7 @@ ); mainGroup = 27A0801A245C859C0037F1DB; packageReferences = ( + AD0E0E0E2F00000100000020 /* XCLocalSwiftPackageReference "../.." */, ); productRefGroup = 27A08024245C859C0037F1DB /* Products */; projectDirPath = ""; @@ -543,10 +542,20 @@ }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + AD0E0E0E2F00000100000020 /* XCLocalSwiftPackageReference "../.." */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../..; + traits = ( + ); + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCSwiftPackageProductDependency section */ - ADCB58E427FD840C009E0DEB /* DeallocTestsDIFree */ = { + ADCB58E427FD840C009E0DEB /* DeallocTests */ = { isa = XCSwiftPackageProductDependency; - productName = DeallocTestsDIFree; + package = AD0E0E0E2F00000100000020 /* XCLocalSwiftPackageReference "../.." */; + productName = DeallocTests; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 82b9896..0000000 --- a/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,15 +0,0 @@ -{ - "originHash" : "8c14dc87e9169f0c50a5681f322928bb038c4a355ddffcb82006364999de8044", - "pins" : [ - { - "identity" : "ios-dependency-injection", - "kind" : "remoteSourceControl", - "location" : "https://github.com/strvcom/ios-dependency-injection.git", - "state" : { - "revision" : "aa5e4da9a4a3dc0076d870776972a701b7eb0949", - "version" : "1.0.4" - } - } - ], - "version" : 3 -} diff --git a/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPMTests/DeallocTestConformances.swift b/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPMTests/DeallocTestConformances.swift index 79e6c7c..85ff594 100644 --- a/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPMTests/DeallocTestConformances.swift +++ b/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPMTests/DeallocTestConformances.swift @@ -7,7 +7,7 @@ // import Foundation -import DeallocTestsDIFree +import DeallocTests @testable import DeallocTestsAppSPM extension MainCoordinator: DeallocTestable {} diff --git a/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPMTests/MainCoordinatorDeallocTester.swift b/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPMTests/MainCoordinatorDeallocTester.swift index d0acf57..c83baea 100644 --- a/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPMTests/MainCoordinatorDeallocTester.swift +++ b/SampleApps/DeallocTestsAppDIFreeSPM/DeallocTestsAppSPMTests/MainCoordinatorDeallocTester.swift @@ -7,7 +7,7 @@ // import Foundation -import DeallocTestsDIFree +import DeallocTests @testable import DeallocTestsAppSPM @@ -16,8 +16,9 @@ class MainCoordinatorDeallocTester: DeallocTester { return MainCoordinator() } + @MainActor func test_mainCoordinatorDealloc() async { - presentingController = showPresentingController() + presentingController = await showPresentingController() try? await Task.sleep(for: .milliseconds(200)) diff --git a/SampleApps/DeallocTestsAppSPM/DeallocTestsAppSPM.xcodeproj/project.pbxproj b/SampleApps/DeallocTestsAppSPM/DeallocTestsAppSPM.xcodeproj/project.pbxproj index 6f90aed..c6c7b87 100644 --- a/SampleApps/DeallocTestsAppSPM/DeallocTestsAppSPM.xcodeproj/project.pbxproj +++ b/SampleApps/DeallocTestsAppSPM/DeallocTestsAppSPM.xcodeproj/project.pbxproj @@ -55,7 +55,6 @@ 27A08052245CBA790037F1DB /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 27A08054245CBBD10037F1DB /* DeallocTestConformances.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeallocTestConformances.swift; sourceTree = ""; }; 27A08056245CBBFA0037F1DB /* MainCoordinatorDeallocTester.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainCoordinatorDeallocTester.swift; sourceTree = ""; }; - ADCB58D827FD7B01009E0DEB /* DeallocTests */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = DeallocTests; path = ../..; sourceTree = ""; }; ADCB58DE27FD7CC9009E0DEB /* APIManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIManager.swift; sourceTree = ""; }; ADCB58E027FD7CF3009E0DEB /* DependencyGraphDeallocTester.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DependencyGraphDeallocTester.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -157,7 +156,6 @@ ADCB58D727FD7B01009E0DEB /* Packages */ = { isa = PBXGroup; children = ( - ADCB58D827FD7B01009E0DEB /* DeallocTests */, ); name = Packages; sourceTree = ""; @@ -242,6 +240,7 @@ ); mainGroup = 27A0801A245C859C0037F1DB; packageReferences = ( + AD0E0E0E2F00000100000010 /* XCLocalSwiftPackageReference "../.." */, ); productRefGroup = 27A08024245C859C0037F1DB /* Products */; projectDirPath = ""; @@ -555,9 +554,17 @@ }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + AD0E0E0E2F00000100000010 /* XCLocalSwiftPackageReference "../.." */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../..; + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCSwiftPackageProductDependency section */ ADCB58E627FD8756009E0DEB /* DeallocTests */ = { isa = XCSwiftPackageProductDependency; + package = AD0E0E0E2F00000100000010 /* XCLocalSwiftPackageReference "../.." */; productName = DeallocTests; }; /* End XCSwiftPackageProductDependency section */ diff --git a/Sources/DeallocTests.h b/Sources/DeallocTests.h deleted file mode 100644 index 440effb..0000000 --- a/Sources/DeallocTests.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// DeallocTests.h -// DeallocTests -// -// Created by Daniel Cech on 01/04/19. -// Copyright © 2019 DanielCech. All rights reserved. -// - -#import - -//! Project version number for DeallocTests. -FOUNDATION_EXPORT double DeallocTestsVersionNumber; - -//! Project version string for DeallocTests. -FOUNDATION_EXPORT const unsigned char DeallocTestsVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import diff --git a/Sources/DeallocTests/DeallocTester.swift b/Sources/DeallocTests/DeallocTester.swift index 422f929..a1538dd 100644 --- a/Sources/DeallocTests/DeallocTester.swift +++ b/Sources/DeallocTests/DeallocTester.swift @@ -11,7 +11,7 @@ import Foundation let delayTime: Double = 0.1 let presentationAnimated = false -#if canImport(DependencyInjection) +#if DependencyInjection import DependencyInjection #endif @@ -22,7 +22,7 @@ import XCTest #endif public struct DeallocTest { -#if canImport(DependencyInjection) +#if DependencyInjection public typealias ObjectCreationClosure = @MainActor (AsyncContainer) async -> AnyObject? #else public typealias ObjectCreationClosure = @MainActor () async -> AnyObject? @@ -84,7 +84,7 @@ open class DeallocTester: XCTestCase { } #endif -#if canImport(DependencyInjection) +#if DependencyInjection /// Dependency Injection container // swiftlint:disable:next implicitly_unwrapped_optional public var container: AsyncContainer! @@ -93,7 +93,7 @@ open class DeallocTester: XCTestCase { public override func setUp() async throws { try await super.setUp() - #if canImport(DependencyInjection) + #if DependencyInjection container = AsyncContainer() #endif @@ -133,7 +133,7 @@ open class DeallocTester: XCTestCase { allocatedClasses = [] deallocatedClasses = [] - #if canImport(DependencyInjection) + #if DependencyInjection await container.clean() await registerDependencies() #endif @@ -144,7 +144,7 @@ open class DeallocTester: XCTestCase { let dependencyDeallocTest = deallocTests[index] - #if canImport(DependencyInjection) + #if DependencyInjection var instance: AnyObject? = await dependencyDeallocTest.objectCreation(self.container) #else var instance: AnyObject? = await dependencyDeallocTest.objectCreation() @@ -188,7 +188,7 @@ open class DeallocTester: XCTestCase { /// Start testing of next item @MainActor private func continueWithNextStep(deallocTests: [DeallocTest], index: Int, expectation: XCTestExpectation) async { - #if canImport(DependencyInjection) + #if DependencyInjection await container.releaseSharedInstances() #endif diff --git a/Sources/DeallocTests/DeallocTests.h b/Sources/DeallocTests/DeallocTests.h deleted file mode 100644 index 440effb..0000000 --- a/Sources/DeallocTests/DeallocTests.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// DeallocTests.h -// DeallocTests -// -// Created by Daniel Cech on 01/04/19. -// Copyright © 2019 DanielCech. All rights reserved. -// - -#import - -//! Project version number for DeallocTests. -FOUNDATION_EXPORT double DeallocTestsVersionNumber; - -//! Project version string for DeallocTests. -FOUNDATION_EXPORT const unsigned char DeallocTestsVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import diff --git a/Sources/DeallocTests/DeallocTests.swift b/Sources/DeallocTests/DeallocTests.swift deleted file mode 100644 index e69de29..0000000 diff --git a/Sources/DeallocTestsDIFree b/Sources/DeallocTestsDIFree deleted file mode 120000 index e2e6836..0000000 --- a/Sources/DeallocTestsDIFree +++ /dev/null @@ -1 +0,0 @@ -DeallocTests \ No newline at end of file diff --git a/Tests/DeallocTestsSpec.swift b/Tests/DeallocTestsSpec.swift deleted file mode 100644 index 11f6b5c..0000000 --- a/Tests/DeallocTestsSpec.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// DeallocTestsSpec.swift -// DeallocTests -// -// Created by Daniel Cech on 01/04/19. -// Copyright © 2019 DanielCech. All rights reserved. -// - -import Quick -import Nimble -@testable import DeallocTests - -class DeallocTestsSpec: QuickSpec { - override func spec() { - - } -} diff --git a/scripts/bootstrap b/scripts/bootstrap deleted file mode 100644 index e5b0bda..0000000 --- a/scripts/bootstrap +++ /dev/null @@ -1 +0,0 @@ -carthage bootstrap --no-use-binaries --cache-builds