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 {
let defaultPackageFile = "build.atpkg"
func loadPackageFile() -> Package {
func loadPackageFile(task: String?) -> Package {
//build overlays
var overlays : [String] = []
......@@ -43,7 +43,7 @@ func loadPackageFile() -> Package {
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
}
......@@ -57,7 +57,7 @@ if Process.arguments.contains("--help") {
print("Usage:")
print("atbuild [-f packagefile] [task]")
let package = loadPackageFile()
let package = loadPackageFile(nil)
print("tasks:")
for (key, task) in package.tasks {
print(" \(key)")
......@@ -65,10 +65,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)
......@@ -76,7 +73,7 @@ func runtask(taskName: String) {
}
//choose which task to run
var run = false
var task : String? = nil
if Process.arguments.count > 1 {
var i = 1
while i < Process.arguments.count {
......@@ -85,16 +82,20 @@ if Process.arguments.count > 1 {
i += 1
}
else {
runtask(arg)
run = true
task = arg
break
}
i += 1
}
}
if !run {
runtask("default")
if task == nil {
task = "default"
}
let package = loadPackageFile(task)
print("Building package \(package.name)...")
runtask(task!, 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