Skip to content

Commit 9a60c15

Browse files
committed
Add --filter-by-tag argument
For use with project actions `tag` parameters.
1 parent 8d5519c commit 9a60c15

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

run

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def parse_args():
6262
parser.add_argument("--debug",
6363
help='Build Swift in debug mode',
6464
action='store_true')
65+
parser.add_argument("--filter-by-tag",
66+
metavar='TAG',
67+
help='Only run project actions with the given tag')
6568
parser.add_argument("--test",
6669
help='Only run test actions',
6770
action='store_true')
@@ -162,6 +165,8 @@ def execute_runner(workspace, args):
162165
swiftc_path = get_swiftc_path(workspace, args.swiftc)
163166
if args.test:
164167
action_filter = 'action.startswith("TestSwiftPackage")'
168+
elif args.filter_by_tag:
169+
action_filter = '"tags" in locals() and "{}" in tags.split()'.format(args.filter_by_tag)
165170
else:
166171
action_filter = 'action.startswith("Build")'
167172
runner_command = [

0 commit comments

Comments
 (0)