This package contains the rules jps_library
and jps_test
that provide a sandboxed skeleton to run tools/idea
(actually any arbitrary) builds via bazel. Here bazel is only used a a dispatcher of actions that have a well known set of inputs, and produce an output.
For jps_build
the input is the generally the source in tools/idea
and the output is the compilation of a module and its transitive dependencies (equivalent to a _deploy.jar
).
For jps_test
the inputs are the source and the jps_build
output, and it runs a test using the bazel runner, to obtain reporting, sharding and sandboxing.
Both the build and the test execution require network access if run for the first time. These rules provide the ability to bazel run
both the build and the test to capture the downloads. This downloads are stored in the repository as cache directories, that can be later used as inputs of the rules to avoid the network access and enable sandboxed execution.
jps_library( name, module, deps, download_cache, cmd, )
jps_library
generates a .zip
file containing the output of the compilation of a given module and its transitive dependencies. The generated file can be obtained by running bazel build ${name}
, and will be called {$name}.zip
.
jps_library
will generate a rule that can be executed with bazel run
. This rule is called ${name}_update_cache
. Executing bazel run ${name}_update_cache
will run the build without a sandbox and copy all donwloaded data to the download_cache
location.
jps_test( name, module, deps, download_cache, test_suite, )
jps_test
runs the given test_suite
on a test with the class path of the given module
. This would usually depend on the jps_library
that builds the module in question.
jps_test
can be executed with bazel run
. In this mode it will run the build without a sandbox and copy all donwloaded data to the download_cache
location.
jps_cache( name, srcs, strip_prefix, )
jps_cache
represents a group of files that can be used to set up a jps_library
or jps_test
workspace.