Skip to content

Commit

Permalink
Merge branch 'main' into linux-support-remove-cext
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottwilliams committed Nov 10, 2020
2 parents 5b17e9a + b370051 commit e56c0da
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 54 deletions.
78 changes: 78 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "jcolicchio",
"name": "Joseph Colicchio",
"avatar_url": "https://avatars3.githubusercontent.com/u/2837288?v=4",
"profile": "https://joecolicch.io",
"contributions": [
"ideas"
]
},
{
"login": "deatondg",
"name": "deatondg",
"avatar_url": "https://avatars0.githubusercontent.com/u/3221590?v=4",
"profile": "https://github.com/deatondg",
"contributions": [
"ideas"
]
},
{
"login": "dflems",
"name": "Dan Fleming",
"avatar_url": "https://avatars3.githubusercontent.com/u/925850?v=4",
"profile": "https://github.com/dflems",
"contributions": [
"code"
]
},
{
"login": "sascha",
"name": "Sascha Schwabbauer",
"avatar_url": "https://avatars3.githubusercontent.com/u/895505?v=4",
"profile": "https://twitter.com/_SaschaS",
"contributions": [
"ideas"
]
},
{
"login": "marciniwanicki",
"name": "Marcin Iwanicki",
"avatar_url": "https://avatars3.githubusercontent.com/u/946649?v=4",
"profile": "https://github.com/marciniwanicki",
"contributions": [
"maintenance"
]
},
{
"login": "adamkhazi",
"name": "Adam Khazi",
"avatar_url": "https://avatars2.githubusercontent.com/u/9820670?v=4",
"profile": "https://github.com/adamkhazi",
"contributions": [
"maintenance"
]
},
{
"login": "elliottwilliams",
"name": "Elliott Williams",
"avatar_url": "https://avatars3.githubusercontent.com/u/910198?v=4",
"profile": "https://github.com/elliottwilliams",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"projectName": "XcodeProj",
"projectOwner": "tuist",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
- Tested for compatibility with Swift 5.3 on Ubuntu 18.04.
- XcodeProj requires FoundationXML / libxml2, which is part of the standard Swift Linux toolchain but not necessarily available in all environments.

## 7.17.0 - Tempelhof

### Added

- Added the `com.apple.product-type.metal-library` PBXProductType [#576](https://github.com/tuist/XcodeProj/pull/576) by [@deatondg](https://github.com/deatondg).
- Deprecate PBXBuildPhase.type() function https://github.com/tuist/XcodeProj/pull/571 by [@marciniwanicki](https://github.com/marciniwanicki).
- Added `runOncePerArchitecture` attribute to `PBXBuildRule` https://github.com/tuist/XcodeProj/pull/570 by @sascha

## 7.16.0 - Cieza

### Added
Expand All @@ -19,8 +27,6 @@
### Fixed

- explicitFileType corrected for .bundle https://github.com/tuist/XcodeProj/pull/563 by @adamkhazi
### Added
- Added `runOncePerArchitecture` attribute to `PBXBuildRule` https://github.com/tuist/XcodeProj/pull/570 by @sascha

### Added

Expand Down
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.**
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ source "https://rubygems.org"

gem "rake"
gem "jazzy"
gem "cocoapods", "1.9.3"
gem "cocoapods", "1.10.0"
gem "colorize", "~> 0.8.1"
gem "redcarpet", "~> 3.5.0"
51 changes: 27 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.2)
activesupport (4.2.11.3)
i18n (~> 0.7)
activesupport (5.2.4.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
algoliasearch (1.27.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.0.3)
cocoapods (1.9.3)
activesupport (>= 4.0.2, < 5)
cocoapods (1.10.0)
addressable (~> 2.6)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.9.3)
cocoapods-core (= 1.10.0)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
Expand All @@ -30,28 +31,29 @@ GEM
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.14.0, < 2.0)
cocoapods-core (1.9.3)
activesupport (>= 4.0.2, < 6)
xcodeproj (>= 1.19.0, < 2.0)
cocoapods-core (1.10.0)
activesupport (> 5.0, < 6)
addressable (~> 2.6)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.3.0)
cocoapods-downloader (1.4.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.5.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
colorize (0.8.1)
concurrent-ruby (1.1.6)
concurrent-ruby (1.1.7)
escape (0.0.4)
ethon (0.12.0)
ffi (>= 1.3.0)
Expand All @@ -60,9 +62,9 @@ GEM
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (0.9.5)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jazzy (0.13.5)
jazzy (0.13.6)
cocoapods (~> 1.5)
mustache (~> 1.1)
open4
Expand All @@ -73,39 +75,40 @@ GEM
xcinvoke (~> 0.3.0)
json (2.3.1)
liferaft (0.0.6)
minitest (5.14.1)
minitest (5.14.2)
molinillo (0.6.6)
mustache (1.1.1)
nanaimo (0.2.6)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
open4 (1.3.4)
public_suffix (4.0.6)
rake (13.0.1)
redcarpet (3.5.0)
rouge (3.20.0)
rouge (3.24.0)
ruby-macho (1.4.0)
sassc (2.4.0)
ffi (~> 1.9)
sqlite3 (1.4.2)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.7)
tzinfo (1.2.8)
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.17.0)
xcodeproj (1.19.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.6)
nanaimo (~> 0.3.0)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.9.3)
cocoapods (= 1.10.0)
colorize (~> 0.8.1)
jazzy
rake
Expand Down
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# XcodeProj
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

[![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 @@ -37,7 +40,7 @@ Add the dependency in your `Package.swift` file:
let package = Package(
name: "myproject",
dependencies: [
.package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.16.0"))
.package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.17.0"))
],
targets: [
.target(
Expand All @@ -59,7 +62,7 @@ github "tuist/xcodeproj" ~> 7.11.
### CocoaPods

```ruby
pod 'xcodeproj', '~> 7.16.0
pod 'xcodeproj', '~> 7.17.0
```
### Scripting
Expand Down Expand Up @@ -122,7 +125,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,10 +135,29 @@ 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
## Contributors ✨
Tuist is a proud supporter of the [Software Freedom Conservacy](https://sfconservancy.org/)
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<a href="https://sfconservancy.org/supporter/"><img src="https://sfconservancy.org/img/supporter-badge.png" width="194" height="90" alt="Become a Conservancy Supporter!" border="0"/></a>
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://joecolicch.io"><img src="https://avatars3.githubusercontent.com/u/2837288?v=4" width="100px;" alt=""/><br /><sub><b>Joseph Colicchio</b></sub></a><br /><a href="#ideas-jcolicchio" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/deatondg"><img src="https://avatars0.githubusercontent.com/u/3221590?v=4" width="100px;" alt=""/><br /><sub><b>deatondg</b></sub></a><br /><a href="#ideas-deatondg" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/dflems"><img src="https://avatars3.githubusercontent.com/u/925850?v=4" width="100px;" alt=""/><br /><sub><b>Dan Fleming</b></sub></a><br /><a href="https://github.com/tuist/XcodeProj/commits?author=dflems" title="Code">💻</a></td>
<td align="center"><a href="https://twitter.com/_SaschaS"><img src="https://avatars3.githubusercontent.com/u/895505?v=4" width="100px;" alt=""/><br /><sub><b>Sascha Schwabbauer</b></sub></a><br /><a href="#ideas-sascha" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/marciniwanicki"><img src="https://avatars3.githubusercontent.com/u/946649?v=4" width="100px;" alt=""/><br /><sub><b>Marcin Iwanicki</b></sub></a><br /><a href="#maintenance-marciniwanicki" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/adamkhazi"><img src="https://avatars2.githubusercontent.com/u/9820670?v=4" width="100px;" alt=""/><br /><sub><b>Adam Khazi</b></sub></a><br /><a href="#maintenance-adamkhazi" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/elliottwilliams"><img src="https://avatars3.githubusercontent.com/u/910198?v=4" width="100px;" alt=""/><br /><sub><b>Elliott Williams</b></sub></a><br /><a href="https://github.com/tuist/XcodeProj/commits?author=elliottwilliams" title="Code">💻</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
1 change: 1 addition & 0 deletions Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public extension PBXBuildPhase {
/// Returns the build phase type.
///
/// - Returns: build phase type.
@available(*, deprecated, message: "Please use buildPhase property instead")
func type() -> BuildPhase? {
buildPhase
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeProj/Objects/Project/PBXObjects.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class PBXObjects: Equatable {
/// - objects: project objects
init(objects: [PBXObject] = []) {
objects.forEach {
_ = self.add(object: $0)
self.add(object: $0)
}
}

Expand Down
3 changes: 3 additions & 0 deletions Sources/XcodeProj/Objects/Targets/PBXProductType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public enum PBXProductType: String, Decodable {
case instrumentsPackage = "com.apple.product-type.instruments-package"
case intentsServiceExtension = "com.apple.product-type.app-extension.intents-service"
case onDemandInstallCapableApplication = "com.apple.product-type.application.on-demand-install-capable"
case metalLibrary = "com.apple.product-type.metal-library"

/// Returns the file extension for the given product type.
public var fileExtension: String? {
Expand Down Expand Up @@ -56,6 +57,8 @@ public enum PBXProductType: String, Decodable {
return "instrpkg"
case .xcFramework:
return "xcframework"
case .metalLibrary:
return "metallib"
case .none:
return nil
}
Expand Down
Loading

0 comments on commit e56c0da

Please sign in to comment.