Commit 889b61b0 authored by Drew's avatar Drew

Merge pull request #43 from AnarchyTools/flatten_imports

Flatten imports
parents 43bf8b1a cf797fec
Pipeline #949 passed with stage
Subproject commit 3cf366c04c5ed99230ccd9483f1bba03c10d2fc5
Subproject commit 80ca30adf95c2e94d6050ad0e6c797a1c2900837
......@@ -23,9 +23,9 @@ final public class TaskRunner {
private init() {}
static public func runTask(task: Task, package: Package) {
print("Running task \(task.key)...")
print("Running task \(task.qualifiedName)...")
let tool = toolByName(task.tool)
tool.run(task)
print("Completed task \(task.key).")
print("Completed task \(task.qualifiedName).")
}
}
\ No newline at end of file
......@@ -202,7 +202,7 @@ final class ATllbuild : Tool {
"xctestStrict"]
for key in task.allKeys {
if !knownOptions.contains(key) {
print("Warning: unknown option \(key) for task \(task.key)")
print("Warning: unknown option \(key) for task \(task.qualifiedName)")
}
}
......@@ -255,7 +255,7 @@ final class ATllbuild : Tool {
}
guard let sourceDescriptions = task["source"]?.vector?.flatMap({$0.string}) else { fatalError("Can't find sources for atllbuild.") }
var sources = collectSources(sourceDescriptions, task: task)
var sources = collectSources(sourceDescriptions, taskForCalculatingPath: task)
//xctestify
if task["xctestify"]?.bool == true {
......
......@@ -26,6 +26,16 @@ This is useful to depend on tasks specified in another package.
)
```
You can also reference remote tasks on the command line by providing their fully-qualified name:
```bash
$ atbuild atpkg.atpkg
$ atbuild mytask
$ atbuild atbuild.mytask #equivalent to previous line
```
Packages are imported in a flat topology; if `a` imports `b` and `b` imports `c`, use `c.taskname` to refer to the task, not `b.c.taskname` or `a.b.c.taskname`.
# Implementation note
Remote packages may have paths specified in a key, like "source". *Quite possibly, these keys should be interpreted relative to the path the task was declared in, NOT the working directory.*
......
......@@ -16,7 +16,7 @@ if $ATBUILD 2&> /tmp/warnings.txt; then
echo "No tool specified but passed anyway?"
exit 1
fi
if ! grep "No tool for task default; did you forget to specify it?" /tmp/warnings.txt; then
if ! grep "No tool for task agressive.default; did you forget to specify it?" /tmp/warnings.txt; then
echo "Got an error other than one prompting for the correct tool"
exit 1
fi
......
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