Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pilot] add xros as valid option for pilot upload #21841

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pilot/lib/pilot/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def fetch_app_platform(required: true)
result ||= FastlaneCore::IpaFileAnalyser.fetch_app_platform(config[:ipa]) if config[:ipa]
result ||= FastlaneCore::PkgFileAnalyser.fetch_app_platform(config[:pkg]) if config[:pkg]
if required
result ||= UI.input("Please enter the app's platform (appletvos, ios, osx): ")
UI.user_error!("App Platform must be ios, appletvos, or osx") unless ['ios', 'appletvos', 'osx'].include?(result)
result ||= UI.input("Please enter the app's platform (appletvos, ios, osx, xros): ")
UI.user_error!("App Platform must be ios, appletvos, osx, or xros") unless ['ios', 'appletvos', 'osx', 'xros'].include?(result)
UI.verbose("App Platform (#{result})")
end
return result
Expand Down
2 changes: 1 addition & 1 deletion pilot/lib/pilot/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.available_options
description: "The platform to use (optional)",
optional: true,
verify_block: proc do |value|
UI.user_error!("The platform can only be ios, appletvos, or osx") unless ['ios', 'appletvos', 'osx'].include?(value)
UI.user_error!("The platform can only be ios, appletvos, osx, or xros") unless ['ios', 'appletvos', 'osx', 'xros'].include?(value)
end),
FastlaneCore::ConfigItem.new(key: :apple_id,
short_option: "-p",
Expand Down
10 changes: 5 additions & 5 deletions pilot/spec/manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@
end

it "asks user to enter the app's platform manually" do
expect(UI).to receive(:input).with("Please enter the app's platform (appletvos, ios, osx): ").and_return(fake_app_platform)
expect(UI).to receive(:input).with("Please enter the app's platform (appletvos, ios, osx, xros): ").and_return(fake_app_platform)

fetch_app_platform_result = fake_manager.fetch_app_platform

Expand All @@ -542,7 +542,7 @@
end

it "asks user to enter the app's platform manually" do
expect(UI).to receive(:input).with("Please enter the app's platform (appletvos, ios, osx): ").and_return(fake_app_platform)
expect(UI).to receive(:input).with("Please enter the app's platform (appletvos, ios, osx, xros): ").and_return(fake_app_platform)

fetch_app_platform_result = fake_manager.fetch_app_platform

Expand All @@ -566,7 +566,7 @@
end

it "does not ask user to enter the app's platform manually" do
expect(UI).not_to receive(:input).with("Please enter the app's platform (appletvos, ios, osx): ")
expect(UI).not_to receive(:input).with("Please enter the app's platform (appletvos, ios, osx, xros): ")

fetch_app_platform_result = fake_manager.fetch_app_platform(required: false)

Expand All @@ -589,12 +589,12 @@

allow(UI)
.to receive(:input)
.with("Please enter the app's platform (appletvos, ios, osx): ")
.with("Please enter the app's platform (appletvos, ios, osx, xros): ")
.and_return(invalid_app_platform)
end

it "raises the 'invalid platform' exception" do
expect(UI).to receive(:user_error!).with("App Platform must be ios, appletvos, or osx")
expect(UI).to receive(:user_error!).with("App Platform must be ios, appletvos, osx, or xros")

fake_manager.fetch_app_platform
end
Expand Down