Skip to content

Commit

Permalink
[scan] improve performance by change order of checks in `building_mac…
Browse files Browse the repository at this point in the history
…_catalyst_for_mac` function (fastlane#20898)

* Change order of checks in building_mac_catalyst_for_mac func

* fix: run brew update to mitigate outdated brew error

---------

Co-authored-by: Tomasz Lizer <[email protected]>
Co-authored-by: TomaszLizer <[email protected]>
  • Loading branch information
3 people authored Sep 9, 2024
1 parent e1ab951 commit 2de8c84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions fastlane/swift/formatting/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ task(:brew) do
raise '`brew` is required. Please install brew. https://brew.sh/' unless system('which brew')

puts('➡️ Brew')
sh('brew update')
sh('brew bundle')
end

Expand Down
2 changes: 1 addition & 1 deletion scan/lib/scan/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def scanfile_name

def building_mac_catalyst_for_mac?
return false unless Scan.project
Scan.project.supports_mac_catalyst? && Scan.config[:catalyst_platform] == "macos"
Scan.config[:catalyst_platform] == "macos" && Scan.project.supports_mac_catalyst?
end
end

Expand Down
2 changes: 1 addition & 1 deletion scan/spec/detect_values_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
context "catalyst" do
it "ios", requires_xcodebuild: true do
options = { project: "./scan/examples/standard/app.xcodeproj" }
expect_any_instance_of(FastlaneCore::Project).to receive(:supports_mac_catalyst?).and_return(true)
expect_any_instance_of(FastlaneCore::Project).not_to receive(:supports_mac_catalyst?)
Scan.config = FastlaneCore::Configuration.create(Scan::Options.available_options, options)
expect(Scan.config[:destination].first).to match(/platform=iOS/)
end
Expand Down

0 comments on commit 2de8c84

Please sign in to comment.