Skip to content

Commit

Permalink
[gym] Add support for multiplatform builds (#21319)
Browse files Browse the repository at this point in the history
* Add multiplatform example project

* Add multiplatform? predicate to Project

* Detect when a multiplatform project is being built for a particular platform

* Rubocop fixes

* Update to latest version of xcodeproj

Ensure fastlane can parse Xcode 14 projects
  • Loading branch information
zachwaugh committed Oct 7, 2023
1 parent 970003b commit 72c053d
Show file tree
Hide file tree
Showing 14 changed files with 569 additions and 2 deletions.
4 changes: 4 additions & 0 deletions fastlane_core/lib/fastlane_core/project.rb
Expand Up @@ -307,6 +307,10 @@ def watchos?
supported_platforms.include?(:watchOS)
end

def multiplatform?
supported_platforms.count > 1
end

def supported_platforms
supported_platforms = build_settings(key: "SUPPORTED_PLATFORMS")
if supported_platforms.nil?
Expand Down
16 changes: 16 additions & 0 deletions fastlane_core/spec/project_spec.rb
Expand Up @@ -209,6 +209,10 @@ def within_a_temp_dir
expect(@project.ios?).to eq(true)
end

it "#multiplatform?", requires_xcode: true do
expect(@project.multiplatform?).to eq(false)
end

it "#tvos?", requires_xcode: true do
expect(@project.tvos?).to eq(false)
end
Expand Down Expand Up @@ -250,6 +254,10 @@ def within_a_temp_dir
expect(@project.tvos?).to eq(false)
end

it "#multiplatform?", requires_xcode: true do
expect(@project.multiplatform?).to eq(false)
end

it "schemes", requires_xcodebuild: true do
expect(@project.schemes).to eq(["Mac"])
end
Expand All @@ -273,6 +281,10 @@ def within_a_temp_dir
expect(@project.tvos?).to eq(true)
end

it "#multiplatform?", requires_xcode: true do
expect(@project.multiplatform?).to eq(false)
end

it "schemes", requires_xcodebuild: true do
expect(@project.schemes).to eq(["ExampleTVOS"])
end
Expand Down Expand Up @@ -300,6 +312,10 @@ def within_a_temp_dir
expect(@project.tvos?).to eq(true)
end

it "#multiplatform?", requires_xcode: true do
expect(@project.multiplatform?).to eq(true)
end

it "schemes", requires_xcodebuild: true do
expect(@project.schemes).to eq(["CrossPlatformFramework"])
end
Expand Down

0 comments on commit 72c053d

Please sign in to comment.