pbxproj

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2022 License: Apache-2.0

README

XcodeProj

Go implement of Parser utility for xcodeproj project files, Allows you to edit xcodeproject files and write them back out.

It's heavily mimicked and inspired by cordova-node-xcode

Usage

    import "github.com/soapy/xcodeproj"

    // Create a new project
    projectPath := "project.pbxproj"
    project := pbxproj.NewPbxProject(projectPath)
    // Parse the project
    err := project.Parse()
    if err != nil {
        panic(err)
    }
    // Dump the project structure as JSON
    // project.Dump(os.Stdout)

    // Add a new Source file
    err = project.AddSourceFile("foo.m")
    if err != nil {
        panic(err)
    }

    // Write the project back out
    pbxproj.NewPbxWriter(&project).Write("project.pbxproj")

Working on the parser

The .pbxProj parser(pegparser/pbxproj.go) is generated from the grammar in pegparser/pbxproj.peg by pigeon.

If there's a problem parsing, you need to edit the grammar in pbxproj.peg and regenerate the parser.

# install the pigeon tool
$ go get -u github.com/mna/pigeon

$ pigeon -o pegparser/pbxproj.go pegparser/pbxproj.peg

License

Apache V2

Directories

Path Synopsis
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL