Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/XcodeGraph/Models/Target.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
55 changes: 55 additions & 0 deletions Tests/XcodeGraphTests/Models/TargetTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}