Commit 13c759c7 authored by Drew's avatar Drew

Merge pull request #94 from AnarchyTools/only-platforms

Add only-platforms
parents 36f4cbef 658955ba
Pipeline #1848 passed with stage
Subproject commit 4141cc44c894fc5b0cfe7f644b25d772e72ad129
Subproject commit 3e38cdc00304c0c927cf88d5e889c3cb49bd6f21
......@@ -38,6 +38,12 @@ final public class TaskRunner {
static private func runTaskWithoutDependencies(task: Task, package: Package, toolchain: String) {
if task.onlyPlatforms.count > 0 {
if !task.onlyPlatforms.contains(Platform.targetPlatform.description) {
print("Skipping task \(task) on platform \(Platform.targetPlatform)")
print("Running task \(task.qualifiedName) with overlays \(task.appliedOverlays) for platform \(Platform.targetPlatform)")
do {
try task.checkRequiredOverlays()
:name "only_platforms"
:tasks {
:if-linux {
:tool "shell"
:script "echo hello from linux"
:only-platforms ["linux"]
:if-osx {
:tool "shell"
:script "echo hello from osx"
:only-platforms ["osx"]
:default {
:tool "nop"
:dependencies ["if-linux" "if-osx"]
\ No newline at end of file
......@@ -16,6 +16,28 @@ if ! $ATBUILD atbuild --use-overlay static; then
$ATBUILD atbuild
echo "****************ONLY-PLATFORMS TEST**************"
cd $DIR/tests/fixtures/only_platforms
$ATBUILD > /tmp/only.txt
if [ "$UNAME" == "Darwin" ]; then
EXPECT="hello from osx"
DONTEXPECT="hello from linux"
EXPECT="hello from linux"
DONTEXPECT="hello from osx"
if ! grep "$EXPECT" /tmp/only.txt; then
echo "Didn't find $EXPECT in /tmp/only.txt"
exit 1
if grep "$DONTEXPECT" /tmp/only.txt; then
echo "Found $DONTEXPECT in /tmp/only.txt"
exit 1
echo "****************EXECUTABLE-NAME TEST**************"
cd $DIR/tests/fixtures/executable_name
$ATBUILD check
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