Skip to content

Cannot remove remotePackageΒ #802

@kevin-kp

Description

@kevin-kp

Context πŸ•΅οΈβ€β™€οΈ

We are trying to change the version of a package using XcodeProj. We are doing this by removing the package and readding the swift package.

What 🌱

On 8.12.0, this works without any issues. However, since #799 it seems that it isn't possible anymore to remove a swift package.
This is because the setter reads the existing packages when the value is changed. This means that it is only possible to add new packages:

var finalReferences: [PBXObjectReference] = packageReferences ?? [] // this contains the removed package
let newReferences = newValue.references()
for reference in newReferences {
    if !finalReferences.contains(reference) {
        finalReferences.append(reference)
    }
}
packageReferences = finalReferences

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions