Swiftpack.co - 0x973/XcodeManager as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by 0x973.
0x973/XcodeManager 0.3.0
A swift module to manipulate Xcode projects(project.pbxproj),written in swift
⭐️ 4
🕓 7 weeks ago
.package(url: "https://github.com/0x973/XcodeManager.git", from: "0.3.0")

XcodeManager

Build Status Carthage compatible Platform

The better way to manage the Xcode project file (project.pbxproj) in swift. This swift module lets you automate the modification process.

Requirements

  • macOS 10.12+
  • Xcode 8+

Integration

Swift Package Manager

.package(url: "https://github.com/0x973/XcodeManager.git", from: "0.2.0")

Carthage

You can use Carthage to install XcodeManager by adding it to your Cartfile:

github "0x973/XcodeManager" ~> 0.2.0

Usage

  1. import module.
import XcodeManager
  1. Initialize the Xcode project file.
var project = try? XcodeManager(projectFile: "../.../xxx.xcodeproj", printLog: true)
  1. How to add static library in Xcode project?
project.linkStaticLibrary("../.../test.a")
  1. How to add framework in Xcode project?
project.linkFramework("../.../test.framework")
  1. How to add resources folder in Xcode project?
project.addFolder("../.../test/")
  1. How to add a single resources file in Xcode project?
project.addFile("../.../test.txt")
  1. How to modify the product name (display name)?
project.setProductName("TestProduct")
  1. How to modify the Bundle Identifier?
project.setBundleId("cn.x0x01.TestProduct")
  1. How to add new value?
project.setLibrarySearchPathValue("$(PROJECT_DIR)/TestProduct/Folder")
  1. How to add new value?
project.setFrameworkSearchPathValue("$(PROJECT_DIR)/TestProduct/Folder")
  1. How to control the CodeSignStyle(manual OR automatic)?
project.setCodeSignStyle(type: .automatic)
project.setCodeSignStyle(type: .manual)
  1. Complete modification? Write to a .pbxproj file!
let isSaveSuccess = try? project.save()
if (isSaveSuccess) {
	print("Done!")
}

GitHub

link
Stars: 4
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics