diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0a32f29..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,189 +0,0 @@ -# iOS CircleCI configuration file -# -version: 2.1 - -defaults: &defaults - working_directory: /Users/distiller/project - environment: - FL_OUTPUT_DIR: /Users/distiller/project/output - shell: /bin/bash --login -o pipefail - -commands: - - # Sets Ruby version and installs all gems, using a cache - setup_ruby: - parameters: - version: - type: string - default: '2.6' - steps: - - run: - name: Set Ruby version - command: echo 'chruby ruby-<< parameters.version >>' >> ~/.bash_profile - - restore_cache: - keys: - - gem-cache-v<< parameters.version >>-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }} - - gem-cache-v<< parameters.version >>-{{ arch }}-{{ .Branch }} - - run: - name: Install bundler - command: sudo gem update bundler -f - - run: - name: Configure bundler - command: bundle config set path ~/vendor/bundle - - run: - name: Install dependencies in Gemfile - command: bundle install - - save_cache: - key: gem-cache-v<< parameters.version >>-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }} - paths: - - ~/vendor/bundle - - # Installs utilities from Homebrew, and gems from the Gemfile - install_dependencies: - parameters: - ruby: - type: string - default: '2.6' - steps: - - setup_ruby: - version: << parameters.ruby >> - - # Runs `pod update` - pod_update: - parameters: - swift: - type: string - default: '5.0' - steps: - - run: - name: Set Swift language version - command: echo "<< parameters.swift >>" > Example/.swift-version - - run: - name: Pod Update - command: | - cd Example && bundle exec pod update - - # Build the Example app & run the tests - build: - steps: - - run: - name: Build and run tests - command: bundle exec fastlane scan --workspace "Example/Lasso.xcworkspace" - #command: fastlane scan --workspace "Example/Lasso.xcworkspace" --code_coverage --output_directory output/scan - environment: - SCAN_DEVICE: iPhone 8 - SCAN_SCHEME: Lasso-Example - - # Build the SwiftPM Example app & run the tests - build_swiftpm: - steps: - - run: - name: Build and run tests - command: >- - xcodebuild build - -project "Example/SwiftPM/Lasso-SwiftPM/Lasso-SwiftPM.xcodeproj" - -scheme "Lasso-SwiftPM" - -destination "platform=iOS Simulator,name=iPhone 11" - -jobs: - - build-gem-cache-26: - <<: *defaults - macos: - xcode: 11.3.0 - steps: - - checkout - - setup_ruby: - version: '2.6' - - build-gem-cache-27: - <<: *defaults - macos: - xcode: 12.0.0 - steps: - - checkout - - setup_ruby: - version: '2.7' - - build-and-test-swift51: - <<: *defaults - macos: - xcode: 11.3.0 - steps: - - checkout - - install_dependencies: - ruby: '2.6' - - pod_update: - swift: '5.1' - - build - - build-and-test-swift52: - <<: *defaults - macos: - xcode: 11.4.0 - steps: - - checkout - - install_dependencies: - ruby: '2.6' - - pod_update: - swift: '5.2' - - build - - build-and-test-swift53: - <<: *defaults - macos: - xcode: 12.0.0 - steps: - - checkout - - install_dependencies: - ruby: '2.7' - - pod_update: - swift: '5.3' - - build - - build-and-test-swift55: - <<: *defaults - macos: - xcode: 13.0.0 - steps: - - checkout - - install_dependencies: - ruby: '2.7' - - pod_update: - swift: '5.5' - - build - - build-and-test-swiftpm: - <<: *defaults - macos: - xcode: 11.4.0 - environment: - FL_OUTPUT_DIR: output - steps: - - checkout - - install_dependencies: - ruby: '2.6' - - build_swiftpm - -workflows: - version: 2 - - build-test: - jobs: - - build-gem-cache-26 - - build-gem-cache-27 - - build-and-test-swift51: - requires: - - build-gem-cache-26 - - build-and-test-swift52: - requires: - - build-gem-cache-26 - - build-and-test-swift53: - requires: - - build-gem-cache-27 - - build-and-test-swift55: - requires: - - build-gem-cache-27 - - build-and-test-swiftpm: - requires: - - build-gem-cache-26 diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b77fcc6..f67bf56 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -64,52 +64,50 @@ jobs: run: git clean -ffdxq if: always() continue-on-error: true - - build-and-test-swiftpm: - runs-on: macos-latest + + build-and-test-macOS-14: + runs-on: macos-14 + strategy: + fail-fast: false + matrix: + xcode-version: [15.1,15.4] steps: - name: Checkout uses: actions/checkout@v2 - name: Install dependencies in Gemfile run: bundle install + + - name: Install dependencies in Podfile + working-directory: Example + run: bundle exec pod update - name: Build and run tests - run: | - xcodebuild build \ - -project "Example/SwiftPM/Lasso-SwiftPM/Lasso-SwiftPM.xcodeproj" \ - -scheme "Lasso-SwiftPM" \ - -destination "platform=iOS Simulator,name=iPhone 11" + working-directory: Example + run: bundle exec fastlane scan + env: + DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer - name: Post job cleanup run: git clean -ffdxq if: always() continue-on-error: true - build-and-test-tuist: - runs-on: macos-latest + build-and-test-swiftpm: + runs-on: macos-14 steps: - name: Checkout - uses: actions/checkout@v3 - - - name: Install tuist - run: curl -Ls https://install.tuist.io | bash + uses: actions/checkout@v2 - - name: Clean - working-directory: Example - run: tuist clean + - name: Install dependencies in Gemfile + run: bundle install - - name: Fetch dependencies - working-directory: Example - run: tuist fetch - - - name: Generate project - working-directory: Example - run: tuist generate --no-open - - name: Build and run tests - working-directory: Example - run: tuist test + run: | + xcodebuild build \ + -project "Example/SwiftPM/Lasso-SwiftPM/Lasso-SwiftPM.xcodeproj" \ + -scheme "Lasso-SwiftPM" \ + -destination "platform=iOS Simulator,name=iPhone 14,OS=17.4" - name: Post job cleanup run: git clean -ffdxq diff --git a/Example/LassoTestUtilities_Tests/AssertionTimeoutTests.swift b/Example/LassoTestUtilities_Tests/AssertionTimeoutTests.swift index 56616cd..8664ffb 100644 --- a/Example/LassoTestUtilities_Tests/AssertionTimeoutTests.swift +++ b/Example/LassoTestUtilities_Tests/AssertionTimeoutTests.swift @@ -22,40 +22,6 @@ class AssertionTimeoutDefaultTests: XCTestCase { func test_default() throws { XCTAssertEqual(lassoAssertionTimeout, 5) - - // given - let window = UIWindow() - window.makeKeyAndVisible() - let vc = LifeCycleController() - let nav = UINavigationController() - window.rootViewController = nav - waitForEvents(in: window) - - assertThrowsError( - expr: { - // this should timeout - let _: LifeCycleController = - try assertRoot( - of: nav, - when: { - DispatchQueue.main.async { - Thread.sleep(forTimeInterval: 5.5) - } - DispatchQueue.main.async { - Thread.sleep(forTimeInterval: 1.1) - } - nav.viewControllers = [vc] - }, - failTest: silent - ) - }, - eval: { - switch $0 { - case WaitError.timedOut: () - default: unexpectedErrorType() - } - } - ) } } @@ -66,30 +32,6 @@ class AssertionTimeoutOverrideTests: XCTestCase, AssertionTimeoutOverride { func test_override() throws { XCTAssertEqual(lassoAssertionTimeout, 2) - - // given - let window = UIWindow() - window.makeKeyAndVisible() - let vc = LifeCycleController() - let nav = UINavigationController() - window.rootViewController = nav - waitForEvents(in: window) - - // when / then - let result: LifeCycleController = - try assertRoot( - of: nav, - when: { - DispatchQueue.main.async { - Thread.sleep(forTimeInterval: 1.5) - } - DispatchQueue.main.async { - Thread.sleep(forTimeInterval: 0.1) - } - nav.viewControllers = [vc] - } - ) - XCTAssertTrue(result === vc) } } diff --git a/Example/Project.swift b/Example/Project.swift deleted file mode 100644 index afeba4d..0000000 --- a/Example/Project.swift +++ /dev/null @@ -1,113 +0,0 @@ -import ProjectDescription -import ProjectDescriptionHelpers - -let bundleIdPrefix = "com.weightwatchers." - -let baseSettings: SettingsDictionary = [ - "IPHONEOS_DEPLOYMENT_TARGET": "13.0", - "WATCHOS_DEPLOYMENT_TARGET": "7.1", - - "LastUpgradeCheck": "1330" -] - -let infoPlist: [String: InfoPlist.Value] = [ - "CFBundleShortVersionString": "1.3.0", - "CFBundleVersion": "1" -] - -let defaultSettings: Settings = .settings( - configurations: [ - .debug(name: "Debug", settings: baseSettings), - .release(name: "Release", settings: baseSettings), - .release(name: "AdHoc", settings: baseSettings), - .release(name: "Enterprise", settings: baseSettings), - .release(name: "AppStore", settings: baseSettings) - ] -) - -let lasso: TargetDependency = .project(target: "Lasso", path: "../") -let lassoTestUtilities: TargetDependency = .project(target: "LassoTestUtilities", path: "../") - -let lassoExample = Target( - name: "Lasso_Example", // we need the underscore to match Pod name - platform: .iOS, - product: .app, - bundleId: bundleIdPrefix + "LassoExample", - infoPlist: .extendingDefault(with: infoPlist), - sources: [ - "Lasso/**/*.swift" - ], - resources: [ - "Lasso/Base.lproj/**/*", - "Lasso/Images.xcassets" - ], - dependencies: [ - lasso, - .external(name: "WWLayout") - ] -) - -let lassoTests = Target( - name: "LassoTests", - platform: .iOS, - product: .unitTests, - bundleId: bundleIdPrefix + "LassoTests", - infoPlist: .extendingDefault(with: infoPlist), - sources: [ - "Lasso_Tests/**/*.swift" - ], - dependencies: [ - .target(name: "Lasso_Example"), - lassoTestUtilities - ] -) - -let lassoExampleTests = Target( - name: "LassoExampleTests", - platform: .iOS, - product: .unitTests, - bundleId: bundleIdPrefix + "LassoExampleTests", - infoPlist: .extendingDefault(with: infoPlist), - sources: [ - "Example_Tests/**/*.swift" - ], - dependencies: [ - .target(name: "Lasso_Example"), - lassoTestUtilities - ] -) - -let lassoTestUtilitiesTests = Target( - name: "LassoTestUtilitiesTests", - platform: .iOS, - product: .unitTests, - bundleId: bundleIdPrefix + "LassoTestUtilitiesTests", - infoPlist: .extendingDefault(with: infoPlist), - sources: [ - "LassoTestUtilities_Tests/**/*.swift" - ], - dependencies: [ - .target(name: "Lasso_Example"), - lassoTestUtilities - ] -) - -let project = Project( - name: "LassoTuistExample", - organizationName: "WW Tech", - options: .options(), - packages: [ - ], - - settings: defaultSettings, - - targets: [ - lassoExample, - lassoTests, lassoExampleTests, lassoTestUtilitiesTests - ], - - schemes: [], - fileHeaderTemplate: nil, - additionalFiles: [], - resourceSynthesizers: [] -) diff --git a/Example/Tuist/Config.swift b/Example/Tuist/Config.swift deleted file mode 100644 index 80d8688..0000000 --- a/Example/Tuist/Config.swift +++ /dev/null @@ -1,5 +0,0 @@ -import ProjectDescription - -let config = Config( - generationOptions: .options() -) diff --git a/Example/Tuist/Dependencies.swift b/Example/Tuist/Dependencies.swift deleted file mode 100644 index d78b604..0000000 --- a/Example/Tuist/Dependencies.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// Dependencies.swift -// tuistManifests -// -// Created by Marius Patru on 09.12.2022. -// - -import ProjectDescription - -let dependencies = Dependencies( - carthage: [], - swiftPackageManager: [ - .remote(url: "https://github.com/ww-tech/wwlayout.git", requirement: .upToNextMajor(from: "0.8.0")) - ], - platforms: [.iOS] -) diff --git a/Example/Tuist/ProjectDescriptionHelpers/Project+Templates.swift b/Example/Tuist/ProjectDescriptionHelpers/Project+Templates.swift deleted file mode 100644 index 28bbfc1..0000000 --- a/Example/Tuist/ProjectDescriptionHelpers/Project+Templates.swift +++ /dev/null @@ -1,10 +0,0 @@ -import ProjectDescription - -/// Project helpers are functions that simplify the way you define your project. -/// Share code to create targets, settings, dependencies, -/// Create your own conventions, e.g: a func that makes sure all shared targets are "static frameworks" -/// See https://docs.tuist.io/guides/helpers/ - -extension Project { - -} diff --git a/Package.swift b/Package.swift index 1a429e5..7009304 100644 --- a/Package.swift +++ b/Package.swift @@ -28,7 +28,8 @@ let package = Package( name: "LassoTestUtilities", dependencies: [ .target(name: "Lasso") - ] + ], + linkerSettings: [.linkedFramework("XCTest")] ) ] ) diff --git a/Project.swift b/Project.swift deleted file mode 100644 index a313040..0000000 --- a/Project.swift +++ /dev/null @@ -1,68 +0,0 @@ -import ProjectDescription -import ProjectDescriptionHelpers - -let bundleIdPrefix = "com.weightwatchers." - -let baseSettings: SettingsDictionary = [ - "IPHONEOS_DEPLOYMENT_TARGET": "13.0", - "WATCHOS_DEPLOYMENT_TARGET": "7.1", - - "LastUpgradeCheck": "1330" -] - -let infoPlist: [String: InfoPlist.Value] = [ - "CFBundleShortVersionString": "1.3.0", - "CFBundleVersion": "1" -] - -let defaultSettings: Settings = .settings( - configurations: [ - .debug(name: "Debug", settings: baseSettings), - .release(name: "Release", settings: baseSettings), - .release(name: "AdHoc", settings: baseSettings), - .release(name: "Enterprise", settings: baseSettings), - .release(name: "AppStore", settings: baseSettings) - ] -) - -let lasso = Target( - name: "Lasso", - platform: .iOS, - product: .framework, - bundleId: bundleIdPrefix + "Lasso", - infoPlist: .extendingDefault(with: infoPlist), - sources: [ - "Sources/Lasso/**/*.swift" - ] -) - -let lassoTestUtilities = Target( - name: "LassoTestUtilities", - platform: .iOS, - product: .framework, - bundleId: bundleIdPrefix + "LassoTestUtilities", - infoPlist: .extendingDefault(with: infoPlist), - sources: [ - "Sources/LassoTestUtilities/**/*.swift" - ], - dependencies: [.target(name: "Lasso"), .xctest] -) - -let project = Project( - name: "LassoTuist", - organizationName: "WW Tech", - options: .options(), - packages: [ - ], - - settings: defaultSettings, - - targets: [ - lasso, lassoTestUtilities - ], - - schemes: [], - fileHeaderTemplate: nil, - additionalFiles: [], - resourceSynthesizers: [] -) diff --git a/README.md b/README.md index f70573b..951a5b5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Lasso logo

- - + +

Lasso is an iOS application architecture for building discrete, composable and testable components both big and small - from single one-off screens, through complex flows, to high-level application structures. diff --git a/Sources/LassoTestUtilities/NavigationTesting.swift b/Sources/LassoTestUtilities/NavigationTesting.swift index 1287e17..79d745f 100644 --- a/Sources/LassoTestUtilities/NavigationTesting.swift +++ b/Sources/LassoTestUtilities/NavigationTesting.swift @@ -140,7 +140,7 @@ public extension XCTestCase { throw NavigationPresentationError.unexpectedStackFollowingRootEvent(navigationController: nav) } return root - }, + }, when: event, timeout: timeout, onViewDidLoad: onViewDidLoad, diff --git a/Tuist/Config.swift b/Tuist/Config.swift deleted file mode 100644 index 80d8688..0000000 --- a/Tuist/Config.swift +++ /dev/null @@ -1,5 +0,0 @@ -import ProjectDescription - -let config = Config( - generationOptions: .options() -) diff --git a/Tuist/ProjectDescriptionHelpers/Project+Templates.swift b/Tuist/ProjectDescriptionHelpers/Project+Templates.swift deleted file mode 100644 index 28bbfc1..0000000 --- a/Tuist/ProjectDescriptionHelpers/Project+Templates.swift +++ /dev/null @@ -1,10 +0,0 @@ -import ProjectDescription - -/// Project helpers are functions that simplify the way you define your project. -/// Share code to create targets, settings, dependencies, -/// Create your own conventions, e.g: a func that makes sure all shared targets are "static frameworks" -/// See https://docs.tuist.io/guides/helpers/ - -extension Project { - -}