Skip to content

Commit 3704408

Browse files
jadenPete-lucidjjudd
authored andcommitted
Test that ScalaCheckDeps outputs aren't inputs to other actions
1 parent ce737b0 commit 3704408

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
load("@rules_scala_annex//rules:scala.bzl", "scala_library")
2+
3+
scala_library(
4+
name = "validation_action",
5+
scala = "//scala:2_13",
6+
tags = ["manual"],
7+
)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash -e
2+
. "$(dirname "$0")"/../../common.sh
3+
4+
scalacheckdeps_outputs="$(
5+
bazel aquery 'mnemonic("^ScalaCheckDeps$", //dependencies/validation_action)' |
6+
grep -oP '(?<=^ Outputs: \[).*(?=\]$)' |
7+
sed 's/, /\n/g' |
8+
sort -u
9+
)"
10+
11+
action_inputs="$(
12+
bazel aquery '//dependencies/validation_action' |
13+
grep -oP '(?<=^ Inputs: \[).*(?=\]$)' |
14+
sed 's/, /\n/g' |
15+
sort -u
16+
)"
17+
18+
common_files="$(comm -12 <(echo "$scalacheckdeps_outputs") <(echo "$action_inputs"))"
19+
20+
if [ -n "$common_files" ]; then
21+
echo "Found some ScalaCheckDeps outputs that are the inputs to other actons:"
22+
echo "$common_files"
23+
exit 1
24+
fi

0 commit comments

Comments
 (0)