diff --git a/Sources/XcodeGraph/Models/Target.swift b/Sources/XcodeGraph/Models/Target.swift index 0d635e54..bdabad06 100644 --- a/Sources/XcodeGraph/Models/Target.swift +++ b/Sources/XcodeGraph/Models/Target.swift @@ -253,14 +253,14 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { .stickerPackExtension, .appClip, .systemExtension, - .extensionKitExtension: - return true - - case .commandLineTool, + .extensionKitExtension, + .commandLineTool, .macro, - .dynamicLibrary, - .staticLibrary, .xpc: + return true + + case .dynamicLibrary, + .staticLibrary: return false } } diff --git a/Tests/XcodeGraphTests/Models/TargetTests.swift b/Tests/XcodeGraphTests/Models/TargetTests.swift index e1ea8f49..9c5cedcb 100644 --- a/Tests/XcodeGraphTests/Models/TargetTests.swift +++ b/Tests/XcodeGraphTests/Models/TargetTests.swift @@ -112,4 +112,59 @@ final class TargetTests: XCTestCase { // Then XCTAssertTrue(got) } + + func test_supportsResources_returns_true_for_command_line_tools() { + // Given + let target = Target.test(destinations: .macOS, product: .commandLineTool) + + // When + let got = target.supportsResources + + // Then + XCTAssertTrue(got) + } + + func test_supportsResources_returns_true_for_macros() { + // Given + let target = Target.test(destinations: .macOS, product: .macro) + + // When + let got = target.supportsResources + + // Then + XCTAssertTrue(got) + } + + func test_supportsResources_returns_true_for_xpc_services() { + // Given + let target = Target.test(destinations: .macOS, product: .xpc) + + // When + let got = target.supportsResources + + // Then + XCTAssertTrue(got) + } + + func test_supportsResources_returns_false_for_static_libraries() { + // Given + let target = Target.test(product: .staticLibrary) + + // When + let got = target.supportsResources + + // Then + XCTAssertFalse(got) + } + + func test_supportsResources_returns_false_for_dynamic_libraries() { + // Given + let target = Target.test(product: .dynamicLibrary) + + // When + let got = target.supportsResources + + // Then + XCTAssertFalse(got) + } }