This builds on the first part of the tutorial. In this post, we will make the the rule actually produce an executable. Capturing the output from scalac At the end of the tutorial last time, we were calling scalac, but ignoring the result: (cd /private/var/tmp/_bazel_kchodorow/92df5f72e3c78c053575a1a42537d8c3/blerg && exec env – /bin/bash -c ‘external/scala/bin/scalac HelloWorld.scala; echo ”’blah”’Continue reading “The Return of the Scala Rule Tutorial: The Execution”
Category Archives: Bazel
Tutorial: how to write Scala rules for Bazel
Bazel comes with built-in support for several languages and allows you to write your own support for any other languages in Python. Although you could probably get more abstract, let’s define a rule as something that takes some files, does something to them, and then gives you some output files. Specifically, for this example, weContinue reading “Tutorial: how to write Scala rules for Bazel”
Trimming the (build) tree with Bazel
Jonathan Lange wrote a great blog post about how Bazel caches tests. Basically: if you run a test, change your code, then run a test again, the test will only be rerun if you changed something that could actually change the outcome of the test. Bazel takes this concept pretty far to minimize the workContinue reading “Trimming the (build) tree with Bazel”
API changes with extra cheese, hold the fear
When you make a change, how do you know what tests to run? If you’re lucky, no one else depends on your code so you can just run your own tests and you’re done. However, if you’re writing useful code, other people are probably going to start depending on it. Once that happens, it becomesContinue reading “API changes with extra cheese, hold the fear”