Commit dfb7fb91 authored by Drew's avatar Drew

Compatibility with atbuild 0.6.0

parent 39cbaf04
Pipeline #1009 failed with stage
# xcode-emit
xcode-emit generates a complete development Xcode project for an Anarchy Tools package. This allows you to develop any atbuild package in Xcode.
The project emitted is fully-functional, and should allow debugging in Xcode as well. There may be minor differences from how `atbuild` builds packages; please file bugs if you spot them.
As the name suggests, `xcode-emit` is one-way. Source code changes you make edit the source files themselves (and thus are preserved), but any Xcode build settings you change will be lost the next time you use `xcode-emit`.
# Usage
```
xcode-emit 0.1.0-dev
© 2016 Anarchy Tools Contributors.
Usage: xcode-emit [task]
```
Subproject commit 28b7e5ced8f8d66748402d50f13af3cc099c0c85
Subproject commit ed592edde07245f9917b4819f6bbfd699004bebe
......@@ -16,16 +16,16 @@
(package
:name "xcode-emit"
:import ["atpkg/build.atpkg"]
:import-packages ["atpkg/build.atpkg"]
:tasks {
:xcodeemit {
:tool "atllbuild"
:source ["src/**.swift"]
:sources ["src/**.swift"]
:name "xcode_emit"
:outputType "executable"
:output-type "executable"
:dependencies ["atpkg.atpkg"]
:linkWithProduct ["atpkg.a"]
:link-with ["atpkg.a"]
}
:default {
......@@ -34,7 +34,7 @@
:script "mv .atllbuild/products/xcode_emit .atllbuild/products/xcode-emit"
}
:test {
:check {
:tool "shell"
:script ".atllbuild/products/xcode-emit xcodeemit"
:dependencies ["default"]
......
......@@ -42,22 +42,22 @@ func process(tasks: [Task], package: Package) -> [PbxprojSerializable] {
objects.appendContentsOf(process(nextTasks, package: package))
}
guard let taskname = task["name"]?.string else { fatalError("No task name.")}
guard let sourceDescriptions = task["source"]?.vector?.flatMap({$0.string}) else { fatalError("Can't find sources for atllbuild.") }
let sources = collectSources(sourceDescriptions, task: task)
guard let sourceDescriptions = task["sources"]?.vector?.flatMap({$0.string}) else { fatalError("Can't find sources for atllbuild.") }
let sources = collectSources(sourceDescriptions, taskForCalculatingPath: task)
//emit the pbxproj
let outputType : OutputType
if task["outputType"]?.string == "executable" {
if task["output-type"]?.string == "executable" {
outputType = .Executable
}
else if task["outputType"]?.string == "static-library" {
else if task["output-type"]?.string == "static-library" {
outputType = .StaticLibrary
}
else {
fatalError("Unsupported output type \(task["outputType"])")
fatalError("Unsupported output type \(task["output-type"])")
}
var linkWith : [PbxProductReference] = []
if let l = task["linkWithProduct"]?.vector {
if let l = task["link-with"]?.vector {
for item in l {
guard let str = item.string else { fatalError("Not string link target \(item)")}
//find the productRef to link to
......
......@@ -24,7 +24,7 @@ func usage() {
print("Usage: xcode-emit [task]")
}
guard let package = Package(filepath:"build.atpkg") else { fatalError("Can't load build.atpkg")}
guard let package = Package(filepath:"build.atpkg", overlay: []) else { fatalError("Can't load build.atpkg")}
if Process.arguments.count <= 1 {
usage()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment