While building/cleaning Xcode project from command line is trivial task (hint: xcodebuild), managing the project content used to be the hard one. xcs is supposed to solve this problem: it provides a minimal set of tasks for adding/removing files for existing Xcode projects.
You'll need two gems: thor and rb-appscript. And then run
thor install https://github.com/gonzoua/xcs/raw/master/xcs.thor
Get full list of tasks using command
thor xcs:help
- xcs:add File [Group] Add file to a group. By default adds to "Source"
- xcs:help [TASK] Describe available tasks or one specific task
- xcs:list [--verbose] List project contents
- xcs:mkgroup Group Create new subgroup in root group
- xcs:rm Group/File Remove file reference from a project
- xcs:rmgroup Group Remove Group
Just cd to your project directory and run
thor xcs:list
You'll get something like this:
Using /Users/gonzo/Projects/EPUBToolkit/EPUBToolkit.xcodeproj
EPUBToolkit/
EPUBFile.h
EPUBFile.m
Source/
main.m
Documentation/
EPUBToolkit.1
Products/
EPUBToolkit
Frameworks/
Foundation.framework
Other Sources/
EPUBToolkit-Prefix.pch
Create a file and add it to project, to group FooSources
echo '#import "Foo.h"' > Foo.m
thor xcs:mkgroup FooSources
thor xcs:add Foo.m FooSources
- Only first-level groups are supported
- No targets support
Ideas are welcome. Open issue or drop me a line at gonzo@bluezbox.com
Pull requests are even more welcome.
See LICENSE