forked from higherkindness/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try using command log instead of piping
- Loading branch information
Showing
2 changed files
with
10 additions
and
7 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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../../common.sh | ||
|
||
command_log="$(bazel info command_log)" | ||
|
||
# used_deps off | ||
! bazel build :used_deps_off_c || false | ||
bazel build :used_deps_off_c 2>&1| grep "buildozer 'add deps @\?//dependencies/indirect:used_deps_off_a' //dependencies/indirect:used_deps_off_c" | ||
! bazel build :used_deps_off_c && grep "buildozer 'add deps @\?//dependencies/indirect:used_deps_off_a' //dependencies/indirect:used_deps_off_c" "${command_log}" | ||
|
||
# direct_deps off | ||
! bazel build :direct_deps_off_c || false | ||
bazel build :direct_deps_off_c 2>&1| grep "buildozer 'remove deps //dependencies/indirect:direct_deps_off_a' //dependencies/indirect:direct_deps_off_b" | ||
! bazel build :direct_deps_off_c && grep "buildozer 'remove deps //dependencies/indirect:direct_deps_off_a' //dependencies/indirect:direct_deps_off_b" "${command_log}" | ||
|
||
# toggle used_deps and direct_deps via --define | ||
! bazel build --define=scala_deps_used=off :define_c || false | ||
bazel build --define=scala_deps_used=off :define_c 2>&1| grep "buildozer 'add deps @\?//dependencies/indirect:define_a' //dependencies/indirect:define_c" | ||
! bazel build --define=scala_deps_used=off :define_c && grep "buildozer 'add deps @\?//dependencies/indirect:define_a' //dependencies/indirect:define_c" "${command_log}" | ||
|
||
! bazel build --define=scala_deps_direct=off :define_c || false | ||
bazel build --define=scala_deps_direct=off :define_c 2>&1| grep "buildozer 'remove deps //dependencies/indirect:define_a' //dependencies/indirect:define_b" | ||
! bazel build --define=scala_deps_direct=off :define_c && grep "buildozer 'remove deps //dependencies/indirect:define_a' //dependencies/indirect:define_b" "${command_log}" | ||
|
||
bazel build --define=scala_deps_used=off --define=scala_deps_direct=off :define_c |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../../common.sh | ||
|
||
command_log="$(bazel info command_log)" | ||
|
||
bazel build :0_used | ||
! bazel build :0_unused || false | ||
bazel build :0_unused 2>&1| grep "buildozer 'remove deps @annex_test//:org_scalacheck_scalacheck_2_13' //dependencies/unused:0_unused" | ||
bazel build :0_unused && grep "buildozer 'remove deps @annex_test//:org_scalacheck_scalacheck_2_13' //dependencies/unused:0_unused" "${command_log}" | ||
bazel build :0_unused_whitelist | ||
bazel build :indirect_unused | ||
! bazel build :indirect_unused_missing || false | ||
bazel build :indirect_unused_missing 2>&1| grep "buildozer 'add deps @annex_test//:org_specs2_specs2_matcher_2_13' //dependencies/unused:indirect_unused_missing" | ||
bazel build :indirect_unused_missing && grep "buildozer 'add deps @annex_test//:org_specs2_specs2_matcher_2_13' //dependencies/unused:indirect_unused_missing" "${command_log}" | ||
bazel build :indirect_unused_whitelist |