Skip to content

Commit 71f9ecf

Browse files
authored
Merge pull request #962 from owenv/owenv/abtype
Compare file types instead of extensions when identifying artifact bundles
2 parents 6731317 + ba2e941 commit 71f9ecf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ package final class GlobalProductPlan: GlobalTargetInfoProvider
467467
}
468468
let settings = buildRequestContext.getCachedSettings(configuredTarget.parameters, target: configuredTarget.target, provisioningTaskInputs: provisioningInputs[configuredTarget])
469469
let scope = settings.globalScope
470+
let specLookupContext = SpecLookupCtxt(specRegistry: workspaceContext.core.specRegistry, platform: settings.platform)
471+
guard let artifactBundleFileType = specLookupContext.lookupFileType(identifier: "wrapper.artifactbundle") else {
472+
continue
473+
}
470474

471475
// Parse artifact bundle info from any bundles this target directly depends upon.
472476
//
@@ -480,7 +484,8 @@ package final class GlobalProductPlan: GlobalTargetInfoProvider
480484
guard case .reference(let referenceGUID) = buildFile.buildableItem else { continue }
481485
guard let reference = workspaceContext.workspace.lookupReference(for: referenceGUID) else { continue }
482486
let resolvedPath = settings.filePathResolver.resolveAbsolutePath(reference)
483-
if resolvedPath.fileExtension == "artifactbundle" {
487+
// TODO: Remove the fileExtension check once SwiftPM has been updated to consistently set the file type on artifact bundle references in PIF
488+
if resolvedPath.fileExtension == "artifactbundle" || specLookupContext.lookupFileType(reference: reference)?.conformsTo(artifactBundleFileType) == true {
484489
do {
485490
let metadata = try metadataCache.getOrInsert(resolvedPath) {
486491
try ArtifactBundleMetadata.parse(at: resolvedPath, fileSystem: buildRequestContext.fs)

0 commit comments

Comments
 (0)