Skip to content

Commit

Permalink
Hide xcodebuild stderr to solve fastlane#21672 (fastlane#21673)
Browse files Browse the repository at this point in the history
  • Loading branch information
lacostej authored and SubhrajyotiSen committed Jan 17, 2024
1 parent f6acc2e commit e99a035
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fastlane_core/lib/fastlane_core/project.rb
Expand Up @@ -418,6 +418,8 @@ def build_settings(key: nil, optional: true)

command = build_xcodebuild_showbuildsettings_command

command = "#{command} 2>&1" # xcodebuild produces errors on stderr #21672

# Xcode might hang here and retrying fixes the problem, see fastlane#4059
begin
timeout = FastlaneCore::Project.xcode_build_settings_timeout
Expand Down
4 changes: 2 additions & 2 deletions fastlane_core/spec/project_spec.rb
Expand Up @@ -346,7 +346,7 @@ def within_a_temp_dir
allow(FastlaneCore::Helper).to receive(:xcode_at_least?).with("11.0").and_return(false)
allow(FastlaneCore::Helper).to receive(:xcode_at_least?).with("13").and_return(false)
expect(FastlaneCore::Helper).to receive(:xcode_at_least?).with("8.3").and_return(true)
command = "xcodebuild -showBuildSettings -project ./fastlane_core/spec/fixtures/projects/Example.xcodeproj"
command = "xcodebuild -showBuildSettings -project ./fastlane_core/spec/fixtures/projects/Example.xcodeproj 2>&1"
expect(FastlaneCore::Project).to receive(:run_command).with(command.to_s, { timeout: 3, retries: 3, print: true }).and_return(File.read("./fastlane_core/spec/fixtures/projects/build_settings_with_toolchains"))
expect(@project.build_settings(key: "SUPPORTED_PLATFORMS")).to eq("iphonesimulator iphoneos")
end
Expand All @@ -357,7 +357,7 @@ def within_a_temp_dir
allow(FastlaneCore::Helper).to receive(:xcode_at_least?).with("11.0").and_return(false)
allow(FastlaneCore::Helper).to receive(:xcode_at_least?).with("13").and_return(false)
expect(FastlaneCore::Helper).to receive(:xcode_at_least?).with("8.3").and_return(false)
command = "xcodebuild clean -showBuildSettings -project ./fastlane_core/spec/fixtures/projects/Example.xcodeproj"
command = "xcodebuild clean -showBuildSettings -project ./fastlane_core/spec/fixtures/projects/Example.xcodeproj 2>&1"
expect(FastlaneCore::Project).to receive(:run_command).with(command.to_s, { timeout: 3, retries: 3, print: true }).and_return(File.read("./fastlane_core/spec/fixtures/projects/build_settings_with_toolchains"))
expect(@project.build_settings(key: "SUPPORTED_PLATFORMS")).to eq("iphonesimulator iphoneos")
end
Expand Down

0 comments on commit e99a035

Please sign in to comment.