1 Star 0 Fork 0

hugo/PBXProjGo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.go 1012 Bytes
一键复制 编辑 原始数据 按行查看 历史
hugo 提交于 2020-11-20 14:06 +08:00 . fix mod name
package main
import (
"fmt"
"path/filepath"
"github.com/hugohuang1111/PBXProjGo/pbxproj"
)
func main() {
pbxFilePath, _ := filepath.Abs("projects/Test/Test.xcodeproj/project.pbxproj")
pbxProject, e := pbxproj.NewPBXProject(pbxFilePath)
if nil != e {
fmt.Println(e.Error())
return
}
// get targets
targets := pbxProject.GetTargets()
targetName := targets[0]
// add source file
pbxProject.AddSourceFile(targetName, "Test", "Test/T.m")
// add header file
pbxProject.AddHeaderFile(targetName, "Test", "Test/T.h")
// add framework
pbxProject.AddFramework(targetName, "Accounts.framework")
// modify build setting
// val := pbxProject.GetBuildSetting(targetName, "Debug", "OTHER_LDFLAGS")
// lfs := make([]interface{}, 0)
// if nil != val {
// lfs = val.([]interface{})
// }
// lfs = append(lfs, "kk-kk")
// pbxProject.SetBuildSetting(targetName, "Debug", "OTHER_LDFLAGS", lfs)
// save file
e = pbxProject.Save(pbxFilePath)
if nil != e {
fmt.Println(e.Error())
return
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hugohuang1111/pbxprojgo.git
[email protected]:hugohuang1111/pbxprojgo.git
hugohuang1111
pbxprojgo
PBXProjGo
master

搜索帮助