Skip to content

Commit

Permalink
Rename master to main
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Piñera committed Oct 28, 2020
1 parent 04e7c3b commit 98ac405
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Check out the organization [CODE OF CONDUCT](https://github.com/tuist/tuist/blob/master/docs/contribution/code-of-conduct.md)
Check out the organization [CODE OF CONDUCT](https://github.com/tuist/tuist/blob/main/docs/contribution/code-of-conduct.md)
11 changes: 6 additions & 5 deletions Documentation/migration-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ This improvement makes the API easier, safer and more convenient, but at the cos

- `PBXObjectReference` is an internal class now. Object references to other objects are attributes with the type of the object that is being referred. For example, a `XCConfigurationList` object has an attribute `buildConfigurations` of type `XCBuildConfiguration`. Adding a new configuration is as easy as calling `list.buildConfigurations.append(config)`.
- Note that object references have different types of optionals based on the type of attribute:
- **Implicitly unwrapped optional:** When the attribute is required by Xcode. [Example](https://github.com/tuist/xcodeproj/blob/master/Sources/XcodeProj/Objects/Project/PBXProject.swift#L38)
- **Explicitly unwrapped optional:** When the attribute is optional by Xcode. [Example](https://github.com/tuist/xcodeproj/blob/master/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift#L11)
- `PBXObjects` has also been made internal. It was exposed through the attribute `objects` on the `PBXProj` class. If you used to use this class for adding, removing, or getting objects, those methods have been moved to the `PBXProj` class - [Public helpers](https://github.com/tuist/xcodeproj/blob/master/Sources/XcodeProj/Objects/Project/PBXProj.swift#L85)
- **Implicitly unwrapped optional:** When the attribute is required by Xcode. [Example](https://github.com/tuist/xcodeproj/blob/main/Sources/XcodeProj/Objects/Project/PBXProject.swift#L38)
- **Explicitly unwrapped optional:** When the attribute is optional by Xcode. [Example](https://github.com/tuist/xcodeproj/blob/main/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift#L11)
- `PBXObjects` has also been made internal. It was exposed through the attribute `objects` on the `PBXProj` class. If you used to use this class for adding, removing, or getting objects, those methods have been moved to the `PBXProj` class - [Public helpers](https://github.com/tuist/xcodeproj/blob/main/Sources/XcodeProj/Objects/Project/PBXProj.swift#L85)

**And yes, in case you are wondering, it fully supports Xcode 10 🎉**

## To xcodeproj 5

`xcodeproj` 5 is a major release with important changes in the API focused on making it more convenient, and simplify the references handling. This version hasn't been officially released yet but you can already start updating your project for the new version. These are the changes you'd need to make in your projects:

- `xcproj` has been renamed to `xcodeproj` so you need to update all your import statements to use the new name.
- There's no support for Carthage nor CocoaPods anymore, if you were using them for fetching `xcodeproj`, you can use the Swift Package Manager and manually setup the dependency.
- We've replaced `Path` with `AbsolutePath` and `RelativePath` from the Swift Package Manager's `Basic` framework. You might need to change some of the usages to use the new type.
- Reference attributes have been renamed to use the naming convention `attributeReference` where `attribute` is the name of the attribute. If you are interested in materializing the reference to get the object, objects provide convenient getters that you can use for that purpose. Those getters throw if the object is not found in the project.

There are some useful additions to the API that you can check out on the [CHANGELOG](https://github.com/tuist/xcodeproj/blob/master/CHANGELOG.md).
There are some useful additions to the API that you can check out on the [CHANGELOG](https://github.com/tuist/xcodeproj/blob/main/CHANGELOG.md).

One of those additions is an improvement on how references are managed.
When new objects are added to the project, you get the object reference. The reference is an instance that should be used to refer that object from any other. **The value of that reference is an implementation detail that has been abstracted away from you.**
When new objects are added to the project, you get the object reference. The reference is an instance that should be used to refer that object from any other. **The value of that reference is an implementation detail that has been abstracted away from you.**
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/)
[![Release](https://img.shields.io/github/release/tuist/xcodeproj.svg)](https://github.com/tuist/xcodeproj/releases)
[![Code Coverage](https://codecov.io/gh/tuist/xcodeproj/branch/master/graph/badge.svg)](https://codecov.io/gh/tuist/xcodeproj)
[![Code Coverage](https://codecov.io/gh/tuist/xcodeproj/branch/main/graph/badge.svg)](https://codecov.io/gh/tuist/xcodeproj)
[![Slack](http://slack.tuist.io/badge.svg)](http://slack.tuist.io/)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/tuist/xcodeproj/blob/master/LICENSE.md)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md)

XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired by [CocoaPods XcodeProj](https://github.com/CocoaPods/Xcodeproj) and [xcode](https://www.npmjs.com/package/xcode).

Expand Down Expand Up @@ -122,7 +122,7 @@ Want to start using XcodeProj? Start by digging into our [documentation](/Docume
- [Xcodeproj](https://github.com/CocoaPods/Xcodeproj)
- [Nanaimo](https://github.com/CocoaPods/Nanaimo)
- [Facebook Buck](https://buckbuild.com/javadoc/com/facebook/buck/apple/xcode/xcodeproj/package-summary.html)
- [Swift Package Manager - Xcodeproj](https://github.com/apple/swift-package-manager/tree/master/Sources/Xcodeproj)
- [Swift Package Manager - Xcodeproj](https://github.com/apple/swift-package-manager/tree/main/Sources/Xcodeproj)
## Contributing
Expand All @@ -132,7 +132,7 @@ Want to start using XcodeProj? Start by digging into our [documentation](/Docume
## License
XcodeProj is released under the MIT license. [See LICENSE](https://github.com/tuist/xcodeproj/blob/master/LICENSE.md) for details.
XcodeProj is released under the MIT license. [See LICENSE](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md) for details.
## Open source
Expand Down
8 changes: 4 additions & 4 deletions Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ final class PBXProjectTests: XCTestCase {
// When
let remoteReference = try project.addSwiftPackage(repositoryURL: "url",
productName: "Product",
versionRequirement: .branch("master"),
versionRequirement: .branch("main"),
targetName: "Target")

// Then
Expand Down Expand Up @@ -186,11 +186,11 @@ final class PBXProjectTests: XCTestCase {
// When
let packageProduct = try project.addSwiftPackage(repositoryURL: "url",
productName: "Product",
versionRequirement: .branch("master"),
versionRequirement: .branch("main"),
targetName: target.name)
let secondPackageProduct = try project.addSwiftPackage(repositoryURL: "url",
productName: "Product",
versionRequirement: .branch("master"),
versionRequirement: .branch("main"),
targetName: secondTarget.name)

// Then
Expand All @@ -202,7 +202,7 @@ final class PBXProjectTests: XCTestCase {

XCTAssertThrowsSpecificError(try project.addSwiftPackage(repositoryURL: "url",
productName: "Product",
versionRequirement: .branch("second-master"),
versionRequirement: .branch("second-main"),
targetName: secondTarget.name),
PBXProjError.multipleRemotePackages(productName: "Product"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ final class XCRemoteSwiftPackageReferenceTests: XCTestCase {

func test_versionRequirement_returnsTheRightPlistValues_when_branch() throws {
// When
let subject = XCRemoteSwiftPackageReference.VersionRequirement.branch("master")
let subject = XCRemoteSwiftPackageReference.VersionRequirement.branch("main")

// Given
let got = subject.plistValues()

// Then
XCTAssertEqual(got, [
"kind": "branch",
"branch": .string(.init("master")),
"branch": .string(.init("main")),
])
}

Expand Down

0 comments on commit 98ac405

Please sign in to comment.