pbxproj

package
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 Imports: 13 Imported by: 0

Documentation

Overview

* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	DEFAULT_SOURCETREE         = "\"<group>\""
	DEFAULT_PRODUCT_SOURCETREE = "BUILT_PRODUCTS_DIR"
	DEFAULT_FILEENCODING       = 4
	DEFAULT_GROUP              = "Resources"
	DEFAULT_FILETYPE           = "unknown"
)
View Source
const COMMENT_KEY_SUFFIX = "_comment"
View Source
const DEFAULT_ENCODING_VALUE = 4
View Source
const (
	INDENT = "\t"
)

Variables

View Source
var ENCODING_BY_FILETYPE = map[string]int{
	"sourcecode.c.h":     DEFAULT_ENCODING_VALUE,
	"sourcecode.c.objc":  DEFAULT_ENCODING_VALUE,
	"sourcecode.swift":   DEFAULT_ENCODING_VALUE,
	"text":               DEFAULT_ENCODING_VALUE,
	"text.plist.xml":     DEFAULT_ENCODING_VALUE,
	"text.script.sh":     DEFAULT_ENCODING_VALUE,
	"text.xcconfig":      DEFAULT_ENCODING_VALUE,
	"text.plist.strings": DEFAULT_ENCODING_VALUE,
}
View Source
var EXTENSION_BY_FILETYPE = revertMap(FILETYPE_BY_EXTENSION)
View Source
var FILETYPE_BY_EXTENSION = map[string]string{
	"a":           "archive.ar",
	"app":         "wrapper.application",
	"appex":       "wrapper.app-extension",
	"bundle":      "wrapper.plug-in",
	"dylib":       "compiled.mach-o.dylib",
	"framework":   "wrapper.framework",
	"h":           "sourcecode.c.h",
	"m":           "sourcecode.c.objc",
	"markdown":    "text",
	"mdimporter":  "wrapper.cfbundle",
	"octest":      "wrapper.cfbundle",
	"pch":         "sourcecode.c.h",
	"plist":       "text.plist.xml",
	"sh":          "text.script.sh",
	"swift":       "sourcecode.swift",
	"tbd":         "sourcecode.text-based-dylib-definition",
	"xcassets":    "folder.assetcatalog",
	"xcconfig":    "text.xcconfig",
	"xcdatamodel": "wrapper.xcdatamodel",
	"xcodeproj":   "wrapper.pb-project",
	"xctest":      "wrapper.cfbundle",
	"xib":         "file.xib",
	"strings":     "text.plist.strings",
}
View Source
var GROUP_BY_FILETYPE = map[string]string{
	"archive.ar":                             "Frameworks",
	"compiled.mach-o.dylib":                  "Frameworks",
	"sourcecode.text-based-dylib-definition": "Frameworks",
	"wrapper.framework":                      "Frameworks",
	"embedded.framework":                     "Embed Frameworks",
	"sourcecode.c.h":                         "Resources",
	"sourcecode.c.objc":                      "Sources",
	"sourcecode.swift":                       "Sources",
}
View Source
var PATH_BY_FILETYPE = map[string]string{
	"compiled.mach-o.dylib":                  "usr/lib/",
	"sourcecode.text-based-dylib-definition": "usr/lib/",
	"wrapper.framework":                      "System/Library/Frameworks/",
}
View Source
var SOURCETREE_BY_FILETYPE = map[string]string{
	"compiled.mach-o.dylib":                  "SDKROOT",
	"sourcecode.text-based-dylib-definition": "SDKROOT",
	"wrapper.framework":                      "SDKROOT",
}

Functions

This section is empty.

Types

type CommentValue

type CommentValue struct {
	Value   string
	Comment string
}

func (CommentValue) ToObject

func (c CommentValue) ToObject() pegparser.Object

type FileReferenceAndBase

type FileReferenceAndBase struct {
	FileRef  string
	Basename string
}

type FindGroupCriteria

type FindGroupCriteria struct {
	Name string
	Path string
}

type PbxFile

type PbxFile struct {
	Basename          string
	FileRef           string
	LastKnownFileType string
	Group             string
	CustomFramework   bool
	Dirname           string
	Path              string
	FileEncoding      int
	ExplicitFileType  string
	SourceTree        string
	DefaultEncoding   int
	IncludeInIndex    int
	Settings          pegparser.Object
	Uuid              string
	Target            string
	Models            []*PbxFile
	CurrentModel      *PbxFile
	Plugin            bool
}

type PbxFileOptions

type PbxFileOptions struct {
	LastKnownFileType string
	CustomFramework   bool
	DefaultEncoding   int
	ExplicitFileType  string
	SourceTree        string
	Weak              bool
	CompilerFlags     string
	Embed             bool
	Sign              bool
	Target            string
	Group             string
	Plugin            bool
	VariantGroup      bool
	IncludeInIndex    int
	Link              bool
}

type PbxProject

type PbxProject struct {
	// contains filtered or unexported fields
}

func NewPbxProject

func NewPbxProject(filename string) PbxProject

func (*PbxProject) AddBuildPhase

func (p *PbxProject) AddBuildPhase(filePathsArray []string, buildPhaseType, comment, target string, optionsOrFolderType interface{}, subfolderPath string)

func (*PbxProject) AddBuildProperty

func (p *PbxProject) AddBuildProperty(prop, value, build_name string)

func (*PbxProject) AddCopyfile

func (p *PbxProject) AddCopyfile(filePath string, params ...interface{}) error

func (*PbxProject) AddFile

func (p *PbxProject) AddFile(filePath string, params ...interface{}) error

func (*PbxProject) AddFramework

func (p *PbxProject) AddFramework(filePath string, params ...interface{}) error

func (*PbxProject) AddHeaderFile

func (p *PbxProject) AddHeaderFile(filePath string, params ...interface{}) error

func (*PbxProject) AddHeaderFileWithOptions

func (p *PbxProject) AddHeaderFileWithOptions(filePath string, params ...interface{}) error

func (*PbxProject) AddKnownRegion

func (p *PbxProject) AddKnownRegion(name string)

func (*PbxProject) AddLocalizationVariantGroup

func (p *PbxProject) AddLocalizationVariantGroup(name string) *PbxFile

func (*PbxProject) AddPbxGroup

func (p *PbxProject) AddPbxGroup(filePathsArray []string, name, path, sourceTree string)

func (*PbxProject) AddPluginFile

func (p *PbxProject) AddPluginFile(filePath string, params ...interface{}) error

func (*PbxProject) AddProductFile

func (p *PbxProject) AddProductFile(filePath string, params ...interface{}) error

func (*PbxProject) AddResourceFile

func (p *PbxProject) AddResourceFile(filePath string, params ...interface{}) error

func (*PbxProject) AddSourceFile

func (p *PbxProject) AddSourceFile(filePath string, params ...interface{}) error

func (*PbxProject) AddStaticLibrary

func (p *PbxProject) AddStaticLibrary(filePath string, params ...interface{}) error

func (*PbxProject) AddTarget

func (p *PbxProject) AddTarget(name, targetType, subfolder, bundleId string) error

func (*PbxProject) AddTargetAttribute

func (p *PbxProject) AddTargetAttribute(prop, value string, target pegparser.ObjectWithUUID) error

func (*PbxProject) AddTargetDependency

func (p *PbxProject) AddTargetDependency(target string, dependencyTargets []string)

func (*PbxProject) Contents

func (p *PbxProject) Contents() pegparser.Object

func (*PbxProject) Dump

func (p *PbxProject) Dump(writer io.Writer) error

func (*PbxProject) GetBuildProperty

func (p *PbxProject) GetBuildProperty(prop, build, targetName string) (props []string)

func (*PbxProject) HasKnownRegion

func (p *PbxProject) HasKnownRegion(name string) bool

func (*PbxProject) Parse

func (p *PbxProject) Parse() error

func (*PbxProject) RemoveBuildProperty

func (p *PbxProject) RemoveBuildProperty(prop, build_name string)

func (*PbxProject) RemoveCopyfile

func (p *PbxProject) RemoveCopyfile(filePath string, params ...interface{}) error

func (*PbxProject) RemoveFile

func (p *PbxProject) RemoveFile(filePath string, params ...interface{}) error

func (*PbxProject) RemoveFramework

func (p *PbxProject) RemoveFramework(filePath string, params ...interface{}) error

func (*PbxProject) RemoveHeaderFile

func (p *PbxProject) RemoveHeaderFile(filePath string, params ...interface{}) error

func (*PbxProject) RemoveKnownRegion

func (p *PbxProject) RemoveKnownRegion(name string)

func (*PbxProject) RemovePbxGroup

func (p *PbxProject) RemovePbxGroup(groupName string)

func (*PbxProject) RemovePluginFile

func (p *PbxProject) RemovePluginFile(filePath string, params ...interface{}) error

func (*PbxProject) RemoveProductFile

func (p *PbxProject) RemoveProductFile(filePath string, params ...interface{}) error

func (*PbxProject) RemoveResourceFile

func (p *PbxProject) RemoveResourceFile(filePath string, params ...interface{}) error

func (*PbxProject) RemoveSourceFile

func (p *PbxProject) RemoveSourceFile(filePath string, params ...interface{}) error

func (*PbxProject) RemoveTargetAttribute

func (p *PbxProject) RemoveTargetAttribute(prop string, target pegparser.ObjectWithUUID) error

func (*PbxProject) UpdateBuildProperty

func (p *PbxProject) UpdateBuildProperty(prop, value, build, targetName string)

func (*PbxProject) UpdateProductName

func (p *PbxProject) UpdateProductName(name string)

func (*PbxProject) WriteSync

func (p *PbxProject) WriteSync(options PbxProjectWriterOption) error

type PbxProjectWriterOption

type PbxProjectWriterOption struct {
}

type PbxWriter

type PbxWriter struct {
	// contains filtered or unexported fields
}

func NewPbxWriter

func NewPbxWriter(project *PbxProject, options ...PbxWriterOption) *PbxWriter

func (*PbxWriter) Write

func (w *PbxWriter) Write(filePath string) error

type PbxWriterOption

type PbxWriterOption func(w *PbxWriter)

func WithOmitEmpty

func WithOmitEmpty() PbxWriterOption

func WithStringWriter

func WithStringWriter(writer StringWriter) PbxWriterOption

type Setting

type Setting struct {
	ATTRIBUTES     []string
	COMPILER_FLAGS string
}

type StringWriter

type StringWriter interface {
	WriteString(string) (int, error)
	String() string
}

Jump to

Keyboard shortcuts

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