Skip to content

ProjectKit is a macOS Swift framework for parsing Xcode project files.

License

Notifications You must be signed in to change notification settings

apparata/ProjectKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProjectKit

Carthage compatible SwiftPM compatible license language Swift 5 platform macOS

ProjectKit is a Swift framework for parsing Xcode project files.

Example

Here's an example that loads an Xcode project file and prints the name of all targets in the project.

import ProjectKit

let url = URL(fileURLWithPath: "<YourProject>.pbxproj")

do {
    
    let project = try XcodeProject(url: url)

    print(project)
    
    for (targetID, target) in project.nativeTargets {
        print(target.name)
    }

} catch XcodeProjectError.failedToOpenProjectFile {
    print("Failed to open project file.")
} catch XcodeProjectError.failedToParseProjectFile {
    print("Failed to parse project file.")
}

Installation

Carthage

ProjectKit is Carthage compatible.

  1. Add Carthage/Build and Carthage/Checkouts to your .gitignore, if you're using git.

  2. Create a Carthage folder in your repo. You could name it Carthage, for example.

  3. Create a text file in that folder and name it Cartfile.

  4. Add the following line to the Cartfile:

    git "git@github.com:apparata/ProjectKit.git" "master"

  5. Then update using Carthage from the command line for whichever platform you want to build for:

    carthage update

  6. Build result (ProjectKit.framework) is found in Carthage/Build/Mac/.

  7. Make sure you check in Cartfile.resolved.

  8. Add ProjectKit.framework to your project.