Commit ad0f0d01 authored by Drew's avatar Drew

Add overlay support

Close #24
parent 35ffbe76
......@@ -28,17 +28,15 @@ let defaultBuildFile = "build.atpkg"
func loadPackageFile() -> Package {
//build configurations
var configurations : [String:String] = [:]
//build overlays
var overlays : [String] = []
for (i, x) in Process.arguments.enumerate() {
if x.hasPrefix("--") && x != "--help" {
let configurationName = x.substringFromIndex(x.startIndex.advancedBy(2))
let configurationValue = Process.arguments[i+1]
configurations[configurationName] = configurationValue
if x == "--overlay" {
let overlay = Process.arguments[i+1]
overlays.append(overlay)
}
}
print("configurations \(configurations)")
guard let package = Package(filepath: defaultBuildFile, configurations: configurations) else {
guard let package = Package(filepath: defaultBuildFile, overlay: overlays) else {
print("Unable to load build file: \(defaultBuildFile)")
exit(1)
}
......@@ -47,7 +45,7 @@ func loadPackageFile() -> Package {
}
//usage message
if Process.arguments.count > 1 && Process.arguments[1] == "--help" {
if Process.arguments.contains("--help") {
print("atbuild - Anarchy Tools Build Tool \(version)")
print("https://github.com/AnarchyTools")
print("© 2016 Anarchy Tools Contributors.")
......@@ -59,8 +57,7 @@ if Process.arguments.count > 1 && Process.arguments[1] == "--help" {
print("tasks:")
for (key, task) in package.tasks {
print(" \(key)")
}
}
exit(1)
}
......
Subproject commit cb28b45a2c5890306a14cce79d8cca3c82d6bfc0
Subproject commit 12ee41f84038d3d12fa34dabfe2e43df780dbe07
......@@ -34,4 +34,14 @@ else
fi
fi
echo "*****************OVERLAY CHECKS**********************"
cd $DIR/tests/fixtures/overlay
#if $ATBUILD; then
# echo "Expected a failure in overlay"
# exit 1
#fi
$ATBUILD --overlay got-overlay
echo "***ATBUILD TEST SCRIPT PASSED SUCCESSFULLY*****"
\ No newline at end of file
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