forked from higherkindness/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test that ScalaCheckDeps outputs aren't inputs to other actions
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
load("@rules_scala_annex//rules:scala.bzl", "scala_library") | ||
|
||
scala_library( | ||
name = "validation_action", | ||
scala = "//scala:2_13", | ||
tags = ["manual"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../../common.sh | ||
|
||
scalacheckdeps_outputs="$( | ||
bazel aquery 'mnemonic("^ScalaCheckDeps$", //dependencies/validation_action)' | | ||
grep -oP '(?<=^ Outputs: \[).*(?=\]$)' | | ||
sed 's/, /\n/g' | | ||
sort -u | ||
)" | ||
|
||
action_inputs="$( | ||
bazel aquery '//dependencies/validation_action' | | ||
grep -oP '(?<=^ Inputs: \[).*(?=\]$)' | | ||
sed 's/, /\n/g' | | ||
sort -u | ||
)" | ||
|
||
common_files="$(comm -12 <(echo "$scalacheckdeps_outputs") <(echo "$action_inputs"))" | ||
|
||
if [ -n "$common_files" ]; then | ||
echo "Found some ScalaCheckDeps outputs that are the inputs to other actons:" | ||
echo "$common_files" | ||
exit 1 | ||
fi |