Commit b8374eb6 authored by Drew's avatar Drew

Mute warnings

Update for atpkg:mute_warnings, which changes the package constructor

We silence certain redundant warnings that are probably useless.
parent f9d7e606
Pipeline #1120 failed with stage
...@@ -27,7 +27,7 @@ enum Options: String { ...@@ -27,7 +27,7 @@ enum Options: String {
let defaultPackageFile = "build.atpkg" let defaultPackageFile = "build.atpkg"
func loadPackageFile() -> Package { func loadPackageFile(task: String?) -> Package {
//build overlays //build overlays
var overlays : [String] = [] var overlays : [String] = []
...@@ -43,7 +43,7 @@ func loadPackageFile() -> Package { ...@@ -43,7 +43,7 @@ func loadPackageFile() -> Package {
packageFile = Process.arguments[i+1] packageFile = Process.arguments[i+1]
} }
} }
let package = try! Package(filepath: packageFile, overlay: overlays) let package = try! Package(filepath: packageFile, overlay: overlays, focusOnTask: task)
return package return package
} }
...@@ -57,7 +57,7 @@ if Process.arguments.contains("--help") { ...@@ -57,7 +57,7 @@ if Process.arguments.contains("--help") {
print("Usage:") print("Usage:")
print("atbuild [-f packagefile] [task]") print("atbuild [-f packagefile] [task]")
let package = loadPackageFile() let package = loadPackageFile(nil)
print("tasks:") print("tasks:")
for (key, task) in package.tasks { for (key, task) in package.tasks {
print(" \(key)") print(" \(key)")
...@@ -65,10 +65,7 @@ if Process.arguments.contains("--help") { ...@@ -65,10 +65,7 @@ if Process.arguments.contains("--help") {
exit(1) exit(1)
} }
let package = loadPackageFile() func runtask(taskName: String, package: Package) {
print("Building package \(package.name)...")
func runtask(taskName: String) {
guard let task = package.tasks[taskName] else { fatalError("No \(taskName) task in build configuration.") } guard let task = package.tasks[taskName] else { fatalError("No \(taskName) task in build configuration.") }
for task in package.prunedDependencyGraph(task) { for task in package.prunedDependencyGraph(task) {
TaskRunner.runTask(task, package: package) TaskRunner.runTask(task, package: package)
...@@ -76,7 +73,7 @@ func runtask(taskName: String) { ...@@ -76,7 +73,7 @@ func runtask(taskName: String) {
} }
//choose which task to run //choose which task to run
var run = false var task : String? = nil
if Process.arguments.count > 1 { if Process.arguments.count > 1 {
var i = 1 var i = 1
while i < Process.arguments.count { while i < Process.arguments.count {
...@@ -85,16 +82,20 @@ if Process.arguments.count > 1 { ...@@ -85,16 +82,20 @@ if Process.arguments.count > 1 {
i += 1 i += 1
} }
else { else {
runtask(arg) task = arg
run = true
break break
} }
i += 1 i += 1
} }
} }
if !run { if task == nil {
runtask("default") task = "default"
} }
let package = loadPackageFile(task)
print("Building package \(package.name)...")
runtask(task!, package: package)
//success message //success message
print("Built package \(package.name).") 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 ...@@ -91,12 +91,17 @@ fi
cd $DIR/tests/fixtures/overlay cd $DIR/tests/fixtures/overlay
$ATBUILD --use-overlay got-overlay > /tmp/warnings.txt $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" echo "Got a warning when building the overlay fixture"
exit 1 exit 1
fi 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*********************" 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