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.
Merge pull request #77 from lucidsoftware/do-not-always-provide-trans…
…itive-analysis-files Don't always provide transitive dependencies' analysis files to ZincRunner
- Loading branch information
Showing
7 changed files
with
68 additions
and
2 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
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,20 @@ | ||
load("@rules_scala_annex//rules:scala.bzl", "scala_library") | ||
|
||
scala_library( | ||
name = "dependency", | ||
srcs = [ | ||
"Dependency.scala", | ||
"DependencyCacheInvalidation.scala", | ||
], | ||
scala_toolchain_name = "test_zinc_2_13", | ||
) | ||
|
||
scala_library( | ||
name = "dependent", | ||
srcs = [ | ||
"Dependent.scala", | ||
"DependentCacheInvalidation.scala", | ||
], | ||
scala_toolchain_name = "test_zinc_2_13", | ||
deps = [":dependency"], | ||
) |
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 @@ | ||
package anx.ijar | ||
|
||
object Dependency { | ||
def main(args: Array[String]): Unit = { | ||
println("Hello, world!") | ||
} | ||
} |
Empty file.
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,5 @@ | ||
package anx.ijar | ||
|
||
object Dependent { | ||
def main(args: Array[String]): Unit = Dependency.main(args) | ||
} |
Empty file.
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,32 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../common.sh | ||
|
||
invalidate_dependency_cache() { | ||
echo "// $(cat /proc/sys/kernel/random/uuid)" > DependencyCacheInvalidation.scala | ||
} | ||
|
||
invalidate_dependent_cache() { | ||
echo "// $(cat /proc/sys/kernel/random/uuid)" > DependentCacheInvalidation.scala | ||
} | ||
|
||
test_actions_executed() { | ||
scalacompile_runs="$( | ||
bazel build --color no --subcommands "$1" |& \ | ||
grep '^SUBCOMMAND: # //ijar:.* \[.*, mnemonic: ScalaCompile\]$' | \ | ||
wc -l | ||
)" | ||
|
||
if [ "$scalacompile_runs" -ne "$2" ]; then | ||
echo "Expected 1 \`ScalaCompile\` action to be executed, but got $scalacompile_runs" | ||
exit 1 | ||
fi | ||
} | ||
|
||
trap ": > DependencyCacheInvalidation.scala; : > DependentCacheInvalidation.scala" EXIT | ||
|
||
invalidate_dependency_cache | ||
invalidate_dependent_cache | ||
test_actions_executed //ijar:dependent 2 | ||
|
||
invalidate_dependency_cache | ||
test_actions_executed //ijar:dependent 1 |