-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a new matrix cell for [Bazel](https://bazel.build) * In the bazel job: - install deps with apt - download bazel.deb from official repo - install with `sudo apt-get install`. **N.B.** This job needs **sudo: true** * Add a simple `bazel.sh` that only does (and it's not going to change much in the future) ``` cd jflex/examples bazel build //... bazel test //... ``` * Add an (virtually) empty root `jflex/examples/BUILD` - This root BUILD defines one sh_test, so that `bazel test //...` doesn't complain with > No test targets were found, yet testing was requested * This is the first step for #204 (Bazel support) * **N.B.** Do not use a cache for bazel. - I tried caching the bazel output directory (this is in theory perfectly fine) by setting a non-default `--output_user_root=$TRAVIS_BUILD_DIR/__bazel__` - But the VM hangs at startup with > creating directory /home/travis/build/jflex-de/jflex/__bazel__
- Loading branch information
Showing
8 changed files
with
91 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This is from Bazel's former travis setup, to avoid blowing up the RAM usage. | ||
startup --host_jvm_args=-Xms2000m | ||
startup --host_jvm_args=-Xmx3000m | ||
test --ram_utilization_factor=10 | ||
|
||
# This is so we understand failures better | ||
build --verbose_failures | ||
test --test_output=errors | ||
|
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 was deleted.
Oops, something went wrong.
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,3 +1,3 @@ | ||
build | ||
antbuild | ||
target | ||
out |
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,24 @@ | ||
# Root bazel package | ||
|
||
# This pacakge exists because | ||
# `bazel build //...` needs at least one package | ||
|
||
# But bazel test //... fails with | ||
# No test targets were found, yet testing was requested | ||
# So here is a test: | ||
|
||
sh_test( | ||
name = "hello_test", | ||
size = "small", | ||
srcs = [":hello_test_lib"], | ||
) | ||
sh_library( | ||
name = "hello_test_lib", | ||
srcs = [":gen_hello_test_sh"], | ||
) | ||
genrule( | ||
name = "gen_hello_test_sh", | ||
srcs = [], | ||
outs = ["hello_test.sh"], | ||
cmd = "echo 'echo \"Hello World\"' > $@", | ||
) |
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 @@ | ||
|
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,30 @@ | ||
#!/bin/bash | ||
# Run bazel on examples | ||
|
||
CWD="$PWD" | ||
BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"/.. | ||
# Provides the logi function | ||
source "$BASEDIR"/scripts/logger.sh | ||
# fail on error | ||
set -e | ||
|
||
if [[ $TRAVIS ]]; then | ||
BAZEL="bazel --bazelrc=$TRAVIS_BUILD_DIR/.travis.bazelrc" | ||
else | ||
BAZEL='bazel' | ||
fi | ||
|
||
logi "Start Bazel" | ||
logi "===========" | ||
cd jflex/examples | ||
$BAZEL info | ||
|
||
logi "Build everything" | ||
logi "================" | ||
$BAZEL build //... | ||
|
||
logi "Test everything" | ||
logi "===============" | ||
$BAZEL test //... | ||
|
||
cd "$CWD" |
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