Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Sources/XcodeGraph/Models/Target.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable {
product == .xpc
}

/// Determines if the target is an embeddable plugin
/// i.e. a product that can be bundled with a host macOS application or a Mac Catalyst application
public func isEmbeddablePlugin() -> Bool {
supports(.macOS) && product == .bundle
}

/// Determines if the target is an embeddable system extension
/// i.e. a product that can be bundled with a host macOS application
public func isEmbeddableSystemExtension() -> Bool {
Expand All @@ -277,6 +283,12 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable {
supports(.macOS) && product == .app
}

/// Determines if the target is able to embed a plugin
/// i.e. a product that can be bundled with a macOS application or a Mac Catalyst application
public func canEmbedPlugins() -> Bool {
(supports(.macOS) || supportsCatalyst) && product == .app
}

/// Return the a set of PlatformFilters to control linking based on what platform is being compiled
/// This allows a target to link against a dependency conditionally when it is being compiled for a compatible platform
/// E.g. An app linking against CarPlay only when built for iOS.
Expand Down