bazelbuild / BUILD_file_generator

Generate BUILD files for your Java files
Apache License 2.0
39 stars 19 forks source link

If a test class depends on another test class, put both in the same BUILD rule #5

Open cgrushko opened 6 years ago

cgrushko commented 6 years ago

... otherwise Bazel will complain that a java_test depends on another java_test, which is illegal.

petroseskinder commented 6 years ago

I am also not seeing this as an issue.

cgrushko commented 6 years ago

What do you mean?

petroseskinder commented 6 years ago

I am currently not seeing anyjava_test BUILD rules that depend on other java_test BUILD rules. That means that this is currently not an issue. Instead, it is a "best practice."

cgrushko commented 6 years ago

This is from a test run on JavaRx, where two files ending with .*Test.java (and both importing org.junit.Test) have an edge between them, which causes BFG to

  1. Put each one separately in a java_test
  2. Make one depend on the other, leading to a build breakage (Bazel doesn't allow java_test to depend on another java_test)