Commit 12d8f795 authored by Drew's avatar Drew

Merge pull request #60 from AnarchyTools/mute_warnings

Mute warnings
parents 63686847 4501e181
Pipeline #1149 passed with stage
......@@ -29,26 +29,23 @@ enum Options: String {
let defaultPackageFile = "build.atpkg"
func loadPackageFile() -> Package {
var focusOnTask : String? = nil
//build overlays
var overlays : [String] = []
for (i, x) in Process.arguments.enumerate() {
if x == Options.Overlay.rawValue {
let overlay = Process.arguments[i+1]
overlays.append(overlay)
}
//build overlays
var overlays : [String] = []
for (i, x) in Process.arguments.enumerate() {
if x == Options.Overlay.rawValue {
let overlay = Process.arguments[i+1]
overlays.append(overlay)
}
var packageFile = defaultPackageFile
for (i, x) in Process.arguments.enumerate() {
if x == Options.CustomFile.rawValue {
packageFile = Process.arguments[i+1]
}
}
var packageFile = defaultPackageFile
for (i, x) in Process.arguments.enumerate() {
if x == Options.CustomFile.rawValue {
packageFile = Process.arguments[i+1]
}
let package = try! Package(filepath: packageFile, overlay: overlays)
return package
}
let package = try! Package(filepath: packageFile, overlay: overlays, focusOnTask: focusOnTask)
//usage message
if Process.arguments.contains("--help") {
......@@ -59,7 +56,6 @@ if Process.arguments.contains("--help") {
print("Usage:")
print("atbuild [-f packagefile] [task] [--clean]")
let package = loadPackageFile()
print("tasks:")
for (key, task) in package.tasks {
print(" \(key)")
......@@ -67,10 +63,7 @@ if Process.arguments.contains("--help") {
exit(1)
}
let package = loadPackageFile()
print("Building package \(package.name)...")
func runtask(taskName: String) {
func runTask(taskName: String, package: Package) {
guard let task = package.tasks[taskName] else { fatalError("No \(taskName) task in build configuration.") }
for task in package.prunedDependencyGraph(task) {
TaskRunner.runTask(task, package: package)
......@@ -78,7 +71,6 @@ func runtask(taskName: String) {
}
//choose which task to run
var run = false
if Process.arguments.count > 1 {
var i = 1
while i < Process.arguments.count {
......@@ -87,16 +79,19 @@ if Process.arguments.count > 1 {
i += 1
}
else {
runtask(arg)
run = true
focusOnTask = arg
break
}
i += 1
}
}
if !run {
runtask("default")
if focusOnTask == nil {
focusOnTask = "default"
}
print("Building package \(package.name)...")
runTask(focusOnTask!, package: package)
//success message
print("Built package \(package.name).")
\ No newline at end of file
Subproject commit bf41f05bcd244687f996c4148e0478239801990a
Subproject commit 80e104244c8f04a249b06c9a1836b84c5fe58915
(package
:name "chained_overlays"
:tasks {
:default {
:tool "nop"
:dependencies ["child"]
:overlays {
}
}
:child {
:tool "nop"
}
}
)
\ No newline at end of file
......@@ -91,12 +91,17 @@ fi
cd $DIR/tests/fixtures/overlay
$ATBUILD --use-overlay got-overlay > /tmp/warnings.txt
if grep "Warning: " /tmp/warnings.txt; then
if grep "Warning: Can't apply overlay no-such-overlay to task chained_overlays.child" /tmp/warnings.txt; then
echo "Got a warning when building the overlay fixture"
exit 1
fi
cd $DIR/tests/fixtures/chained_overlays
$ATBUILD --use-overlay no-such-overlay > /tmp/warnings.txt
if grep "Warning: Can't apply overlay no-such-overlay to task chained_overlays.child" /tmp/warnings.txt; then
echo "Got a warning when building the chained_overlays fixture"
exit 1
fi
echo "****************HELP TEST*********************"
......
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