From d336395899e03ae082bd07c4d6cf901f885e0156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fo=C5=99t?= Date: Sat, 16 Dec 2023 10:07:45 +0100 Subject: [PATCH] Convert rest of acceptance tests to Swift (#5686) * Migrate precompiled, run, and scaffold features * Migrate scaffold, init * Convert rest of Cucumber features to Swift * Skip tvOS acceptance tests --- .github/workflows/tuist.yml | 91 +---- .rubocop.yml | 28 -- .ruby-gemset | 1 - .ruby-version | 1 - .swiftformat | 2 +- Gemfile | 40 --- Gemfile.lock | 293 ---------------- Makefile | 2 - Project.swift | 2 +- .../TuistAcceptanceTestCase+Extra.swift | 81 +++++ .../TuistAcceptanceTestCase.swift | 41 +++ Sources/TuistKit/Commands/EditCommand.swift | 8 +- Sources/TuistKit/Commands/GraphCommand.swift | 10 +- Sources/TuistKit/Commands/ListCommand.swift | 8 +- ...igrationTargetsByDependenciesCommand.swift | 8 +- .../Commands/Plugin/PluginBuildCommand.swift | 8 +- .../Commands/Plugin/PluginRunCommand.swift | 8 +- .../Commands/Plugin/PluginTestCommand.swift | 8 +- Sources/TuistKit/Commands/RunCommand.swift | 8 +- .../TuistKit/Commands/ScaffoldCommand.swift | 18 +- .../BuildRulesAcceptanceTests.swift | 18 + .../DependenciesAcceptanceTests.swift | 16 + .../EditAcceptanceTests.swift | 50 +++ .../GraphAcceptanceTests.swift | 30 ++ .../InitAcceptanceTests.swift | 57 ++++ .../ListTargetsAcceptanceTests.swift | 38 +++ .../PluginAcceptanceTests.swift | 23 ++ .../PrecompiledAcceptanceTests.swift | 102 ++++++ .../RunAcceptanceTests.swift | 13 + .../ScaffoldAcceptanceTests.swift | 144 ++++++++ .../GenerateAcceptanceTests.swift | 77 +---- features/Package.swift | 1 - features/build-rules.feature | 8 - features/dependencies.feature | 18 - features/edit.feature | 25 -- features/graph.feature | 15 - features/init.feature | 50 --- features/list-targets.feature | 12 - features/plugin.feature | 9 - features/plugins.feature | 9 - features/precompiled.feature | 57 ---- features/resources/list-targets-core.json | 16 - features/resources/list-targets-data.json | 16 - .../resources/list-targets-ui-components.json | 16 - features/run.feature | 7 - features/scaffold.feature | 60 ---- features/step_definitions/build.rb | 37 -- features/step_definitions/dependencies.rb | 9 - features/step_definitions/fetch.rb | 6 - features/step_definitions/generate.rb | 187 ---------- features/step_definitions/graph.rb | 14 - features/step_definitions/init.rb | 14 - features/step_definitions/migration.rb | 14 - features/step_definitions/plugin.rb | 13 - features/step_definitions/run.rb | 18 - features/step_definitions/scaffold.rb | 13 - .../shared/developer_environment.rb | 10 - features/step_definitions/shared/fixtures.rb | 11 - features/step_definitions/shared/other.rb | 6 - features/step_definitions/shared/tuist.rb | 149 -------- features/step_definitions/shared/workspace.rb | 18 - features/step_definitions/shared/xcode.rb | 178 ---------- features/step_definitions/tasks.rb | 30 -- features/step_definitions/up.rb | 10 - features/support/assertions.rb | 17 - features/support/system.rb | 31 -- features/support/xcode.rb | 132 ------- features/tasks.feature | 13 - fixtures/command_line_tool_basic/main.swift | 2 +- .../resources/WorkflowExtensionsSDK.pkg | Bin fixtures/tuist_plugin/Package.resolved | 323 +----------------- fixtures/tuist_plugin/Package.swift | 8 +- make/tasks/tuist/acceptance-test.sh | 23 -- 73 files changed, 682 insertions(+), 2157 deletions(-) delete mode 100644 .rubocop.yml delete mode 100644 .ruby-gemset delete mode 100644 .ruby-version delete mode 100644 Gemfile delete mode 100644 Gemfile.lock create mode 100644 Sources/TuistAcceptanceTesting/TuistAcceptanceTestCase+Extra.swift create mode 100644 Tests/TuistAcceptanceTests/BuildRulesAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/DependenciesAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/EditAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/GraphAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/InitAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/ListTargetsAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/PluginAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/PrecompiledAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/RunAcceptanceTests.swift create mode 100644 Tests/TuistAcceptanceTests/ScaffoldAcceptanceTests.swift delete mode 100644 features/Package.swift delete mode 100644 features/build-rules.feature delete mode 100644 features/dependencies.feature delete mode 100644 features/edit.feature delete mode 100644 features/graph.feature delete mode 100644 features/init.feature delete mode 100644 features/list-targets.feature delete mode 100644 features/plugin.feature delete mode 100644 features/plugins.feature delete mode 100644 features/precompiled.feature delete mode 100644 features/resources/list-targets-core.json delete mode 100644 features/resources/list-targets-data.json delete mode 100644 features/resources/list-targets-ui-components.json delete mode 100644 features/run.feature delete mode 100644 features/scaffold.feature delete mode 100644 features/step_definitions/build.rb delete mode 100644 features/step_definitions/dependencies.rb delete mode 100644 features/step_definitions/fetch.rb delete mode 100644 features/step_definitions/generate.rb delete mode 100644 features/step_definitions/graph.rb delete mode 100644 features/step_definitions/init.rb delete mode 100644 features/step_definitions/migration.rb delete mode 100644 features/step_definitions/plugin.rb delete mode 100644 features/step_definitions/run.rb delete mode 100644 features/step_definitions/scaffold.rb delete mode 100644 features/step_definitions/shared/developer_environment.rb delete mode 100644 features/step_definitions/shared/fixtures.rb delete mode 100644 features/step_definitions/shared/other.rb delete mode 100644 features/step_definitions/shared/tuist.rb delete mode 100644 features/step_definitions/shared/workspace.rb delete mode 100644 features/step_definitions/shared/xcode.rb delete mode 100644 features/step_definitions/tasks.rb delete mode 100644 features/step_definitions/up.rb delete mode 100644 features/support/assertions.rb delete mode 100644 features/support/system.rb delete mode 100644 features/support/xcode.rb delete mode 100644 features/tasks.feature rename {features => fixtures}/resources/WorkflowExtensionsSDK.pkg (100%) delete mode 100755 make/tasks/tuist/acceptance-test.sh diff --git a/.github/workflows/tuist.yml b/.github/workflows/tuist.yml index d1acec47a92..bfe7b94f772 100644 --- a/.github/workflows/tuist.yml +++ b/.github/workflows/tuist.yml @@ -15,7 +15,6 @@ on: - '!Sources/**/*.docc' - Templates/** - Tests/** - - features/** - fixtures/** - .package.resolved - .github/workflows/tuist.yml @@ -25,34 +24,9 @@ concurrency: cancel-in-progress: true env: - RUBY_VERSION: '3.0.3' - TUIST_STATS_OPT_OUT: true - NODE_VERSION: 16.17.0 TUIST_CONFIG_CLOUD_TOKEN: ${{ secrets.TUIST_CONFIG_CLOUD_TOKEN }} jobs: - release_build: - name: Release build with Xcode - runs-on: macos-13 - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - name: 'Cache Tuist .build folder' - with: - path: .build - key: ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1-${{ hashFiles('Package.resolved') }}-git-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1-${{ hashFiles('Package.resolved') }} - ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1 - - name: Select Xcode for Tuist and Tuistenv - run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app - - name: Build Tuist for release - run: swift build -c release --product tuist - - name: Build Tuistenv for release - run: swift build -c release --product tuistenv - - name: Build ProjectDescription for release - run: swift build -c release --product ProjectDescription - test: name: Test with Xcode runs-on: macos-13 @@ -72,7 +46,7 @@ jobs: - name: Fetch dependencies run: tuist fetch - name: Test - run: tuist test --no-cache --skip-test-targets TuistBuildAcceptanceTests TuistGenerateAcceptanceTests TuistTestAcceptanceTests + run: tuist test --no-cache --skip-test-targets TuistBuildAcceptanceTests TuistGenerateAcceptanceTests TuistTestAcceptanceTests TuistAcceptanceTests cache-warm: name: Cache warm with latest Tuist @@ -117,7 +91,7 @@ jobs: run: tuist cache warm acceptance_tests: - name: ${{ matrix.feature }} acceptance tests with Tuist + name: Run ${{ matrix.feature }} runs-on: macos-13 env: TUIST_CONFIG_CLOUD_TOKEN: ${{ secrets.TUIST_CONFIG_CLOUD_TOKEN }} @@ -125,9 +99,10 @@ jobs: matrix: feature: [ - 'Build', - 'Generate', - 'Test', + 'TuistAcceptanceTests', + 'TuistBuildAcceptanceTests', + 'TuistGenerateAcceptanceTests', + 'TuistTestAcceptanceTests', ] steps: - uses: actions/checkout@v4 @@ -148,59 +123,7 @@ jobs: - name: Fetch dependencies run: tuist fetch - name: Run acceptance tests - run: tuist test Tuist${{ matrix.feature }}AcceptanceTests - - cucumber_acceptance_tests: - name: ${{ matrix.feature }} acceptance tests with Xcode - runs-on: macos-13 - strategy: - matrix: - feature: - [ - 'dependencies', - 'edit', - 'graph', - 'init', - 'list-targets', - 'plugins', - 'precompiled', - 'run', - 'scaffold', - 'tasks', - 'plugin', - ] - needs: release_build - steps: - - uses: actions/checkout@v3 - - name: Initialize submodules - run: | - git submodule update --init fixtures/tuist_plugin - - name: Select Xcode - run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app - - uses: actions/cache@v3 - name: 'Cache Tuist .build folder' - with: - path: .build - key: ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1-${{ hashFiles('Package.resolved') }}-git-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1-${{ hashFiles('Package.resolved') }} - ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ env.RUBY_VERSION }} - - uses: actions/cache@v3 - with: - path: vendor/bundle - key: ${{ runner.os }}-${{ env.RUBY_VERSION }}-gems-${{ hashFiles('Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.RUBY_VERSION }}-gems- - - name: Bundle install - run: | - bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 - - name: Run cucumber tests - run: FEATURE=features/${{ matrix.feature }}.feature make tuist/acceptance-test - + run: tuist test ${{ matrix.feature }} lint: name: Lint runs-on: macos-13 diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 463b5a60fdb..00000000000 --- a/.rubocop.yml +++ /dev/null @@ -1,28 +0,0 @@ -inherit_gem: - rubocop-shopify: rubocop.yml - rubocop-rails_config: - - config/rails.yml -require: - - rubocop-minitest - - rubocop-rails - -Style/ClassAndModuleChildren: - Enabled: false -Style/RedundantBegin: - Enabled: false -Lint/MissingSuper: - Enabled: false - -AllCops: - NewCops: enable - TargetRubyVersion: 2.5 - DisplayCopNames: true - DisplayStyleGuide: true - Include: - - Gemfile - - Exclude: - - node_modules/**/* - - vendor/**/* - - db/schema.rb - - bin/**/* diff --git a/.ruby-gemset b/.ruby-gemset deleted file mode 100644 index 947c621f74a..00000000000 --- a/.ruby-gemset +++ /dev/null @@ -1 +0,0 @@ -tuist diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 818bd47abfc..00000000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.0.6 diff --git a/.swiftformat b/.swiftformat index bac5e975137..f04934040f2 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,7 +1,7 @@ # file options --symlinks ignore ---exclude Tests/XCTestManifests.swift,features,Sources/TuistSupport/Vendored,fixtures/Targets/SlothCreator,Sources/TuistAutomation/XcodeBuild/XcodeBuildController.swift +--exclude Tests/XCTestManifests.swift,Sources/TuistSupport/Vendored,fixtures/Targets/SlothCreator,Sources/TuistAutomation/XcodeBuild/XcodeBuildController.swift --exclude fixtures/tuist_plugin --disable hoistAwait --disable hoistTry diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 1a09ff17cd0..00000000000 --- a/Gemfile +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gem "cucumber", "~> 6.0" -gem "rake", "~> 13.0" -gem "simctl", "~> 1.6" -gem "google-cloud-storage", "~> 1.31" -gem "colorize", "~> 0.8.1" -gem "xcodeproj", "~> 1.19" -gem "highline", "~> 2.0" -gem "rubyzip", "~> 2.3.0" -gem "ruby-macho", "~> 1.4" -gem "cli-ui", "~> 1.5" -gem "thor", "~> 1.1" -gem "octokit", "~> 4.21" -gem "zeitwerk", "~> 2.4" -gem "cli-kit", "~> 3.3" -gem "semantic", "~> 1.6" -gem "down", "~> 5.2" -gem "ejson", "~> 1.2" - -group :test do - gem "mocha", "~> 1.12" - gem "minitest" - gem "minitest-reporters" -end - -group :development do - gem "rubocop-shopify" - gem "rubocop-minitest", "~> 0.12.1" - gem "rubocop-rake", "~> 0.5.1" - gem "rubocop", "~> 1.14" - gem "rubocop-rails", "~> 2.13.0" - gem "rubocop-rails_config" -end - -group :development, :test do - gem "byebug", "~> 11.1" -end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index c0dc864dc79..00000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,293 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.6) - rexml - actionpack (7.0.5.1) - actionview (= 7.0.5.1) - activesupport (= 7.0.5.1) - rack (~> 2.0, >= 2.2.4) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (7.0.5.1) - activesupport (= 7.0.5.1) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (7.0.5.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - addressable (2.8.4) - public_suffix (>= 2.0.2, < 6.0) - ansi (1.5.0) - ast (2.4.2) - atomos (0.1.3) - builder (3.2.4) - byebug (11.1.3) - claide (1.1.0) - cli-kit (3.3.0) - cli-ui (>= 1.1.4) - cli-ui (1.5.1) - colored2 (3.1.2) - colorize (0.8.1) - concurrent-ruby (1.2.2) - crass (1.0.6) - cucumber (6.1.0) - builder (~> 3.2, >= 3.2.4) - cucumber-core (~> 9.0, >= 9.0.1) - cucumber-create-meta (~> 4.0, >= 4.0.0) - cucumber-cucumber-expressions (~> 12.1, >= 12.1.1) - cucumber-gherkin (~> 18.1, >= 18.1.0) - cucumber-html-formatter (~> 13.0, >= 13.0.0) - cucumber-messages (~> 15.0, >= 15.0.0) - cucumber-wire (~> 5.0, >= 5.0.1) - diff-lcs (~> 1.4, >= 1.4.4) - mime-types (~> 3.3, >= 3.3.1) - multi_test (~> 0.1, >= 0.1.2) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-core (9.0.1) - cucumber-gherkin (~> 18.1, >= 18.1.0) - cucumber-messages (~> 15.0, >= 15.0.0) - cucumber-tag-expressions (~> 3.0, >= 3.0.1) - cucumber-create-meta (4.0.0) - cucumber-messages (~> 15.0, >= 15.0.0) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-cucumber-expressions (12.1.3) - cucumber-gherkin (18.1.1) - cucumber-messages (~> 15.0, >= 15.0.0) - cucumber-html-formatter (13.0.0) - cucumber-messages (~> 15.0, >= 15.0.0) - cucumber-messages (15.0.0) - protobuf-cucumber (~> 3.10, >= 3.10.8) - cucumber-tag-expressions (3.0.1) - cucumber-wire (5.0.1) - cucumber-core (~> 9.0, >= 9.0.1) - cucumber-cucumber-expressions (~> 12.1, >= 12.1.1) - cucumber-messages (~> 15.0, >= 15.0.0) - declarative (0.0.20) - diff-lcs (1.5.0) - digest-crc (0.6.4) - rake (>= 12.0.0, < 14.0.0) - down (5.4.1) - addressable (~> 2.8) - ejson (1.3.1) - erubi (1.12.0) - faraday (2.7.7) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - ffi (1.15.5) - google-apis-core (0.11.0) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.17.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.19.0) - google-apis-core (>= 0.9.0, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.1) - google-cloud-storage (1.44.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.19.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.6.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - highline (2.1.0) - httpclient (2.8.3) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - json (2.6.3) - jwt (2.7.1) - language_server-protocol (3.17.0.3) - loofah (2.21.3) - crass (~> 1.0.2) - nokogiri (>= 1.12.0) - memoist (0.16.2) - method_source (1.0.0) - middleware (0.1.0) - mime-types (3.4.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.0218.1) - mini_mime (1.1.2) - mini_portile2 (2.8.2) - minitest (5.18.1) - minitest-reporters (1.6.0) - ansi - builder - minitest (>= 5.0) - ruby-progressbar - mocha (1.16.1) - multi_json (1.15.0) - multi_test (0.1.2) - nanaimo (0.3.0) - naturally (2.2.1) - nokogiri (1.15.2) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) - octokit (4.25.1) - faraday (>= 1, < 3) - sawyer (~> 0.9) - os (1.1.4) - parallel (1.23.0) - parser (3.2.2.3) - ast (~> 2.4.1) - racc - protobuf-cucumber (3.10.8) - activesupport (>= 3.2) - middleware - thor - thread_safe - public_suffix (5.0.1) - racc (1.7.1) - rack (2.2.7) - rack-test (2.1.0) - rack (>= 1.3) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - railties (7.0.5.1) - actionpack (= 7.0.5.1) - activesupport (= 7.0.5.1) - method_source - rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.8.1) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rexml (3.2.5) - rubocop (1.53.0) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.2.2.3) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-minitest (0.12.1) - rubocop (>= 0.90, < 2.0) - rubocop-packaging (0.5.2) - rubocop (>= 1.33, < 2.0) - rubocop-performance (1.18.0) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.13.2) - activesupport (>= 4.2.0) - rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-rails_config (1.6.1) - railties (>= 5.0) - rubocop (>= 1.18) - rubocop-ast (>= 1.0.1) - rubocop-packaging (~> 0.5) - rubocop-performance (~> 1.11) - rubocop-rails (~> 2.0) - rubocop-rake (0.5.1) - rubocop - rubocop-shopify (2.14.0) - rubocop (~> 1.51) - ruby-macho (1.4.0) - ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - sawyer (0.9.2) - addressable (>= 2.3.5) - faraday (>= 0.17.3, < 3) - semantic (1.6.1) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simctl (1.6.10) - CFPropertyList - naturally - sys-uname (1.2.3) - ffi (~> 1.1) - thor (1.2.2) - thread_safe (0.3.6) - trailblazer-option (0.1.2) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - uber (0.1.0) - unicode-display_width (2.4.2) - webrick (1.8.1) - xcodeproj (1.22.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - zeitwerk (2.6.8) - -PLATFORMS - ruby - -DEPENDENCIES - byebug (~> 11.1) - cli-kit (~> 3.3) - cli-ui (~> 1.5) - colorize (~> 0.8.1) - cucumber (~> 6.0) - down (~> 5.2) - ejson (~> 1.2) - google-cloud-storage (~> 1.31) - highline (~> 2.0) - minitest - minitest-reporters - mocha (~> 1.12) - octokit (~> 4.21) - rake (~> 13.0) - rubocop (~> 1.14) - rubocop-minitest (~> 0.12.1) - rubocop-rails (~> 2.13.0) - rubocop-rails_config - rubocop-rake (~> 0.5.1) - rubocop-shopify - ruby-macho (~> 1.4) - rubyzip (~> 2.3.0) - semantic (~> 1.6) - simctl (~> 1.6) - thor (~> 1.1) - xcodeproj (~> 1.19) - zeitwerk (~> 2.4) - -BUNDLED WITH - 2.2.33 diff --git a/Makefile b/Makefile index 16f1346c45b..bd4f8c73329 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,6 @@ tuist/test: ./make/tasks/tuist/test.sh $(ARGS) tuist/run: ./make/tasks/tuist/run.sh $(ARGS) -tuist/acceptance-test: - ./make/tasks/tuist/acceptance-test.sh # Shared workspace/lint: diff --git a/Project.swift b/Project.swift index 2849fbf0f74..d279b334cfa 100644 --- a/Project.swift +++ b/Project.swift @@ -504,7 +504,7 @@ func targets() -> [Target] { ] } -let acceptanceTests: [(target: Target, scheme: Scheme)] = ["Build", "Generate", "Test"].map { +let acceptanceTests: [(target: Target, scheme: Scheme)] = ["", "Build", "Generate", "Test"].map { ( target: .target( name: "Tuist\($0)AcceptanceTests", diff --git a/Sources/TuistAcceptanceTesting/TuistAcceptanceTestCase+Extra.swift b/Sources/TuistAcceptanceTesting/TuistAcceptanceTestCase+Extra.swift new file mode 100644 index 00000000000..21f96af0ed0 --- /dev/null +++ b/Sources/TuistAcceptanceTesting/TuistAcceptanceTestCase+Extra.swift @@ -0,0 +1,81 @@ +import TSCBasic +import TuistSupport +import XcodeProj +import XCTest + +extension TuistAcceptanceTestCase { + private func headers( + for productName: String, + destination: String + ) throws -> [AbsolutePath] { + let productPath = try productPath(for: productName, destination: destination) + return FileHandler.shared.glob(productPath, glob: "**/*.h") + } + + public func productPath( + for name: String, + destination: String + ) throws -> AbsolutePath { + try XCTUnwrap( + FileHandler.shared.glob(derivedDataPath, glob: "**/Build/**/Products/\(destination)/\(name)/").first + ) + } + + public func XCTUnwrapTarget( + _ targetName: String, + in xcodeproj: XcodeProj, + file: StaticString = #file, + line: UInt = #line + ) throws -> PBXTarget { + let targets = xcodeproj.pbxproj.projects.flatMap(\.targets) + guard let target = targets.first(where: { $0.name == targetName }) + else { + XCTFail( + "Target \(targetName) doesn't exist in any of the projects' targets of the workspace", + file: file, + line: line + ) + throw XCTUnwrapError.nilValueDetected + } + + return target + } + + public func XCTAssertProductWithDestinationDoesNotContainHeaders( + _ product: String, + destination: String, + file: StaticString = #file, + line: UInt = #line + ) throws { + if try !headers(for: product, destination: destination).isEmpty { + XCTFail("Product with name \(product) and destination \(destination) contains headers", file: file, line: line) + } + } + + public func XCTAssertFrameworkEmbedded( + _ framework: String, + by targetName: String, + file: StaticString = #file, + line: UInt = #line + ) throws { + let xcodeproj = try XcodeProj(pathString: xcodeprojPath.pathString) + let target = try XCTUnwrapTarget(targetName, in: xcodeproj) + + let xcframeworkDependencies = target.embedFrameworksBuildPhases() + .filter { $0.dstSubfolderSpec == .frameworks } + .map(\.files) + .compactMap { $0 } + .flatMap { $0 } + .compactMap(\.file?.nameOrPath) + .filter { $0.contains(".framework") } + guard xcframeworkDependencies.contains("\(framework).framework") + else { + XCTFail( + "Target \(targetName) doesn't link the framework \(framework)", + file: file, + line: line + ) + return + } + } +} diff --git a/Sources/TuistAcceptanceTesting/TuistAcceptanceTestCase.swift b/Sources/TuistAcceptanceTesting/TuistAcceptanceTestCase.swift index 58a45abc918..9da31bb073e 100644 --- a/Sources/TuistAcceptanceTesting/TuistAcceptanceTestCase.swift +++ b/Sources/TuistAcceptanceTesting/TuistAcceptanceTestCase.swift @@ -78,6 +78,47 @@ open class TuistAcceptanceTestCase: XCTestCase { try await parsedCommand.run() } + public func run(_ command: RunCommand.Type, _ arguments: String...) async throws { + try await run(command, arguments) + } + + public func run(_ command: RunCommand.Type, _ arguments: [String] = []) async throws { + let arguments = [ + "--path", fixturePath.pathString, + ] + arguments + + let parsedCommand = try command.parse(arguments) + try await parsedCommand.run() + } + + public func run(_ command: EditCommand.Type, _ arguments: String...) async throws { + try await run(command, arguments) + } + + public func run(_ command: EditCommand.Type, _ arguments: [String] = []) async throws { + let arguments = arguments + [ + "--path", fixturePath.pathString, + "--permanent", + ] + + let parsedCommand = try command.parse(arguments) + try await parsedCommand.run() + + xcodeprojPath = try FileHandler.shared.contentsOfDirectory(fixturePath) + .first(where: { $0.basename == "Manifests.xcodeproj" }) + workspacePath = try FileHandler.shared.contentsOfDirectory(fixturePath) + .first(where: { $0.basename == "Manifests.xcworkspace" }) + } + + public func run(_ command: MigrationTargetsByDependenciesCommand.Type, _ arguments: String...) throws { + try run(command, arguments) + } + + public func run(_ command: MigrationTargetsByDependenciesCommand.Type, _ arguments: [String] = []) throws { + let parsedCommand = try command.parse(arguments) + try parsedCommand.run() + } + public func run(_ command: TestCommand.Type, _ arguments: [String] = []) async throws { let arguments = arguments + [ "--derived-data-path", derivedDataPath.pathString, diff --git a/Sources/TuistKit/Commands/EditCommand.swift b/Sources/TuistKit/Commands/EditCommand.swift index cac4742ef11..649836850c9 100644 --- a/Sources/TuistKit/Commands/EditCommand.swift +++ b/Sources/TuistKit/Commands/EditCommand.swift @@ -4,8 +4,10 @@ import TSCBasic import TuistGenerator import TuistSupport -struct EditCommand: AsyncParsableCommand { - static var configuration: CommandConfiguration { +public struct EditCommand: AsyncParsableCommand { + public init() {} + + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "edit", abstract: "Generates a temporary project to edit the project in the current directory" @@ -31,7 +33,7 @@ struct EditCommand: AsyncParsableCommand { ) var onlyCurrentDirectory: Bool = false - func run() async throws { + public func run() async throws { try await EditService().run( path: path, permanent: permanent, diff --git a/Sources/TuistKit/Commands/GraphCommand.swift b/Sources/TuistKit/Commands/GraphCommand.swift index 4057a323cba..4b96ec6e764 100644 --- a/Sources/TuistKit/Commands/GraphCommand.swift +++ b/Sources/TuistKit/Commands/GraphCommand.swift @@ -9,10 +9,12 @@ import TuistLoader import TuistSupport /// Command that generates and exports a dot graph from the workspace or project in the current directory. -struct GraphCommand: AsyncParsableCommand, HasTrackableParameters { - static var analyticsDelegate: TrackableParametersDelegate? +public struct GraphCommand: AsyncParsableCommand, HasTrackableParameters { + public init() {} - static var configuration: CommandConfiguration { + public static var analyticsDelegate: TrackableParametersDelegate? + + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "graph", abstract: "Generates a graph from the workspace or project in the current directory" @@ -71,7 +73,7 @@ struct GraphCommand: AsyncParsableCommand, HasTrackableParameters { ) var outputPath: String? - func run() async throws { + public func run() async throws { GraphCommand.analyticsDelegate?.addParameters( [ "format": AnyCodable(format.rawValue), diff --git a/Sources/TuistKit/Commands/ListCommand.swift b/Sources/TuistKit/Commands/ListCommand.swift index effc8c7d258..4f59861ca74 100644 --- a/Sources/TuistKit/Commands/ListCommand.swift +++ b/Sources/TuistKit/Commands/ListCommand.swift @@ -1,8 +1,10 @@ import ArgumentParser import Foundation -struct ListCommand: AsyncParsableCommand { - static var configuration: CommandConfiguration { +public struct ListCommand: AsyncParsableCommand { + public init() {} + + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "list", _superCommandName: "scaffold", @@ -23,7 +25,7 @@ struct ListCommand: AsyncParsableCommand { ) var path: String? - func run() async throws { + public func run() async throws { let format: ListService.OutputFormat = json ? .json : .table try await ListService().run( path: path, diff --git a/Sources/TuistKit/Commands/Migration/MigrationTargetsByDependenciesCommand.swift b/Sources/TuistKit/Commands/Migration/MigrationTargetsByDependenciesCommand.swift index 4d5827f726a..243d9cef8c0 100644 --- a/Sources/TuistKit/Commands/Migration/MigrationTargetsByDependenciesCommand.swift +++ b/Sources/TuistKit/Commands/Migration/MigrationTargetsByDependenciesCommand.swift @@ -3,8 +3,10 @@ import Foundation import TSCBasic import TuistSupport -struct MigrationTargetsByDependenciesCommand: ParsableCommand { - static var configuration: CommandConfiguration { +public struct MigrationTargetsByDependenciesCommand: ParsableCommand { + public init() {} + + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "list-targets", _superCommandName: "migration", @@ -19,7 +21,7 @@ struct MigrationTargetsByDependenciesCommand: ParsableCommand { ) var xcodeprojPath: String - func run() throws { + public func run() throws { try MigrationTargetsByDependenciesService() .run(xcodeprojPath: try AbsolutePath(validating: xcodeprojPath, relativeTo: FileHandler.shared.currentPath)) } diff --git a/Sources/TuistKit/Commands/Plugin/PluginBuildCommand.swift b/Sources/TuistKit/Commands/Plugin/PluginBuildCommand.swift index f4261e3fd4a..108d8aa80f5 100644 --- a/Sources/TuistKit/Commands/Plugin/PluginBuildCommand.swift +++ b/Sources/TuistKit/Commands/Plugin/PluginBuildCommand.swift @@ -2,8 +2,10 @@ import ArgumentParser import Foundation import TSCBasic -struct PluginBuildCommand: ParsableCommand { - static var configuration: CommandConfiguration { +public struct PluginBuildCommand: ParsableCommand { + public init() {} + + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "build", abstract: "Builds a plugin." @@ -33,7 +35,7 @@ struct PluginBuildCommand: ParsableCommand { ) var products: [String] = [] - func run() throws { + public func run() throws { try PluginBuildService().run( path: pluginOptions.path, configuration: pluginOptions.configuration, diff --git a/Sources/TuistKit/Commands/Plugin/PluginRunCommand.swift b/Sources/TuistKit/Commands/Plugin/PluginRunCommand.swift index 4a4503b938f..34c27eebc4a 100644 --- a/Sources/TuistKit/Commands/Plugin/PluginRunCommand.swift +++ b/Sources/TuistKit/Commands/Plugin/PluginRunCommand.swift @@ -2,8 +2,10 @@ import ArgumentParser import Foundation import TSCBasic -struct PluginRunCommand: ParsableCommand { - static var configuration: CommandConfiguration { +public struct PluginRunCommand: ParsableCommand { + public init() {} + + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "run", abstract: "Runs a plugin." @@ -33,7 +35,7 @@ struct PluginRunCommand: ParsableCommand { ) var arguments: [String] = [] - func run() throws { + public func run() throws { try PluginRunService().run( path: pluginOptions.path, configuration: pluginOptions.configuration, diff --git a/Sources/TuistKit/Commands/Plugin/PluginTestCommand.swift b/Sources/TuistKit/Commands/Plugin/PluginTestCommand.swift index 9a41044cef1..76da4a1cdf5 100644 --- a/Sources/TuistKit/Commands/Plugin/PluginTestCommand.swift +++ b/Sources/TuistKit/Commands/Plugin/PluginTestCommand.swift @@ -2,8 +2,10 @@ import ArgumentParser import Foundation import TSCBasic -struct PluginTestCommand: ParsableCommand { - static var configuration: CommandConfiguration { +public struct PluginTestCommand: ParsableCommand { + public init() {} + + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "test", abstract: "Tests a plugin." @@ -23,7 +25,7 @@ struct PluginTestCommand: ParsableCommand { ) var testProducts: [String] = [] - func run() throws { + public func run() throws { try PluginTestService().run( path: pluginOptions.path, configuration: pluginOptions.configuration, diff --git a/Sources/TuistKit/Commands/RunCommand.swift b/Sources/TuistKit/Commands/RunCommand.swift index e6829f0fc80..970b64585dc 100644 --- a/Sources/TuistKit/Commands/RunCommand.swift +++ b/Sources/TuistKit/Commands/RunCommand.swift @@ -3,8 +3,10 @@ import Foundation import TSCBasic import TuistSupport -struct RunCommand: AsyncParsableCommand { - static var configuration: CommandConfiguration { +public struct RunCommand: AsyncParsableCommand { + public init() {} + + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "run", abstract: "Runs a scheme or target in the project", @@ -70,7 +72,7 @@ struct RunCommand: AsyncParsableCommand { ) var rawXcodebuildLogs: Bool = false - func run() async throws { + public func run() async throws { try await RunService().run( path: path, schemeName: scheme, diff --git a/Sources/TuistKit/Commands/ScaffoldCommand.swift b/Sources/TuistKit/Commands/ScaffoldCommand.swift index 983e3d93864..601e18be46d 100644 --- a/Sources/TuistKit/Commands/ScaffoldCommand.swift +++ b/Sources/TuistKit/Commands/ScaffoldCommand.swift @@ -25,8 +25,8 @@ enum ScaffoldCommandError: FatalError, Equatable { } } -struct ScaffoldCommand: AsyncParsableCommand { - static var configuration: CommandConfiguration { +public struct ScaffoldCommand: AsyncParsableCommand { + public static var configuration: CommandConfiguration { CommandConfiguration( commandName: "scaffold", abstract: "Generates new project based on a template", @@ -54,10 +54,10 @@ struct ScaffoldCommand: AsyncParsableCommand { var requiredTemplateOptions: [String: String] = [:] var optionalTemplateOptions: [String: String?] = [:] - init() {} + public init() {} // Custom decoding to decode dynamic options - init(from decoder: Decoder) throws { + public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) template = try container.decode(Argument.self, forKey: .template).wrappedValue json = try container.decodeIfPresent(Option.self, forKey: .json)?.wrappedValue ?? false @@ -76,7 +76,7 @@ struct ScaffoldCommand: AsyncParsableCommand { } } - func run() async throws { + public func run() async throws { // Currently, @Argument and subcommand clashes, so we need to handle that ourselves if template == ListCommand.configuration.commandName { let format: ListService.OutputFormat = json ? .json : .table @@ -95,11 +95,11 @@ struct ScaffoldCommand: AsyncParsableCommand { // MARK: - Preprocessing extension ScaffoldCommand { - static var requiredTemplateOptions: [(name: String, option: Option)] = [] - static var optionalTemplateOptions: [(name: String, option: Option)] = [] + public static var requiredTemplateOptions: [(name: String, option: Option)] = [] + public static var optionalTemplateOptions: [(name: String, option: Option)] = [] /// We do not know template's option in advance -> we need to dynamically add them - static func preprocess(_ arguments: [String]? = nil) async throws { + public static func preprocess(_ arguments: [String]? = nil) async throws { guard let arguments, arguments.count >= 2 else { throw ScaffoldCommandError.templateNotProvided } @@ -184,7 +184,7 @@ extension ScaffoldCommand { /// ArgumentParser library gets the list of options from a mirror /// Since we do not declare template's options in advance, we need to rewrite the mirror implementation and add them ourselves extension ScaffoldCommand: CustomReflectable { - var customMirror: Mirror { + public var customMirror: Mirror { let requiredTemplateChildren = ScaffoldCommand.requiredTemplateOptions .map { Mirror.Child(label: $0.name, value: $0.option) } let optionalTemplateChildren = ScaffoldCommand.optionalTemplateOptions diff --git a/Tests/TuistAcceptanceTests/BuildRulesAcceptanceTests.swift b/Tests/TuistAcceptanceTests/BuildRulesAcceptanceTests.swift new file mode 100644 index 00000000000..2f25f923f13 --- /dev/null +++ b/Tests/TuistAcceptanceTests/BuildRulesAcceptanceTests.swift @@ -0,0 +1,18 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +final class BuildRulesAcceptanceTestAppWithBuildRules: TuistAcceptanceTestCase { + func test_app_with_build_rules() async throws { + try setUpFixture("app_with_build_rules") + try await run(GenerateCommand.self) + try await run(BuildCommand.self) + let xcodeproj = try XcodeProj(pathString: xcodeprojPath.pathString) + let target = try XCTUnwrapTarget("App", in: xcodeproj) + let buildRule = try XCTUnwrap(target.buildRules.first(where: { $0.name == "Process_InfoPlist.strings" })) + XCTAssertEqual(buildRule.filePatterns, "*/InfoPlist.strings") + } +} diff --git a/Tests/TuistAcceptanceTests/DependenciesAcceptanceTests.swift b/Tests/TuistAcceptanceTests/DependenciesAcceptanceTests.swift new file mode 100644 index 00000000000..2abcb46ea9e --- /dev/null +++ b/Tests/TuistAcceptanceTests/DependenciesAcceptanceTests.swift @@ -0,0 +1,16 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +// TODO: This acceptance test takes too long to build +// final class DependenciesAcceptanceTestAppWithSPMDependencies: TuistAcceptanceTestCase { +// func test_ios_app_with_helpers() async throws { +// try setUpFixture("app_with_spm_dependencies") +// try await run(FetchCommand.self) +// try await run(GenerateCommand.self) +// try await run(BuildCommand.self) +// } +// } diff --git a/Tests/TuistAcceptanceTests/EditAcceptanceTests.swift b/Tests/TuistAcceptanceTests/EditAcceptanceTests.swift new file mode 100644 index 00000000000..ce18df9190d --- /dev/null +++ b/Tests/TuistAcceptanceTests/EditAcceptanceTests.swift @@ -0,0 +1,50 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +final class EditAcceptanceTestiOSAppWithHelpers: TuistAcceptanceTestCase { + func test_ios_app_with_helpers() async throws { + try setUpFixture("ios_app_with_helpers") + try await run(EditCommand.self) + try build(scheme: "Manifests") + } +} + +final class EditAcceptanceTestPlugin: TuistAcceptanceTestCase { + func test_plugin() async throws { + try setUpFixture("plugin") + try await run(EditCommand.self) + try build(scheme: "Plugins") + } +} + +final class EditAcceptanceTestAppWithPlugins: TuistAcceptanceTestCase { + func test_app_with_plugins() async throws { + try setUpFixture("app_with_plugins") + try await run(FetchCommand.self) + try await run(EditCommand.self) + try build(scheme: "Manifests") + try build(scheme: "Plugins") + try build(scheme: "LocalPlugin") + } +} + +extension TuistAcceptanceTestCase { + fileprivate func build(scheme: String) throws { + try System.shared.runAndPrint( + [ + "/usr/bin/xcrun", + "xcodebuild", + "clean", + "build", + "-scheme", + scheme, + "-workspace", + workspacePath.pathString, + ] + ) + } +} diff --git a/Tests/TuistAcceptanceTests/GraphAcceptanceTests.swift b/Tests/TuistAcceptanceTests/GraphAcceptanceTests.swift new file mode 100644 index 00000000000..1c35777faf2 --- /dev/null +++ b/Tests/TuistAcceptanceTests/GraphAcceptanceTests.swift @@ -0,0 +1,30 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +// TODO: Fix (issues with finding executables) +// final class GraphAcceptanceTestiOSWorkspaceWithMicrofeatureArchitecture: TuistAcceptanceTestCase { +// func test_ios_workspace_with_microfeature_architecture() async throws { +// try setUpFixture("ios_workspace_with_microfeature_architecture") +// try await run(GraphCommand.self, "--output-path", fixturePath.pathString) +// let graphFile = fixturePath.appending(component: "graph.png") +// try System.shared.runAndPrint( +// [ +// "file", +// graphFile.pathString, +// ] +// ) +// try FileHandler.shared.delete(graphFile) +// +// try await run(GraphCommand.self, "--output-path", fixturePath.pathString, "Data") +// try System.shared.runAndPrint( +// [ +// "file", +// graphFile.pathString, +// ] +// ) +// } +// } diff --git a/Tests/TuistAcceptanceTests/InitAcceptanceTests.swift b/Tests/TuistAcceptanceTests/InitAcceptanceTests.swift new file mode 100644 index 00000000000..8379f30d69b --- /dev/null +++ b/Tests/TuistAcceptanceTests/InitAcceptanceTests.swift @@ -0,0 +1,57 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +final class InitAcceptanceTestmacOSApp: TuistAcceptanceTestCase { + func test_init_macos_app() async throws { + try run(InitCommand.self, "--platform", "macos", "--name", "Test") + try await run(BuildCommand.self) + } +} + +final class InitAcceptanceTestiOSApp: TuistAcceptanceTestCase { + func test_init_ios_app() async throws { + try run(InitCommand.self, "--platform", "ios", "--name", "My-App") + try await run(BuildCommand.self) + } +} + +// TODO: Fix +// final class InitAcceptanceTesttvOSApp: TuistAcceptanceTestCase { +// func test_init_tvos_app() async throws { +// try run(InitCommand.self, "--platform", "tvos", "--name", "TvApp") +// try await run(BuildCommand.self) +// } +// } + +final class InitAcceptanceTestSwiftUIiOSApp: TuistAcceptanceTestCase { + func test_init_swift_ui_ios_app() async throws { + try run(InitCommand.self, "--platform", "ios", "--name", "MyApp", "--template", "swiftui") + try await run(BuildCommand.self) + } +} + +final class InitAcceptanceTestSwiftUImacOSApp: TuistAcceptanceTestCase { + func test_init_swift_ui_macos_app() async throws { + try run(InitCommand.self, "--platform", "macos", "--name", "MyApp", "--template", "swiftui") + try await run(BuildCommand.self) + } +} + +// TODO: Fix +// final class InitAcceptanceTestSwiftUtvOSApp: TuistAcceptanceTestCase { +// func test_init_swift_ui_tvos_app() async throws { +// try run(InitCommand.self, "--platform", "tvos", "--name", "MyApp", "--template", "swiftui") +// try await run(BuildCommand.self) +// } +// } + +final class InitAcceptanceTestCLIProjectWithTemplateInADifferentRepository: TuistAcceptanceTestCase { + func test_cli_project_with_template_in_a_different_repository() async throws { + try run(InitCommand.self, "--template", "https://github.com/tuist/ExampleTuistTemplate.git", "--name", "MyApp") + try await run(BuildCommand.self) + } +} diff --git a/Tests/TuistAcceptanceTests/ListTargetsAcceptanceTests.swift b/Tests/TuistAcceptanceTests/ListTargetsAcceptanceTests.swift new file mode 100644 index 00000000000..144881cefc4 --- /dev/null +++ b/Tests/TuistAcceptanceTests/ListTargetsAcceptanceTests.swift @@ -0,0 +1,38 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +final class ListTargetsAcceptanceTestiOSWorkspaceWithMicrofeatureArchitecture: TuistAcceptanceTestCase { + func test_ios_workspace_with_microfeature_architecture() async throws { + try setUpFixture("ios_workspace_with_microfeature_architecture") + try await run(GenerateCommand.self) + try listTargets(for: "UIComponents") + try listTargets(for: "Core") + try listTargets(for: "Data") + } +} + +extension TuistAcceptanceTestCase { + fileprivate func listTargets( + for framework: String + ) throws { + let frameworkXcodeprojPath = fixturePath.appending( + components: [ + "Frameworks", + "\(framework)Framework", + "\(framework).xcodeproj", + ] + ) + + try run(MigrationTargetsByDependenciesCommand.self, "-p", frameworkXcodeprojPath.pathString) + XCTAssertStandardOutput( + pattern: + """ + "targetName" : "\(framework)" + """ + ) + } +} diff --git a/Tests/TuistAcceptanceTests/PluginAcceptanceTests.swift b/Tests/TuistAcceptanceTests/PluginAcceptanceTests.swift new file mode 100644 index 00000000000..416df7d2990 --- /dev/null +++ b/Tests/TuistAcceptanceTests/PluginAcceptanceTests.swift @@ -0,0 +1,23 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +final class PluginAcceptanceTestTuistPlugin: TuistAcceptanceTestCase { + func test_tuist_plugin() async throws { + try setUpFixture("tuist_plugin") + try run(PluginBuildCommand.self) + try run(PluginRunCommand.self, "tuist-create-file") + } +} + +final class PluginAcceptanceTestAppWithPlugins: TuistAcceptanceTestCase { + func test_app_with_plugins() async throws { + try setUpFixture("app_with_plugins") + try await run(FetchCommand.self) + try await run(GenerateCommand.self) + try await run(BuildCommand.self) + } +} diff --git a/Tests/TuistAcceptanceTests/PrecompiledAcceptanceTests.swift b/Tests/TuistAcceptanceTests/PrecompiledAcceptanceTests.swift new file mode 100644 index 00000000000..8b8f4d7244a --- /dev/null +++ b/Tests/TuistAcceptanceTests/PrecompiledAcceptanceTests.swift @@ -0,0 +1,102 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +final class PrecomiledAcceptanceTestiOSAppWithStaticFrameworks: TuistAcceptanceTestCase { + func test_ios_app_with_static_frameworks() async throws { + try setUpFixture("ios_app_with_static_frameworks") + try await run(GenerateCommand.self) + try await run(BuildCommand.self) + } +} + +final class PrecomiledAcceptanceTestiOSAppWithStaticLibraries: TuistAcceptanceTestCase { + func test_ios_app_with_static_libraries() async throws { + try setUpFixture("ios_app_with_static_libraries") + try await run(GenerateCommand.self) + try await run(BuildCommand.self) + } +} + +final class PrecomiledAcceptanceTestiOSAppWithTransitiveFramework: TuistAcceptanceTestCase { + func test_ios_app_with_transitive_framework() async throws { + try setUpFixture("ios_app_with_transitive_framework") + try await run(GenerateCommand.self) + try await run(BuildCommand.self, "App", "--platform", "iOS") + try await XCTAssertProductWithDestinationContainsFrameworkWithArchitecture( + framework: "Framework1", + architecture: "x86_64" + ) + try XCTAssertProductWithDestinationDoesNotContainHeaders( + "App.app", + destination: "Debug-iphonesimulator" + ) + try await run(BuildCommand.self, "Framework1-iOS", "--platform", "iOS") + try await run(BuildCommand.self, "Framework1-macOS", "--platform", "macOS") + try await run(BuildCommand.self, "Framework1Tests-iOS", "--platform", "iOS") + try await run(BuildCommand.self, "Framework1Tests-macOS", "--platform", "macOS") + try await run(BuildCommand.self, "StaticFramework1", "--platform", "iOS") + } +} + +final class PrecompiledAcceptanceTestiOSAppWithStaticLibraryAndPackage: TuistAcceptanceTestCase { + func test_ios_app_with_static_library_and_package() async throws { + try setUpFixture("ios_app_with_static_library_and_package") + try await run(GenerateCommand.self) + try await run(BuildCommand.self) + } +} + +final class PrecompiledAcceptanceTestiOSAppWithXCFrameworks: TuistAcceptanceTestCase { + func test_ios_app_with_xcframeworks() async throws { + try setUpFixture("ios_app_with_xcframeworks") + try await run(GenerateCommand.self) + try await run(BuildCommand.self) + try await XCTAssertProductWithDestinationContainsFrameworkWithArchitecture( + framework: "MyFramework", + architecture: "x86_64" + ) + try XCTAssertProductWithDestinationDoesNotContainHeaders( + "App.app", + destination: "Debug-iphonesimulator" + ) + } +} + +extension TuistAcceptanceTestCase { + func XCTAssertProductWithDestinationContainsFrameworkWithArchitecture( + _ product: String = "App.app", + destination: String = "Debug-iphonesimulator", + framework: String, + architecture: String, + file: StaticString = #file, + line: UInt = #line + ) async throws { + let productPath = try productPath( + for: product, + destination: destination + ) + + guard let frameworkPath = FileHandler.shared.glob(productPath, glob: "**/Frameworks/\(framework).framework").first, + FileHandler.shared.exists(frameworkPath) + else { + XCTFail( + "Framework \(framework) not found for product \(product) and destination \(destination)", + file: file, + line: line + ) + return + } + + let fileInfo = try await System.shared.runAndCollectOutput( + [ + "file", + frameworkPath.appending(component: framework).pathString, + ] + ) + XCTAssertTrue(fileInfo.standardOutput.contains(architecture)) + } +} diff --git a/Tests/TuistAcceptanceTests/RunAcceptanceTests.swift b/Tests/TuistAcceptanceTests/RunAcceptanceTests.swift new file mode 100644 index 00000000000..011c1567df0 --- /dev/null +++ b/Tests/TuistAcceptanceTests/RunAcceptanceTests.swift @@ -0,0 +1,13 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +final class RunAcceptanceTestCommandLineToolBasic: TuistAcceptanceTestCase { + func test_command_line_tool_basic() async throws { + try setUpFixture("command_line_tool_basic") + try await run(RunCommand.self, "CommandLineTool") + } +} diff --git a/Tests/TuistAcceptanceTests/ScaffoldAcceptanceTests.swift b/Tests/TuistAcceptanceTests/ScaffoldAcceptanceTests.swift new file mode 100644 index 00000000000..7b250a813d6 --- /dev/null +++ b/Tests/TuistAcceptanceTests/ScaffoldAcceptanceTests.swift @@ -0,0 +1,144 @@ +import TSCBasic +import TuistAcceptanceTesting +import TuistSupport +import TuistSupportTesting +import XcodeProj +import XCTest + +final class ScaffoldAcceptanceTests: TuistAcceptanceTestCase { + override func tearDown() { + ScaffoldCommand.requiredTemplateOptions = [] + ScaffoldCommand.optionalTemplateOptions = [] + super.tearDown() + } + + func test_ios_app_with_templates_custom() async throws { + try setUpFixture("ios_app_with_templates") + try await run(FetchCommand.self) + try await ScaffoldCommand.preprocess([ + "scaffold", + "custom", + "--name", + "TemplateProject", + "--path", + fixturePath.pathString, + ]) + try await run(ScaffoldCommand.self, "custom", "--name", "TemplateProject") + let templateProjectDirectory = fixturePath.appending(component: "TemplateProject") + XCTAssertEqual( + try FileHandler.shared.readTextFile(templateProjectDirectory.appending(component: "custom.swift")), + "// this is test TemplateProject content" + ) + XCTAssertEqual( + try FileHandler.shared.readTextFile(templateProjectDirectory.appending(component: "generated.swift")), + """ + // Generated file with platform: ios and name: TemplateProject + + """ + ) + } + + func test_ios_app_with_templates_custom_using_filters() async throws { + try setUpFixture("ios_app_with_templates") + try await run(FetchCommand.self) + try await ScaffoldCommand.preprocess([ + "scaffold", + "custom_using_filters", + "--name", + "TemplateProject", + "--path", + fixturePath.pathString, + ]) + try await run(ScaffoldCommand.self, "custom_using_filters", "--name", "TemplateProject") + let templateProjectDirectory = fixturePath.appending(component: "TemplateProject") + XCTAssertEqual( + try FileHandler.shared.readTextFile(templateProjectDirectory.appending(component: "custom.swift")), + "// this is test TemplateProject content" + ) + } + + func test_ios_app_with_templates_custom_using_copy_folder() async throws { + try setUpFixture("ios_app_with_templates") + try await run(FetchCommand.self) + try await ScaffoldCommand.preprocess([ + "scaffold", + "custom_using_copy_folder", + "--name", + "TemplateProject", + "--path", + fixturePath.pathString, + ]) + try await run(ScaffoldCommand.self, "custom_using_copy_folder", "--name", "TemplateProject") + let templateProjectDirectory = fixturePath.appending(component: "TemplateProject") + XCTAssertEqual( + try FileHandler.shared.readTextFile(templateProjectDirectory.appending(component: "generated.swift")), + """ + // Generated file with platform: ios and name: TemplateProject + + """ + ) + XCTAssertEqual( + try FileHandler.shared.readTextFile( + templateProjectDirectory.appending(components: ["sourceFolder", "file1.txt"]) + ), + """ + Content of file 1 + + """ + ) + XCTAssertEqual( + try FileHandler.shared.readTextFile( + templateProjectDirectory.appending(components: ["sourceFolder", "subFolder", "file2.txt"]) + ), + """ + Content of file 2 + + """ + ) + } + + func test_app_with_plugins_local_plugin() async throws { + try setUpFixture("app_with_plugins") + try await run(FetchCommand.self) + try await ScaffoldCommand.preprocess(["scaffold", "custom", "--name", "PluginTemplate", "--path", fixturePath.pathString]) + try await run(ScaffoldCommand.self, "custom", "--name", "PluginTemplate") + let pluginTemplateDirectory = fixturePath.appending(component: "PluginTemplate") + XCTAssertEqual( + try FileHandler.shared.readTextFile(pluginTemplateDirectory.appending(component: "custom.swift")), + "// this is test PluginTemplate content" + ) + XCTAssertEqual( + try FileHandler.shared.readTextFile(pluginTemplateDirectory.appending(component: "generated.swift")), + """ + // Generated file with platform: ios and name: PluginTemplate + + """ + ) + } + + func test_app_with_plugins_remote_plugin() async throws { + try setUpFixture("app_with_plugins") + try await run(FetchCommand.self) + try await ScaffoldCommand.preprocess([ + "scaffold", + "custom_two", + "--name", + "PluginTemplate", + "--path", + fixturePath.pathString, + ]) + try await run(ScaffoldCommand.self, "custom_two", "--name", "PluginTemplate") + let pluginTemplateDirectory = fixturePath.appending(component: "PluginTemplate") + XCTAssertEqual( + try FileHandler.shared.readTextFile(pluginTemplateDirectory.appending(component: "custom.swift")), + "// this is test PluginTemplate content" + ) + XCTAssertEqual( + try FileHandler.shared.readTextFile(pluginTemplateDirectory.appending(component: "generated.swift")), + """ + // Generated file with platform: ios and name: PluginTemplate + + """ + ) + } +} diff --git a/Tests/TuistGenerateAcceptanceTests/GenerateAcceptanceTests.swift b/Tests/TuistGenerateAcceptanceTests/GenerateAcceptanceTests.swift index e32224e5b09..16dd05fe9de 100644 --- a/Tests/TuistGenerateAcceptanceTests/GenerateAcceptanceTests.swift +++ b/Tests/TuistGenerateAcceptanceTests/GenerateAcceptanceTests.swift @@ -714,7 +714,7 @@ final class GenerateAcceptanceTestmacOSAppWithExtensions: TuistAcceptanceTestCas let sdkPkgPath = sourceRootPath .appending( components: [ - "features", + "fixtures", "resources", "WorkflowExtensionsSDK.pkg", ] @@ -731,23 +731,6 @@ final class GenerateAcceptanceTestmacOSAppWithExtensions: TuistAcceptanceTestCas } extension TuistAcceptanceTestCase { - private func headers( - for productName: String, - destination: String - ) throws -> [AbsolutePath] { - let productPath = try productPath(for: productName, destination: destination) - return FileHandler.shared.glob(productPath, glob: "**/*.h") - } - - private func productPath( - for name: String, - destination: String - ) throws -> AbsolutePath { - try XCTUnwrap( - FileHandler.shared.glob(derivedDataPath, glob: "**/Build/**/Products/\(destination)/\(name)/").first - ) - } - private func resourcePath( for productName: String, destination: String, @@ -762,53 +745,6 @@ extension TuistAcceptanceTestCase { } } - func XCTUnwrapTarget( - _ targetName: String, - in xcodeproj: XcodeProj, - file: StaticString = #file, - line: UInt = #line - ) throws -> PBXTarget { - let targets = xcodeproj.pbxproj.projects.flatMap(\.targets) - guard let target = targets.first(where: { $0.name == targetName }) - else { - XCTFail( - "Target \(targetName) doesn't exist in any of the projects' targets of the workspace", - file: file, - line: line - ) - throw XCTUnwrapError.nilValueDetected - } - - return target - } - - func XCTAssertFrameworkEmbedded( - _ framework: String, - by targetName: String, - file: StaticString = #file, - line: UInt = #line - ) throws { - let xcodeproj = try XcodeProj(pathString: xcodeprojPath.pathString) - let target = try XCTUnwrapTarget(targetName, in: xcodeproj) - - let xcframeworkDependencies = target.embedFrameworksBuildPhases() - .filter { $0.dstSubfolderSpec == .frameworks } - .map(\.files) - .compactMap { $0 } - .flatMap { $0 } - .compactMap(\.file?.nameOrPath) - .filter { $0.contains(".framework") } - guard xcframeworkDependencies.contains("\(framework).framework") - else { - XCTFail( - "Target \(targetName) doesn't link the framework \(framework)", - file: file, - line: line - ) - return - } - } - func XCTAssertSchemeContainsBuildSettings( _ scheme: String, configuration: String, @@ -922,17 +858,6 @@ extension TuistAcceptanceTestCase { } } - func XCTAssertProductWithDestinationDoesNotContainHeaders( - _ product: String, - destination: String, - file: StaticString = #file, - line: UInt = #line - ) throws { - if try !headers(for: product, destination: destination).isEmpty { - XCTFail("Product with name \(product) and destination \(destination) contains headers", file: file, line: line) - } - } - fileprivate func XCTAssertProductWithDestinationContainsResource( _ product: String, destination: String, diff --git a/features/Package.swift b/features/Package.swift deleted file mode 100644 index 54ecd572585..00000000000 --- a/features/Package.swift +++ /dev/null @@ -1 +0,0 @@ -import PackageDescription \ No newline at end of file diff --git a/features/build-rules.feature b/features/build-rules.feature deleted file mode 100644 index 35b18b2ee5b..00000000000 --- a/features/build-rules.feature +++ /dev/null @@ -1,8 +0,0 @@ -Feature: Build projects using Tuist build - Scenario: The project is an application with build rules (app_with_build_rules) - Given that tuist is available - And I have a working directory - Then I copy the fixture app_with_build_rules into the working directory - Then tuist generates the project - Then I should be able to build for iOS the scheme App - Then the target App should have the build rule Process_InfoPlist.strings with pattern */InfoPlist.strings \ No newline at end of file diff --git a/features/dependencies.feature b/features/dependencies.feature deleted file mode 100644 index 3bdb51c0d3a..00000000000 --- a/features/dependencies.feature +++ /dev/null @@ -1,18 +0,0 @@ -# TODO: Fix -# Feature: Tuist dependencies. - -# Scenario: The project is an application with SPM Dependencies.swift (app_with_spm_dependencies) -# Given that tuist is available -# And I have a working directory -# Then I copy the fixture app_with_spm_dependencies into the working directory -# Then tuist fetches dependencies -# Then tuist generates the project -# Then tuist builds the scheme App from the project - -# Scenario: The project is a sub project within a workspace with SPM Dependencies.swift (app_with_spm_dependencies) -# Given that tuist is available -# And I have a working directory -# Then I copy the fixture app_with_spm_dependencies into the working directory -# Then tuist fetches dependencies -# Then tuist generates the project at /Features/FeatureOne -# Then tuist builds the scheme FeatureOneFramework_iOS from the project at Features/FeatureOne diff --git a/features/edit.feature b/features/edit.feature deleted file mode 100644 index 4184e41cbda..00000000000 --- a/features/edit.feature +++ /dev/null @@ -1,25 +0,0 @@ -Feature: Edit an existing project using Tuist - - Scenario: The project is an application with helpers, sub projects, Config.swift, Dependencies.swift and Project.swift (ios_app_with_helpers) - Given that tuist is available - And I have a working directory - Then I copy the fixture ios_app_with_helpers into the working directory - Then tuist edits the project - Then I should be able to build for macOS the scheme Manifests - - Scenario: The project is a plugin with helpers (plugin). - Given that tuist is available - And I have a working directory - Then I copy the fixture plugin into the working directory - Then tuist edits the project - Then I should be able to build for macOS the scheme Plugins - - Scenario: The project is a project with plugins (app_with_plugins) - Given that tuist is available - And I have a working directory - Then I copy the fixture app_with_plugins into the working directory - Then tuist does fetch - Then tuist edits the project - Then I should be able to build for macOS the scheme Manifests - Then I should be able to build for macOS the scheme Plugins - Then I should be able to build for macOS the scheme LocalPlugin diff --git a/features/graph.feature b/features/graph.feature deleted file mode 100644 index 111c8031763..00000000000 --- a/features/graph.feature +++ /dev/null @@ -1,15 +0,0 @@ -# TODO: Fix -# Feature: Generate graph -# Scenario: The project is an application (ios_workspace_with_microfeature_architecture) -# Given that tuist is available -# And I have a working directory -# Then I copy the fixture ios_workspace_with_microfeature_architecture into the working directory -# Then tuist graph -# Then I should be able to open a graph file - -# Scenario: The project is an application (ios_workspace_with_microfeature_architecture) -# Given that tuist is available -# And I have a working directory -# Then I copy the fixture ios_workspace_with_microfeature_architecture into the working directory -# Then tuist graph of Data -# Then I should be able to open a graph file diff --git a/features/init.feature b/features/init.feature deleted file mode 100644 index 51bb0db9ea7..00000000000 --- a/features/init.feature +++ /dev/null @@ -1,50 +0,0 @@ -Feature: Initialize a new project using Tuist - - Scenario: The project is a compilable macOS application - Given that tuist is available - And I have a working directory - When I initialize a macos application named Test - Then tuist generates the project - Then I should be able to build for macOS the scheme Test - - Scenario: The project is a compilable iOS application - Given that tuist is available - And I have a working directory - When I initialize a ios application named My-App - Then tuist generates the project - Then I should be able to build for iOS the scheme MyApp - - Scenario: The project is a compilable tvOS application - Given that tuist is available - And I have a working directory - When I initialize a tvos application named TvApp - Then tuist generates the project - Then I should be able to build for tvOS the scheme TvApp - - Scenario: The project is a compilable SwiftUI iOS application - Given that tuist is available - And I have a working directory - When I initialize a ios application named MyApp with swiftui template - Then tuist generates the project - Then I should be able to build for iOS the scheme MyApp - - Scenario: The project is a compilable SwiftUI macOS application - Given that tuist is available - And I have a working directory - When I initialize a macos application named Test with swiftui template - Then tuist generates the project - Then I should be able to build for macOS the scheme Test - - Scenario: The project is a compilable SwiftUI tvOS application - Given that tuist is available - And I have a working directory - When I initialize a tvos application named TvApp with swiftui template - Then tuist generates the project - Then I should be able to build for tvOS the scheme TvApp - - Scenario: The project is a CLI project initialized from a template in a different repository - Given that tuist is available - And I have a working directory - When I initialize a project from the template https://github.com/tuist/ExampleTuistTemplate.git - Then tuist builds the project - # Then I should be able to build for tvOS the scheme TvApp diff --git a/features/list-targets.feature b/features/list-targets.feature deleted file mode 100644 index 7d79eca4f0b..00000000000 --- a/features/list-targets.feature +++ /dev/null @@ -1,12 +0,0 @@ -Feature: List targets sorted by number of dependencies - - Scenario: The project is the microfeature fixture - Given that tuist is available - And I have a working directory - Then I copy the fixture ios_workspace_with_microfeature_architecture into the working directory - Then tuist generates the project at Frameworks/UIComponentsFramework - Then run tuist migration list-targets for UIComponents in ios_workspace_with_microfeature_architecture matches list-targets-ui-components.json - Then tuist generates the project at Frameworks/CoreFramework - Then run tuist migration list-targets for Core in ios_workspace_with_microfeature_architecture matches list-targets-core.json - Then tuist generates the project at Frameworks/DataFramework - Then run tuist migration list-targets for Data in ios_workspace_with_microfeature_architecture matches list-targets-data.json diff --git a/features/plugin.feature b/features/plugin.feature deleted file mode 100644 index 1ab2814c8a0..00000000000 --- a/features/plugin.feature +++ /dev/null @@ -1,9 +0,0 @@ -Feature: Working with a plugin - - Scenario: The project is a tuist plugin - Given that tuist is available - And I have a working directory - Then I copy the fixture tuist_plugin into the working directory - Then tuist builds the plugin - Then tuist runs plugin's task tuist-create-file - Then tuist tests the plugin diff --git a/features/plugins.feature b/features/plugins.feature deleted file mode 100644 index ca6af332ee5..00000000000 --- a/features/plugins.feature +++ /dev/null @@ -1,9 +0,0 @@ -Feature: Generate a new project using Tuist with a plugin. - - Scenario: The project is an iOS application with plugins (app_with_plugins) - Given that tuist is available - And I have a working directory - Then I copy the fixture app_with_plugins into the working directory - Then tuist does fetch - Then tuist generates the project - Then I should be able to build for iOS the scheme TuistPluginTest diff --git a/features/precompiled.feature b/features/precompiled.feature deleted file mode 100644 index 5cb7fece3be..00000000000 --- a/features/precompiled.feature +++ /dev/null @@ -1,57 +0,0 @@ -Feature: A set of tests that run with pre-compiled binaries that are only compatible with a specific version of Swift - - Scenario: The project is an iOS application with frameworks and tests (ios_app_with_static_frameworks) - Given that tuist is available - And I have a working directory - Then I copy the fixture ios_app_with_static_frameworks into the working directory - Then tuist generates the project - Then I should be able to build for iOS the scheme App - Then I should be able to test for iOS the scheme App - Then I should be able to build for iOS the scheme A - Then I should be able to build for iOS the scheme B - - Scenario: The project is an iOS application with frameworks and tests (ios_app_with_static_libraries) - Given that tuist is available - And I have a working directory - Then I copy the fixture ios_app_with_static_libraries into the working directory - Then tuist generates the project - Then I should be able to build for iOS the scheme App - Then I should be able to test for iOS the scheme App - Then I should be able to build for iOS the scheme A - Then I should be able to build for iOS the scheme B - - Scenario: The project is an iOS application with a target dependency and transitive framework dependency (ios_app_with_transitive_framework) - Given that tuist is available - And I have a working directory - Then I copy the fixture ios_app_with_transitive_framework into the working directory - Then tuist generates the project - Then I should be able to build for iOS the scheme App - Then the product 'App.app' with destination 'Debug-iphonesimulator' contains the framework 'Framework1' with architecture 'x86_64' - Then the product 'App.app' with destination 'Debug-iphonesimulator' contains the framework 'Framework2' without architecture 'arm64' - Then the product 'App.app' with destination 'Debug-iphonesimulator' does not contain headers - Then I should be able to build for iOS the scheme App - Then the product 'AppUITests-Runner.app' with destination 'Debug-iphonesimulator' does not contain the framework 'Framework2' - Then I should be able to build for iOS the scheme Framework1-iOS - Then I should be able to build for macOS the scheme Framework1-macOS - Then I should be able to build for iOS the scheme Framework1Tests-iOS - Then I should be able to build for macOS the scheme Framework1Tests-macOS - Then I should be able to build for iOS the scheme StaticFramework1 - - Scenario: The project is an iOS application with frameworks and tests (ios_app_with_static_library_and_package) - Given that tuist is available - And I have a working directory - Then I copy the fixture ios_app_with_static_library_and_package into the working directory - Then tuist generates the project - Then I should be able to build for iOS the scheme App - Then I should be able to test for iOS the scheme App - - Scenario: The project is an iOS application with xcframeworks (ios_app_with_xcframeworks) - Given that tuist is available - And I have a working directory - Then I copy the fixture ios_app_with_xcframeworks into the working directory - Then tuist generates the project - Then I should be able to build for iOS the scheme StaticFrameworkA - Then I should be able to build for iOS the scheme App - Then the product 'App.app' with destination 'Debug-iphonesimulator' contains the framework 'MyFramework' with architecture 'x86_64' - Then the product 'App.app' with destination 'Debug-iphonesimulator' does not contain headers - Then I should be able to archive for iOS the scheme App diff --git a/features/resources/list-targets-core.json b/features/resources/list-targets-core.json deleted file mode 100644 index 4a3e33ea0b3..00000000000 --- a/features/resources/list-targets-core.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "linkedFrameworksCount" : 0, - "targetDependenciesNames" : [ - - ], - "targetName" : "Core" - }, - { - "linkedFrameworksCount" : 1, - "targetDependenciesNames" : [ - "Core" - ], - "targetName" : "CoreTests" - } -] diff --git a/features/resources/list-targets-data.json b/features/resources/list-targets-data.json deleted file mode 100644 index 3132c1dc5ad..00000000000 --- a/features/resources/list-targets-data.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "linkedFrameworksCount" : 1, - "targetDependenciesNames" : [ - - ], - "targetName" : "Data" - }, - { - "linkedFrameworksCount" : 1, - "targetDependenciesNames" : [ - "Data" - ], - "targetName" : "DataTests" - } -] diff --git a/features/resources/list-targets-ui-components.json b/features/resources/list-targets-ui-components.json deleted file mode 100644 index f8c6a47a8d2..00000000000 --- a/features/resources/list-targets-ui-components.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "linkedFrameworksCount" : 1, - "targetDependenciesNames" : [ - - ], - "targetName" : "UIComponents" - }, - { - "linkedFrameworksCount" : 1, - "targetDependenciesNames" : [ - "UIComponents" - ], - "targetName" : "UIComponentsTests" - } -] diff --git a/features/run.feature b/features/run.feature deleted file mode 100644 index e2875621a3d..00000000000 --- a/features/run.feature +++ /dev/null @@ -1,7 +0,0 @@ -Feature: Tests projects using Tuist run - Scenario: The project is a command line application with a runnable scheme (command_line_tool_basic) - Given that tuist is available - And I have a working directory - Then I copy the fixture command_line_tool_basic into the working directory - Then tuist runs the scheme CommandLineTool outputting to out.txt - Then a file out.txt exists diff --git a/features/scaffold.feature b/features/scaffold.feature deleted file mode 100644 index edeea345f12..00000000000 --- a/features/scaffold.feature +++ /dev/null @@ -1,60 +0,0 @@ -Feature: Scaffold a project using Tuist - - Scenario: The project is an application with templates (ios_app_with_templates) - Given that tuist is available - And I have a working directory - Then I copy the fixture ios_app_with_templates into the working directory - Then tuist does fetch - Then tuist scaffolds a custom template named TemplateProject - Then content of a file named custom.swift in a directory TemplateProject should be equal to // this is test TemplateProject content - Then content of a file named generated.swift in a directory TemplateProject should be equal to: - """ - // Generated file with platform: ios and name: TemplateProject - - """ - Then tuist scaffolds a custom_using_filters template named TemplateProject - Then content of a file named custom.swift in a directory TemplateProject should be equal to // this is test TemplateProject content - Then content of a file named generated.swift in a directory TemplateProject should be equal to: - """ - // Generated file with platform: iOS and snake case name: template_project - - """ - Then tuist scaffolds a custom_using_copy_folder template named TemplateProject - Then content of a file named custom.swift in a directory TemplateProject should be equal to // this is test TemplateProject content - Then content of a file named generated.swift in a directory TemplateProject should be equal to: - """ - // Generated file with platform: ios and name: TemplateProject - - """ - Then content of a file named file1.txt in a directory TemplateProject/sourceFolder should be equal to: - """ - Content of file 1 - - """ - Then content of a file named file2.txt in a directory TemplateProject/sourceFolder/subFolder should be equal to: - """ - Content of file 2 - - """ - - Scenario: The project is an application with templates from plugins (app_with_plugins) - Given that tuist is available - And I have a working directory - Then I copy the fixture app_with_plugins into the working directory - Then tuist does fetch - # Local template plugin - Then tuist scaffolds a custom template named PluginTemplate - Then content of a file named custom.swift in a directory PluginTemplate should be equal to // this is test PluginTemplate content - Then content of a file named generated.swift in a directory PluginTemplate should be equal to: - """ - // Generated file with platform: ios and name: PluginTemplate - - """ - # Remote template plugin - Then tuist scaffolds a custom_two template named PluginTemplate - Then content of a file named custom.swift in a directory PluginTemplate should be equal to // this is test PluginTemplate content - Then content of a file named generated.swift in a directory PluginTemplate should be equal to: - """ - // Generated file with platform: ios and name: PluginTemplate - - """ diff --git a/features/step_definitions/build.rb b/features/step_definitions/build.rb deleted file mode 100644 index 41891ce10ac..00000000000 --- a/features/step_definitions/build.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -require "xcodeproj" - -Then(/^tuist builds the project$/) do - system(@tuist, "build", "--path", @dir) -end - -Then(/^tuist builds the scheme ([a-zA-Z\-]+) from the project$/) do |scheme| - system(@tuist, "build", scheme, "--path", @dir) -end - -Then(%r{^tuist builds the scheme ([a-zA-Z\-_]+) from the project at ([a-zA-Z/]+)$}) do |scheme, path| - system(@tuist, "build", scheme, "--path", File.join(@dir, path)) -end - -Then(%r{^tuist builds the scheme ([a-zA-Z\-_]+) \ -and configuration ([a-zA-Z\-]+) from the project$}) do |scheme, configuration| - system(@tuist, "build", scheme, "--path", @dir, "--configuration", configuration) -end - -Then(%r{^tuist builds the scheme ([a-zA-Z\-_]+) \ -and configuration ([a-zA-Z\-]+) from the project to output path (.+)$}) do |scheme, configuration, path| - system(@tuist, "build", scheme, "--path", @dir, "--configuration", configuration, - "--build-output-path", File.join(@dir, path)) -end - -Then(/^tuist builds the project at (.+)$/) do |path| - system(@tuist, "build", "--path", File.join(@dir, path)) -end - -Then(/^xcodebuild compiles the docc archive$/) do - args = [ - "docbuild" - ] - args.concat(["-project", @xcodeproj_path]) unless @xcodeproj_path.nil? - xcodebuild(*args) -end diff --git a/features/step_definitions/dependencies.rb b/features/step_definitions/dependencies.rb deleted file mode 100644 index 9b1873a7a25..00000000000 --- a/features/step_definitions/dependencies.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -Then(/tuist fetches dependencies/) do - system(@tuist, "fetch", "--path", @dir) -end - -Then(/tuist updates dependencies/) do - system(@tuist, "fetch", "--update", "--path", @dir) -end diff --git a/features/step_definitions/fetch.rb b/features/step_definitions/fetch.rb deleted file mode 100644 index 212d4fa1b8e..00000000000 --- a/features/step_definitions/fetch.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -Then(/tuist does fetch/) do - _, err, status = Open3.capture3(@tuist, "fetch", "--path", @dir) - flunk(err) unless status.success? -end diff --git a/features/step_definitions/generate.rb b/features/step_definitions/generate.rb deleted file mode 100644 index 41f1cecba1f..00000000000 --- a/features/step_definitions/generate.rb +++ /dev/null @@ -1,187 +0,0 @@ -# frozen_string_literal: true - -Then("the product {string} with destination {string} contains \ -the framework {string} with architecture {string}") do |product, destination, framework, architecture| - framework_path = Xcode.find_framework( - product: product, - destination: destination, - framework: framework, - derived_data_path: @derived_data_path - ) - flunk("Framework #{framework} not found") if framework_path.nil? - - binary_path = File.join(framework_path, framework) - out, err, status = Open3.capture3("file", binary_path) - assert(status.success?, err) - assert(out.include?(architecture)) -end - -Then("the product {string} with destination {string} contains \ -the framework {string} without architecture {string}") do |product, destination, framework, architecture| - framework_path = Xcode.find_framework( - product: product, - destination: destination, - framework: framework, - derived_data_path: @derived_data_path - ) - flunk("Framework #{framework} not found") if framework_path.nil? - - binary_path = File.join(framework_path, framework) - out, err, status = Open3.capture3("file", binary_path) - assert(status.success?, err) - refute(out.include?(architecture)) -end - -Then("the product {string} with destination {string} does \ -not contain the framework {string}") do |product, destination, framework| - framework_path = Xcode.find_framework( - product: product, - destination: destination, - framework: framework, - derived_data_path: @derived_data_path - ) - flunk("Framework #{framework} found") unless framework_path.nil? -end - -Then("the product {string} with destination {string} contains resource {string}") do |product, destination, resource| - resource_path = Xcode.find_resource( - product: product, - destination: destination, - resource: resource, - derived_data_path: @derived_data_path - ) - flunk("Product with name #{product} and destination #{destination} not found in DerivedData") if resource_path.nil? - - assert(resource_path) -end - -Then("the product {string} with destination {string} does \ -not contain resource {string}") do |product, destination, resource| - resource_path = Xcode.find_resource( - product: product, - destination: destination, - resource: resource, - derived_data_path: @derived_data_path - ) - flunk("Resource #{resource} found in product #{product} and destination #{destination}") unless resource_path.nil? - - refute(resource_path) -end - -Then("the product {string} with destination {string} contains \ -the Info.plist key {string}") do |product, destination, key| - info_plist_path = Xcode.find_resource( - product: product, - destination: destination, - resource: "Info.plist", - derived_data_path: @derived_data_path - ) - flunk("Product with name #{product} and destination #{destination} not found in DerivedData") if info_plist_path.nil? - - unless system("/usr/libexec/PlistBuddy -c \"print :#{key}\" #{info_plist_path}") - flunk("Key #{key} not found in the #{product} Info.plist") - end -end - -Then("the product {string} with destination {string} contains \ -the Info.plist key {string} with value {string}") do |product, destination, key, value| - info_plist_path = Xcode.find_resource( - product: product, - destination: destination, - resource: "Info.plist", - derived_data_path: @derived_data_path - ) - flunk("Product with name #{product} and destination #{destination} not found in DerivedData") if info_plist_path.nil? - - output = %x(/usr/libexec/PlistBuddy -c \"print :#{key}\" #{info_plist_path}) - - flunk("Key #{key} not found in the #{product} Info.plist") if output.nil? - - assert(output == "#{value}\n") -end - -Then("the product {string} with destination {string} contains extension {string}") do |product, destination, extension| - extension_path = Xcode.find_extension( - product: product, - destination: destination, - extension: extension, - derived_data_path: @derived_data_path - ) - flunk("Product with name #{product} and destination #{destination} not found in DerivedData") if extension_path.nil? - - assert(extension_path) -end - -Then("the product {string} with destination {string} contains extensionKit extension {string}") do |product, destination, extension| - extension_path = Xcode.find_extensionKitExtension( - product: product, - destination: destination, - extension: extension, - derived_data_path: @derived_data_path - ) - flunk("Product with name #{product} and destination #{destination} not found in DerivedData") if extension_path.nil? - - assert(extension_path) -end - -Then("the product {string} with destination {string} does not contain headers") do |product, destination| - headers_paths = Xcode.find_headers( - product: product, - destination: destination, - derived_data_path: @derived_data_path - ) - flunk("Product with name #{product} and destination #{destination} contains headers") if headers_paths.any? - - assert_empty(headers_paths) -end - -Then(/^a file (.+) exists$/) do |file| - file_path = File.join(@dir, file) - assert(File.file?(file_path), "#{file_path} does not exist") -end - -Then(/^a file (.+) does not exist$/) do |file| - file_path = File.join(@dir, file) - assert(!File.file?(file_path), "#{file_path} does exist") -end - -Then(/^a directory (.+) exists$/) do |directory| - directory_path = File.join(@dir, directory) - assert(Dir.exist?(directory_path), "#{directory_path} does not exist") -end - -Then("the product {string} with destination {string} contains \ -the appClip {string} with architecture {string}") do |product, destination, app_clip, architecture| - app_clip_path = Xcode.find_app_clip( - product: product, - destination: destination, - app_clip: app_clip, - derived_data_path: @derived_data_path - ) - flunk("AppClip #{app_clip} not found") if app_clip_path.nil? - - binary_path = File.join(app_clip_path, app_clip) - out, err, status = Open3.capture3("file", binary_path) - assert(status.success?, err) - assert(out.include?(architecture)) -end - -Then("the product {string} with destination {string} contains \ -the appClip {string} without architecture {string}") do |product, destination, app_clip, architecture| - app_clip_path = Xcode.find_app_clip( - product: product, - destination: destination, - app_clip: app_clip, - derived_data_path: @derived_data_path - ) - flunk("AppClip #{app_clip} not found") if app_clip_path.nil? - - binary_path = File.join(app_clip_path, app_clip) - out, err, status = Open3.capture3("file", binary_path) - assert(status.success?, err) - refute(out.include?(architecture)) -end - -Then(/content of a file named (.+) in a directory (.+) should contain:$/) do |file, dir, content| - assert_equal File.readlines(File.join(@dir, dir, file)).any?{ |l| l[content] }, true -end diff --git a/features/step_definitions/graph.rb b/features/step_definitions/graph.rb deleted file mode 100644 index da87bf4180b..00000000000 --- a/features/step_definitions/graph.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -Then(/^tuist graph$/) do - system(@tuist, "graph", "--path", @dir, "--output-path", @dir) -end - -Then(/^tuist graph of ([a-zA-Z]+)$/) do |target_name| - system(@tuist, "graph", "--path", @dir, "--output-path", @dir, target_name) -end - -Then(/^I should be able to open a graph file$/) do - binary_path = File.join(@dir, "graph.png") - system("file", binary_path) -end diff --git a/features/step_definitions/init.rb b/features/step_definitions/init.rb deleted file mode 100644 index 53db0838505..00000000000 --- a/features/step_definitions/init.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -When(/^I initialize a (.+) application named (.+) with (.+) template$/) do |platform, name, template| - system(@tuist, "init", "--template", template, "--path", @dir, "--platform", platform, "--name", - name) -end - -When(/^I initialize a (.+) application named ([a-zA-Z\-_]+)$/) do |platform, name| - system(@tuist, "init", "--path", @dir, "--platform", platform, "--name", name) -end - -When(/^I initialize a project from the template (.+)$/) do |template_url| - system(@tuist, "init", "--path", @dir, "-t", template_url) -end diff --git a/features/step_definitions/migration.rb b/features/step_definitions/migration.rb deleted file mode 100644 index f2ac207f639..00000000000 --- a/features/step_definitions/migration.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -Then(%r{run tuist migration list-targets for (.+) \ -in ios_workspace_with_microfeature_architecture matches (.+)$}) do |framework, json_file| - fixture_path = File.join(@dir, "Frameworks/#{framework}Framework/#{framework}.xcodeproj/") - resources_path = File.expand_path("../resources", __dir__) - expected_json = File.read("#{resources_path}/#{json_file}") - - assert(false, "Project #{fixture_path} not found") unless File.exist?(fixture_path) - - out, _ = Open3.capture2(@tuist, "migration", "list-targets", "-p", fixture_path) - - assert(out.include?(expected_json)) -end diff --git a/features/step_definitions/plugin.rb b/features/step_definitions/plugin.rb deleted file mode 100644 index eb47895c42f..00000000000 --- a/features/step_definitions/plugin.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -Then(/^tuist builds the plugin$/) do - system(@tuist, "plugin", "build", "--path", @dir) -end - -Then(/^tuist runs plugin's task ([a-zA-Z\-]+)$/) do |task| - system(@tuist, "plugin", "run", "--path", @dir, task) -end - -Then(/^tuist tests the plugin$/) do - system(@tuist, "plugin", "test", "--path", @dir) -end diff --git a/features/step_definitions/run.rb b/features/step_definitions/run.rb deleted file mode 100644 index 5da1ebacad2..00000000000 --- a/features/step_definitions/run.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -Then(/^tuist runs the scheme ([a-zA-Z\-]+)t$/) do |scheme| - system(@tuist, "run", "--path", @dir, scheme) -end - -Then(/^tuist runs the scheme ([a-zA-Z\-]+) outputting to (.+)$/) do |scheme, file| - system(@tuist, "run", "--path", @dir, scheme, ">", File.join(@dir, file)) -end - -Then(/^tuist runs the scheme ([a-zA-Z\-]+)$/) do |scheme| - system(@tuist, "run", "--path", @dir, scheme) -end - -Then(%r{^tuist runs the scheme ([a-zA-Z\-]+)\ -and configuration ([a-zA-Z\-]+)$}) do |scheme, configuration| - system(@tuist, "run", "--path", @dir, "--configuration", configuration, scheme) -end diff --git a/features/step_definitions/scaffold.rb b/features/step_definitions/scaffold.rb deleted file mode 100644 index caa727154d3..00000000000 --- a/features/step_definitions/scaffold.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -Then(/tuist scaffolds a (.+) template named (.+)/) do |template, name| - system(@tuist, "scaffold", template, "--path", @dir, "--name", name) -end - -Then(/content of a file named (.+) in a directory (.+) should be equal to (.+)/) do |file, dir, content| - assert_equal File.read(File.join(@dir, dir, file)), content -end - -Then(/content of a file named (.+) in a directory (.+) should be equal to:$/) do |file, dir, content| - assert_equal File.read(File.join(@dir, dir, file)), content -end diff --git a/features/step_definitions/shared/developer_environment.rb b/features/step_definitions/shared/developer_environment.rb deleted file mode 100644 index 4071c32598b..00000000000 --- a/features/step_definitions/shared/developer_environment.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -require "fileutils" - -Then(/I install the Workflow extensions SDK/) do - sdk_pkg_path = File.expand_path("../../resources/WorkflowExtensionsSDK.pkg", __dir__) - unless File.exist?("/Library/Developer/SDKs/WorkflowExtensionSDK.sdk") - system("sudo", "installer", "-package", sdk_pkg_path, "-target", "/") - end -end diff --git a/features/step_definitions/shared/fixtures.rb b/features/step_definitions/shared/fixtures.rb deleted file mode 100644 index 513adb98f0f..00000000000 --- a/features/step_definitions/shared/fixtures.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -require "fileutils" - -Then(/I copy the fixture (.+) into the working directory/) do |fixture| - fixtures_path = File.expand_path("../../../fixtures", __dir__) - fixture_path = File.join(fixtures_path, fixture) - assert(false, "Fixture #{fixture} not found") unless File.exist?(fixture_path) - - FileUtils.cp_r(File.join(fixture_path, "."), @dir) -end diff --git a/features/step_definitions/shared/other.rb b/features/step_definitions/shared/other.rb deleted file mode 100644 index c231637572f..00000000000 --- a/features/step_definitions/shared/other.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -Then(/I add an empty line at the end of the file (.+)/) do |file_path| - path = File.join(@dir, file_path) - File.open(path, "a") { |f| f.puts "\n" } -end diff --git a/features/step_definitions/shared/tuist.rb b/features/step_definitions/shared/tuist.rb deleted file mode 100644 index 251fd17eda9..00000000000 --- a/features/step_definitions/shared/tuist.rb +++ /dev/null @@ -1,149 +0,0 @@ -# frozen_string_literal: true - -require "open3" -Given(/tuist is available/) do - project_root = File.expand_path("../../..", __dir__) - # On CI we expect tuist to be built already by the previous job `release_build`, so we skip `swift build` - - if ENV["CI"].nil? - ["tuist", "ProjectDescription", "tuistenv"].each do |product| - system( - "swift", - "build", - "-c", - "release", - "--product", - product, - "--package-path", - project_root - ) - end - end - - # `tuist` release build expect to have `vendor` and `Templates` in the same directory where the executable is - FileUtils.cp_r(File.join(project_root, "Templates"), File.join(project_root, ".build/release/Templates")) - - @tuist = File.join(project_root, ".build/release/tuist") - @tuistenv = File.join(project_root, ".build/release/tuistenv") -end - -Then(/^tuist generates the project$/) do - system(@tuist, "generate", "--no-open", "--path", @dir) - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -Then(/^tuist generates the project and outputs: (.+)$/) do |output| - out, err, status = Open3.capture3(@tuist, "generate", "--no-open", "--path", @dir) - assert(status.success?, err) - assert out.include?(output), "The output from Tuist generate doesn't include: #{output}" - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -Then(/^tuist generates the project with environment variable (.+) and value (.+)$/) do |variable, value| - ENV[variable] = value - system(@tuist, "generate", "--no-open", "--path", @dir) - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first - ENV[variable] = nil -end - -Then(%r{^tuist generates the project at ([a-zA-Z/]+)$}) do |path| - system(@tuist, "generate", "--no-open", "--path", File.join(@dir, path)) - @workspace_path = Dir.glob(File.join(@dir, path, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, path, "*.xcodeproj")).first -end - -When(/^tuist focuses the target ([a-zA-Z\-]+)$/) do |target| - system(@tuist, "generate", "--no-open", "--path", @dir, target) - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -When(/^tuist focuses the targets ([a-zA-Z,\-]+)$/) do |targets| - system(@tuist, "generate", "--no-open", "--path", @dir, *targets.split(",")) - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -When(/^tuist focuses the target ([a-zA-Z]+) with ([a-zA-Z]+) profile$/) do |target, cache_profile| - system(@tuist, "generate", "--no-open", "--path", @dir, target, "--profile", cache_profile) - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -When(%r{^tuist focuses the target ([a-zA-Z\-]+) at ([a-zA-Z/]+)$}) do |target, path| - system(@tuist, "generate", "--no-open", "--path", File.join(@dir, path), target) - @workspace_path = Dir.glob(File.join(@dir, path, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, path, "*.xcodeproj")).first -end - -When(%r{^tuist focuses the targets ([a-zA-Z,\-]+) at ([a-zA-Z/]+)$}) do |targets, path| - system(@tuist, "generate", "--no-open", "--path", File.join(@dir, path), *targets.split(",")) - @workspace_path = Dir.glob(File.join(@dir, path, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, path, "*.xcodeproj")).first -end - -When(/^tuist focuses the target ([a-zA-Z\-]+) using xcframeworks$/) do |target| - system(@tuist, "generate", "--no-open", "--path", @dir, target, "--xcframeworks") - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -When(/^tuist focuses the targets ([a-zA-Z,\-]+) using xcframeworks$/) do |targets| - system(@tuist, "generate", "--no-open", "--path", @dir, *targets.split(","), - "--xcframeworks") - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -When(/^tuist focuses the targets ([a-zA-Z,\-]+) using (device|simulator) xcframeworks$/) do |targets, type| - system(@tuist, "generate", "--no-open", "--path", @dir, *targets.split(","), - "--xcframeworks", "--destination #{type}") - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -When(%r{^tuist focuses the target ([a-zA-Z\-]+) at ([a-zA-Z/]+) using xcframeworks$}) do |target, path| - system(@tuist, "generate", "--no-open", "--path", File.join(@dir, path), target, "--xcframeworks") - @workspace_path = Dir.glob(File.join(@dir, path, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, path, "*.xcodeproj")).first -end - -When(%r{^tuist focuses the targets ([a-zA-Z,\-]+) at ([a-zA-Z/]+) using xcframeworks$}) do |targets, path| - system(@tuist, "generate", "--no-open", "--path", File.join(@dir, path), *targets.split(","), - "--xcframeworks") - @workspace_path = Dir.glob(File.join(@dir, path, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, path, "*.xcodeproj")).first -end - -Then(/tuist edits the project/) do - system(@tuist, "edit", "--path", @dir, "--permanent") - @workspace_path = Dir.glob(File.join(@dir, "Manifests.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "Manifests.xcodeproj")).first -end - -Then(/tuist sets up the project/) do - system(@tuist, "up", "--path", @dir) - @workspace_path = Dir.glob(File.join(@dir, "*.xcworkspace")).first - @xcodeproj_path = Dir.glob(File.join(@dir, "*.xcodeproj")).first -end - -Then(/tuist generate yields error "(.+)"/) do |error| - xcode_version, _, _ = Open3.capture3("xcodebuild -version | sed -n \"s/Xcode //p\"") - versioned_msg = error.gsub("${XCODE_VERSION}", xcode_version.chomp()) - expected_msg = versioned_msg.gsub("${ARG_PATH}", @dir) - _, stderr, status = Open3.capture3(@tuist, "generate", "--no-open", "--path", @dir) - actual_msg = stderr.strip - - error_message = <<~EOD - The output error message: - #{actual_msg} - - Does not contain the expected: - #{error} - EOD - assert actual_msg.include?(expected_msg), error_message - refute status.success? -end diff --git a/features/step_definitions/shared/workspace.rb b/features/step_definitions/shared/workspace.rb deleted file mode 100644 index f09a48e7afb..00000000000 --- a/features/step_definitions/shared/workspace.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -require "tmpdir" -require "fileutils" - -And(/I have a working directory/) do - @dir = Dir.mktmpdir - @cache_dir = Dir.mktmpdir - @derived_data_path = Dir.mktmpdir - ENV["TUIST_CONFIG_FORCE_CONFIG_CACHE_DIRECTORY"] = @cache_dir - ENV["TUIST_CONFIG_AUTOMATION_PATH"] = File.join(@dir, "Automation") -end - -After do |_scenario| - FileUtils.rm_r(@dir) unless @dir.nil? - FileUtils.rm_r(@cache_dir) unless @cache_dir.nil? - FileUtils.rm_r(@derived_data_path) unless @derived_data_path.nil? -end diff --git a/features/step_definitions/shared/xcode.rb b/features/step_definitions/shared/xcode.rb deleted file mode 100644 index 3cfd6168f4e..00000000000 --- a/features/step_definitions/shared/xcode.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -require "simctl" -require "xcodeproj" - -Then(/I should be able to (.+) for (iOS|macOS|tvOS|watchOS) the scheme (.+)/) do |action, platform, scheme| - args = [ - "-scheme", scheme, - ] - if @workspace_path.nil? - args.concat(["-project", @xcodeproj_path]) unless @xcodeproj_path.nil? - else - args.concat(["-workspace", @workspace_path]) unless @workspace_path.nil? - end - - args << if ["iOS", "tvOS", "watchOS"].include?(platform) - if Xcode.valid_simulator_destination_for_platform(platform).nil? - flunk("Couldn't find an available destination simulator for platform #{platform}") - else - "-destination '#{Xcode.valid_simulator_destination_for_platform(platform)}'" - end - else - "-destination 'platform=OS X,arch=x86_64'" - end - - args.concat(["-derivedDataPath", @derived_data_path]) - - args << "-skipPackagePluginValidation" - - args << "clean" - args << action - args << "CODE_SIGNING_ALLOWED=NO" - args << "CODE_SIGNING_IDENTITY=\"\"" - args << "CODE_SIGNING_REQUIRED=NO" - args << "CODE_SIGN_ENTITLEMENTS=\"\"" - - xcodebuild(*args) -end - -Then(/I should be able to (.+) for device of (iOS|macOS|tvOS|watchOS) the scheme (.+)/) do |action, platform, scheme| - args = [ - "-scheme", scheme, - ] - if @workspace_path.nil? - args.concat(["-project", @xcodeproj_path]) unless @xcodeproj_path.nil? - else - args.concat(["-workspace", @workspace_path]) unless @workspace_path.nil? - end - - args << if ["iOS", "tvOS", "watchOS"].include?(platform) - "-destination generic/platform=#{platform}" - else - "-destination generic/platform=OS X" - end - - args.concat(["-derivedDataPath", @derived_data_path]) - - args << "clean" - args << action - args << "CODE_SIGNING_ALLOWED=NO" - args << "CODE_SIGNING_IDENTITY=\"\"" - args << "CODE_SIGNING_REQUIRED=NO" - args << "CODE_SIGN_ENTITLEMENTS=\"\"" - - xcodebuild(*args) -end - -Then(/the scheme (.+) has a build setting (.+) with value (.+) for the configuration (.+)/) do |scheme, key, value, config| # rubocop:disable Metrics/LineLength - args = [ - "-scheme", scheme, - "-workspace", @workspace_path, - "-configuration", config, - "-showBuildSettings", - ] - - out, err, status = Open3.capture3("xcodebuild", *args) - flunk(err) unless status.success? - - search_for = "#{key} = #{value}" - assert(out.include?(search_for), "Couldn't find '#{search_for}'") -end - -Then(/^the target (.+) should have the build phase (.+)$/) do |target_name, phase_name| - project = Xcodeproj::Project.open(@xcodeproj_path) - targets = project.targets - target = targets.detect { |t| t.name == target_name } - flunk("Target #{target_name} not found in the project") if target.nil? - build_phase = target.build_phases.detect { |b| b.display_name == phase_name } - flunk("The target #{target_name} doesn't have build phases") if build_phase.nil? - assert_equal phase_name, build_phase.name -end - -Then(/^in project (.+) the target (.+) should have the build phase (.+) with a dependency file named (.+)$/) do |project_name, target_name, phase_name, dependency_file_name| - workspace = Xcodeproj::Workspace.new_from_xcworkspace(@workspace_path) - project_file_reference = workspace.file_references.detect { |f| File.basename(f.path, ".xcodeproj") == project_name } - project = Xcodeproj::Project.open(File.join(@dir, project_file_reference.path)) - targets = project.targets - target = targets.detect { |t| t.name == target_name } - flunk("Target #{target_name} not found in the project") if target.nil? - build_phase = target.build_phases.detect { |b| b.display_name == phase_name } - flunk("The target #{target_name} doesn't have build phases") if build_phase.nil? - dependency_file = build_phase.dependency_file - flunk("The build phase #{phase_name} doesn't have a dependency file") if dependency_file.nil? - assert_equal dependency_file_name, dependency_file -end - -Then(/^the target (.+) should have the build phase (.+) in the first position$/) do |target_name, phase_name| - project = Xcodeproj::Project.open(@xcodeproj_path) - targets = project.targets - target = targets.detect { |t| t.name == target_name } - flunk("Target #{target_name} not found in the project") if target.nil? - build_phase = target.build_phases.first - flunk("The target #{target_name} doesn't have build phases") if build_phase.nil? - assert_equal phase_name, build_phase.name -end - -Then(%r{^in project (.+) the target (.+) should \ -have the build phase (.+) in the first position$}) do |project_name, target_name, phase_name| - workspace = Xcodeproj::Workspace.new_from_xcworkspace(@workspace_path) - project_file_reference = workspace.file_references.detect { |f| File.basename(f.path, ".xcodeproj") == project_name } - flunk("Project #{project_name} not found in the workspace") if project_file_reference.nil? - project = Xcodeproj::Project.open(File.join(@dir, project_file_reference.path)) - targets = project.targets - target = targets.detect { |t| t.name == target_name } - flunk("Target #{target_name} not found in the project") if target.nil? - build_phase = target.build_phases.first - flunk("The target #{target_name} doesn't have build phases") if build_phase.nil? - assert_equal phase_name, build_phase.name -end - -Then(/^the target (.+) should have the build phase (.+) in the last position$/) do |target_name, phase_name| - project = Xcodeproj::Project.open(@xcodeproj_path) - targets = project.targets - target = targets.detect { |t| t.name == target_name } - flunk("Target #{target_name} not found in the project") if target.nil? - build_phase = target.build_phases.last - flunk("The target #{target_name} doesn't have build phases") if build_phase.nil? - assert_equal phase_name, build_phase.name -end - -Then(%r{^in project (.+) the target (.+) should \ -have the build phase (.+) in the last position$}) do |project_name, target_name, phase_name| - workspace = Xcodeproj::Workspace.new_from_xcworkspace(@workspace_path) - project_file_reference = workspace.file_references.detect { |f| File.basename(f.path, ".xcodeproj") == project_name } - flunk("Project #{project_name} not found in the workspace") if project_file_reference.nil? - project = Xcodeproj::Project.open(File.join(@dir, project_file_reference.path)) - targets = project.targets - target = targets.detect { |t| t.name == target_name } - flunk("Target #{target_name} not found in the project") if target.nil? - build_phase = target.build_phases.last - flunk("The target #{target_name} doesn't have build phases") if build_phase.nil? - assert_equal phase_name, build_phase.name -end - -Then(%r{^in project (.+) in the target (.+) the build phase in the first position should \ -have (.+) as an output path$}) do |project_name, target_name, output_path_name| - workspace = Xcodeproj::Workspace.new_from_xcworkspace(@workspace_path) - project_file_reference = workspace.file_references.detect { |f| File.basename(f.path, ".xcodeproj") == project_name } - flunk("Project #{project_name} not found in the workspace") if project_file_reference.nil? - project = Xcodeproj::Project.open(File.join(@dir, project_file_reference.path)) - targets = project.targets - target = targets.detect { |t| t.name == target_name } - flunk("Target #{target_name} not found in the project") if target.nil? - build_phase = target.build_phases.first - flunk("The target #{target_name} doesn't have build phases") if build_phase.nil? - assert build_phase.output_paths.include? output_path_name -end - -Then(/the target (.+) should have the build rule (.+) with pattern (.+)$/) do |target_name, build_rule_name, pattern| - project = Xcodeproj::Project.open(@xcodeproj_path) - targets = project.targets - target = targets.detect { |t| t.name == target_name } - flunk("Target #{target_name} not found in the project") if target.nil? - build_rule = target.build_rules.detect { |b| b.name == build_rule_name } - flunk("The target #{target_name} doesn't have build rules") if build_rule.nil? - assert_equal build_rule_name, build_rule.name - assert_equal pattern, build_rule.file_patterns -end diff --git a/features/step_definitions/tasks.rb b/features/step_definitions/tasks.rb deleted file mode 100644 index 125ecbecddf..00000000000 --- a/features/step_definitions/tasks.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -Then(/^content of a file named ([a-zA-Z\-_\.]+) should be equal to (.+)$/) do |file, content| - assert_equal File.read(file), content -end - -Then(/^tuist runs ([a-zA-Z\-_]+) with the current directory$/) do |command| - system(@tuist, command, @dir) -end - -Then(/^tuist runs ([a-zA-Z\-_]+)$/) do |command| - system(@tuist, command, "--path", @dir) -end - -Then(/^tuist fails running ([a-zA-Z\-_]+)$/) do |command| - _, _, status = Open3.capture3(@tuist, command, "--path", @dir) - assert(!status.success?, "Running #{command} must be failed") -end - -Then(/^current directory is added to PATH$/) do - ENV["PATH"] = ENV["PATH"] + ":/#{@dir}" -end - -Then(/^environment variable ([a-zA-Z\-_\.]+) is not defined$/) do |key| - ENV.delete(key) -end - -Then(/^environment variable ([a-zA-Z\-_\.]+) is defined as (.+)$/) do |key, value| - ENV[key] = value -end diff --git a/features/step_definitions/up.rb b/features/step_definitions/up.rb deleted file mode 100644 index 61600b9e63c..00000000000 --- a/features/step_definitions/up.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -Then(/I should have (.+) installed/) do |tool_path| - @tool_path = tool_path - assert(File.exist?(tool_path), "#{tool_path} was not installed") -end - -After do - FileUtils.rm_r(@tool_path) unless @tool_path.nil? -end diff --git a/features/support/assertions.rb b/features/support/assertions.rb deleted file mode 100644 index d672ea1c2ba..00000000000 --- a/features/support/assertions.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require "minitest/spec" -require "minitest/assertions" - -class MinitestWorld - include Minitest::Assertions - attr_accessor :assertions - - def initialize - self.assertions = 0 - end -end - -World do - MinitestWorld.new -end diff --git a/features/support/system.rb b/features/support/system.rb deleted file mode 100644 index 2258c143a71..00000000000 --- a/features/support/system.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -require "open3" - -module System - def system(*args) - log(args.join(" ")) - if ARGV.include?("--verbose") - status = Open3.popen2e(args.join(" ")) do |stdin, stdout_stderr, wait_thread| - Thread.new do - stdout_stderr.each { |l| puts l } - end - stdin.close - wait_thread.value - end - assert(status.success?) - else - out, err, status = Open3.capture3(args.join(" ")) - puts args.join(" ") - puts out - puts status - assert(status.success?, err) - end - end - - def xcodebuild(*args) - system("xcodebuild", *args) - end -end - -World(System) diff --git a/features/support/xcode.rb b/features/support/xcode.rb deleted file mode 100644 index 6b09feb146d..00000000000 --- a/features/support/xcode.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -require "minitest/assertions" -require "xcodeproj" -require "simctl" - -module Xcode - include Minitest::Assertions - - class << self - def workspace(workspace_path) - Xcodeproj::Workspace.new_from_xcworkspace(workspace_path) - end - - def projects(workspace_path) - workspace(workspace_path) - .file_references - .filter { |f| f.path.include?(".xcodeproj") } - .map { |f| File.join(File.dirname(workspace_path), f.path) } - .map { |p| Xcodeproj::Project.open(p) } - end - - def product_with_name(name, destination:, derived_data_path:) - glob = File.join(derived_data_path, "**/Build/**/Products/#{destination}/#{name}/") - Dir.glob(glob).max_by { |f| File.mtime(f) } - end - - def find_framework(product:, destination:, framework:, derived_data_path:) - product_path = product_with_name( - product, - destination: destination, - derived_data_path: derived_data_path - ) - - return if product_path.nil? - - framework_glob = File.join(product_path, "**/Frameworks/#{framework}.framework") - # /path/to/product/Frameworks/MyFramework.framework - framework_path = Dir.glob(framework_glob).first - - framework_path - end - - def find_app_clip(product:, destination:, app_clip:, derived_data_path:) - product_path = product_with_name( - product, - destination: destination, - derived_data_path: derived_data_path - ) - - return if product_path.nil? - - app_clip_glob = File.join(product_path, "/AppClips/#{app_clip}.app") - # /path/to/product/AppClips/AppClip.app - app_clip_path = Dir.glob(app_clip_glob).first - - app_clip_path - end - - def find_resource(product:, destination:, resource:, derived_data_path:) - product_path = product_with_name( - product, - destination: destination, - derived_data_path: derived_data_path - ) - return if product_path.nil? - - resource_glob = File.join(product_path, "**/#{resource}") - # /path/to/product/resource.png - Dir.glob(resource_glob).first - end - - def find_extension(product:, destination:, extension:, derived_data_path:) - product_path = product_with_name( - product, - destination: destination, - derived_data_path: derived_data_path - ) - - return if product_path.nil? - - extension_glob = File.join(product_path, "Plugins/#{extension}.appex") - # /path/to/product/Plugins/MyExtension.appex - extension_path = Dir.glob(extension_glob).first - - extension_path - end - - def find_extensionKitExtension(product:, destination:, extension:, derived_data_path:) - product_path = product_with_name( - product, - destination: destination, - derived_data_path: derived_data_path - ) - - return if product_path.nil? - - extension_glob = File.join(product_path, "Extensions/#{extension}.appex") - # /path/to/product/Extensions/MyExtension.appex - extension_path = Dir.glob(extension_glob).first - - extension_path - end - - def find_headers(product:, destination:, derived_data_path:) - product_path = product_with_name( - product, - destination: destination, - derived_data_path: derived_data_path - ) - return if product_path.nil? - - headers_glob = File.join(product_path, "**/*.h") - # /path/to/product/header.h - Dir.glob(headers_glob) - end - - def valid_simulator_destination_for_platform(platform) - # watchOS simulators are bundled with iOS simulators - platform = "iOS" if platform == "watchOS" - device = SimCtl - .list_devices - .select { |d| d.is_available && d.runtime.name.downcase.include?(platform.downcase) } - .sort { |l, r| l.runtime.version <=> r.runtime.version } - .last - - return nil if device.nil? - - "platform=#{platform} Simulator,id=#{device.udid}" - end - end -end diff --git a/features/tasks.feature b/features/tasks.feature deleted file mode 100644 index 80f0a48622c..00000000000 --- a/features/tasks.feature +++ /dev/null @@ -1,13 +0,0 @@ -Feature: Run tasks - Scenario: The project is an application with plugins (app_with_plugins) - Given that tuist is available - And I have a working directory - Then I copy the fixture app_with_plugins into the working directory - Then tuist does fetch - Then current directory is added to PATH - Then environment variable PLUGIN_FILE_CONTENT is not defined - Then tuist fails running create-file - Then environment variable PLUGIN_FILE_CONTENT is defined as File created with a plugin - Then tuist runs create-file - Then content of a file named plugin-file.txt should be equal to File created with a plugin - Then tuist runs inspect-graph diff --git a/fixtures/command_line_tool_basic/main.swift b/fixtures/command_line_tool_basic/main.swift index 8c2ae2748dd..205febfa3e6 100644 --- a/fixtures/command_line_tool_basic/main.swift +++ b/fixtures/command_line_tool_basic/main.swift @@ -1,3 +1,3 @@ import Foundation -print("CommandLineTool") +print("CommandLineTool was run") diff --git a/features/resources/WorkflowExtensionsSDK.pkg b/fixtures/resources/WorkflowExtensionsSDK.pkg similarity index 100% rename from features/resources/WorkflowExtensionsSDK.pkg rename to fixtures/resources/WorkflowExtensionsSDK.pkg diff --git a/fixtures/tuist_plugin/Package.resolved b/fixtures/tuist_plugin/Package.resolved index 6cc22ffd6c3..d5ce1f30a17 100644 --- a/fixtures/tuist_plugin/Package.resolved +++ b/fixtures/tuist_plugin/Package.resolved @@ -2,239 +2,14 @@ "object": { "pins": [ { - "package": "AEXML", - "repositoryURL": "https://github.com/tadija/AEXML.git", + "package": "ProjectAutomation", + "repositoryURL": "https://github.com/tuist/ProjectAutomation", "state": { - "branch": null, - "revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", - "version": "4.6.1" - } - }, - { - "package": "Signals", - "repositoryURL": "https://github.com/tuist/BlueSignals.git", - "state": { - "branch": null, - "revision": "1f6c49e186c8a4eeef87ba14f2f97b8646559d13", - "version": "1.0.200" - } - }, - { - "package": "Checksum", - "repositoryURL": "https://github.com/rnine/Checksum.git", - "state": { - "branch": null, - "revision": "cd1ae53384dd578a84a0afef492a4f5d6202b068", - "version": "1.0.2" - } - }, - { - "package": "CombineExt", - "repositoryURL": "https://github.com/CombineCommunity/CombineExt.git", - "state": { - "branch": null, - "revision": "0880829102152185190064fd17847a7c681d2127", - "version": "1.5.1" - } - }, - { - "package": "Commandant", - "repositoryURL": "https://github.com/Carthage/Commandant.git", - "state": { - "branch": null, - "revision": "ab68611013dec67413628ac87c1f29e8427bc8e4", - "version": "0.17.0" - } - }, - { - "package": "Commander", - "repositoryURL": "https://github.com/kylef/Commander.git", - "state": { - "branch": null, - "revision": "4a1f2fb82fb6cef613c4a25d2e38f702e4d812c2", - "version": "0.9.2" - } - }, - { - "package": "CryptoSwift", - "repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift.git", - "state": { - "branch": null, - "revision": "4b0565384d3c4c588af09e660535b2c7c9bf5b39", - "version": "1.4.2" - } - }, - { - "package": "GraphViz", - "repositoryURL": "https://github.com/tuist/GraphViz.git", - "state": { - "branch": "tuist", - "revision": "6a5f65e2208d66dc2547eb9d2c09213c98b6928d", + "branch": "main", + "revision": "f5cee58d487526bb604ff8a36a22a1922a65e2b5", "version": null } }, - { - "package": "Kanna", - "repositoryURL": "https://github.com/tid-kijyun/Kanna.git", - "state": { - "branch": null, - "revision": "f9e4922223dd0d3dfbf02ca70812cf5531fc0593", - "version": "5.2.7" - } - }, - { - "package": "KeychainAccess", - "repositoryURL": "https://github.com/kishikawakatsumi/KeychainAccess.git", - "state": { - "branch": null, - "revision": "84e546727d66f1adc5439debad16270d0fdd04e7", - "version": "4.2.2" - } - }, - { - "package": "Komondor", - "repositoryURL": "https://github.com/shibapm/Komondor.git", - "state": { - "branch": null, - "revision": "3fd348252fd14b5524fbaca9a42fdcfbe678657b", - "version": "1.1.2" - } - }, - { - "package": "Logger", - "repositoryURL": "https://github.com/shibapm/Logger", - "state": { - "branch": null, - "revision": "53c3ecca5abe8cf46697e33901ee774236d94cce", - "version": "0.2.3" - } - }, - { - "package": "Nimble", - "repositoryURL": "https://github.com/Quick/Nimble.git", - "state": { - "branch": null, - "revision": "7a46a5fc86cb917f69e3daf79fcb045283d8f008", - "version": "8.1.2" - } - }, - { - "package": "PackageConfig", - "repositoryURL": "https://github.com/shibapm/PackageConfig.git", - "state": { - "branch": null, - "revision": "5df1709f87e40e27b3fbe5022b826aff30d652d9", - "version": "1.1.0" - } - }, - { - "package": "PathKit", - "repositoryURL": "https://github.com/kylef/PathKit.git", - "state": { - "branch": null, - "revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", - "version": "1.0.1" - } - }, - { - "package": "Queuer", - "repositoryURL": "https://github.com/FabrizioBrancati/Queuer.git", - "state": { - "branch": null, - "revision": "52515108d0ac4616d9e15ffcc7ad986e300d31ff", - "version": "2.1.1" - } - }, - { - "package": "Quick", - "repositoryURL": "https://github.com/Quick/Quick.git", - "state": { - "branch": null, - "revision": "09b3becb37cb2163919a3842a4c5fa6ec7130792", - "version": "2.2.1" - } - }, - { - "package": "Rocket", - "repositoryURL": "https://github.com/f-meloni/Rocket", - "state": { - "branch": null, - "revision": "9880a5beb7fcb9e61ddd5764edc1700b8c418deb", - "version": "1.2.1" - } - }, - { - "package": "RxSwift", - "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", - "state": { - "branch": null, - "revision": "cec68169a048a079f461ba203fe85636548d7a89", - "version": "5.1.3" - } - }, - { - "package": "ShellOut", - "repositoryURL": "https://github.com/JohnSundell/ShellOut.git", - "state": { - "branch": null, - "revision": "e1577acf2b6e90086d01a6d5e2b8efdaae033568", - "version": "2.3.0" - } - }, - { - "package": "SourceKitten", - "repositoryURL": "https://github.com/jpsim/SourceKitten.git", - "state": { - "branch": null, - "revision": "c0f960f72fa1e6151695074ffa696e4da6c45ce8", - "version": "0.30.1" - } - }, - { - "package": "Spectre", - "repositoryURL": "https://github.com/kylef/Spectre.git", - "state": { - "branch": null, - "revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7", - "version": "0.10.1" - } - }, - { - "package": "Stencil", - "repositoryURL": "https://github.com/stencilproject/Stencil.git", - "state": { - "branch": null, - "revision": "ccd9402682f4c07dac9561befd207c8156e80e20", - "version": "0.14.2" - } - }, - { - "package": "StencilSwiftKit", - "repositoryURL": "https://github.com/SwiftGen/StencilSwiftKit.git", - "state": { - "branch": null, - "revision": "54cbedcdbb4334e03930adcff7343ffaf317bf0f", - "version": "2.8.0" - } - }, - { - "package": "swift-argument-parser", - "repositoryURL": "https://github.com/apple/swift-argument-parser.git", - "state": { - "branch": null, - "revision": "6b2aa2748a7881eebb9f84fb10c01293e15b52ca", - "version": "0.5.0" - } - }, - { - "package": "swift-log", - "repositoryURL": "https://github.com/apple/swift-log.git", - "state": { - "branch": null, - "revision": "5d66f7ba25daf4f94100e7022febf3c75e37a6c7", - "version": "1.4.2" - } - }, { "package": "swift-tools-support-core", "repositoryURL": "https://github.com/apple/swift-tools-support-core.git", @@ -243,96 +18,6 @@ "revision": "f9bbd6b80d67408021576adf6247e17c2e957d92", "version": "0.2.4" } - }, - { - "package": "Swifter", - "repositoryURL": "https://github.com/fortmarek/swifter.git", - "state": { - "branch": "stable", - "revision": "2e99c49c8575e6d18eb606c6142402f004cead79", - "version": null - } - }, - { - "package": "SwiftFormat", - "repositoryURL": "https://github.com/nicklockwood/SwiftFormat.git", - "state": { - "branch": null, - "revision": "c6ef3d0700b32f6512feb31a4a9fbc8122433af9", - "version": "0.49.0" - } - }, - { - "package": "SwiftGen", - "repositoryURL": "https://github.com/SwiftGen/SwiftGen", - "state": { - "branch": null, - "revision": "3b26e254b095d44f3dad06110bcb948b318898d6", - "version": "6.5.0" - } - }, - { - "package": "SwiftLint", - "repositoryURL": "https://github.com/Realm/SwiftLint.git", - "state": { - "branch": null, - "revision": "d53fc2664df92ef322bfa9ce5238d34f1461526a", - "version": "0.42.0" - } - }, - { - "package": "SwiftShell", - "repositoryURL": "https://github.com/kareman/SwiftShell", - "state": { - "branch": null, - "revision": "a6014fe94c3dbff0ad500e8da4f251a5d336530b", - "version": "5.1.0-beta.1" - } - }, - { - "package": "SwiftyTextTable", - "repositoryURL": "https://github.com/scottrhoyt/SwiftyTextTable.git", - "state": { - "branch": null, - "revision": "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3", - "version": "0.9.0" - } - }, - { - "package": "SWXMLHash", - "repositoryURL": "https://github.com/drmohundro/SWXMLHash.git", - "state": { - "branch": null, - "revision": "9183170d20857753d4f331b0ca63f73c60764bf3", - "version": "5.0.2" - } - }, - { - "package": "tuist", - "repositoryURL": "https://github.com/tuist/tuist", - "state": { - "branch": "cc762b1d4", - "revision": "cc762b1d4fba6b3c9e0e41783496f9d8ea8f918e", - "version": null - } - }, - { - "package": "XcodeProj", - "repositoryURL": "https://github.com/tuist/XcodeProj.git", - "state": { - "branch": null, - "revision": "aa2a42c7a744ca18b5918771fdd6cf40f9753db5", - "version": "8.6.0" - } - }, - { - "package": "Zip", - "repositoryURL": "https://github.com/maparoni/Zip.git", - "state": { - "branch": null, - "revision": "059e7346082d02de16220cd79df7db18ddeba8c3", - "version": null - } } ] }, diff --git a/fixtures/tuist_plugin/Package.swift b/fixtures/tuist_plugin/Package.swift index ca1d3a4dd6d..3c90b8f9589 100644 --- a/fixtures/tuist_plugin/Package.swift +++ b/fixtures/tuist_plugin/Package.swift @@ -5,7 +5,7 @@ import PackageDescription let package = Package( name: "LocalPlugin", - platforms: [.macOS(.v10_15)], + platforms: [.macOS(.v11)], products: [ .executable( name: "tuist-create-file", @@ -18,20 +18,20 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/tuist/tuist", .revision("cc762b1d4")), + .package(url: "https://github.com/tuist/ProjectAutomation", .branch("main")), ], targets: [ .target( name: "CreateFile", dependencies: [ - .product(name: "ProjectAutomation", package: "tuist") + .product(name: "ProjectAutomation", package: "ProjectAutomation") ] ), .testTarget(name: "CreateFileTests"), .target( name: "InspectGraph", dependencies: [ - .product(name: "ProjectAutomation", package: "tuist") + .product(name: "ProjectAutomation", package: "ProjectAutomation") ] ), ] diff --git a/make/tasks/tuist/acceptance-test.sh b/make/tasks/tuist/acceptance-test.sh deleted file mode 100755 index 2d61ee4dc34..00000000000 --- a/make/tasks/tuist/acceptance-test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -: ${FEATURE:=} - -set -euo pipefail - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ROOT_DIR=$($SCRIPT_DIR/../../utilities/root_dir.sh) -FEATURES_DIRECTORY=$ROOT_DIR/features - -args=(--format pretty --strict-undefined) -args+=(--require "$FEATURES_DIRECTORY") - -if [ -z "$FEATURE" ]; then - args+=("$FEATURES_DIRECTORY") -else - args+=("$FEATURE") -fi - -( - cd $ROOT_DIR - bundle exec cucumber "${args[@]}" -)