Skip to content

Commit

Permalink
Add a single flag to enable/disable all conditional dependencies.
Browse files Browse the repository at this point in the history
This prevent from having to modify too many files when adding a new one (i.e. travis.yml and the travis_script.sh). This will reduce the possibilities for errors.

PiperOrigin-RevId: 281088641
Change-Id: Ibb3e10b1a2818372f8acc7bf57f8290420345642
  • Loading branch information
DeepMind Technologies Ltd authored and jblespiau committed Nov 18, 2019
1 parent 8287b44 commit f5fdb1a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ matrix:
dist: bionic # Ubuntu 18.04.2 LTS released on 26 April 2018
env:
- OS_PYTHON_VERSION=3.6
- BUILD_WITH_HANABI="ON"
- DEFAULT_OPTIONAL_DEPENDENCY="ON"
# - os: osx
# # macOS 10.14 (Mojave), release on September 24, 2018.
# osx_image: xcode11
Expand Down
2 changes: 0 additions & 2 deletions docs/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ When you add a new conditional dependency, you need to touch:

- the root CMakeLists.txt to add the option, with an OFF default
- add the option to `scripts/global_variables.sh`
- set the option to "ON" in `.travis.yml` for the "All dependencies"
integration test.
- change `install.sh` to make sure the dependency is installed
- use constructs like `if (${BUILD_WITH_HANABI})` in CMake to optionally add
the targets to build.
8 changes: 6 additions & 2 deletions open_spiel/scripts/global_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@
# Note that we do not change the value of the constants if they are already
# defined by an enclosing scope (useful for command line overrides).

export BUILD_WITH_HANABI=${BUILD_WITH_HANABI:-"OFF"}
export BUILD_WITH_ACPC=${BUILD_WITH_ACPC:-"OFF"}
# We add a single flag, to enable/disable all conditional dependencies, in
# particular to be able to use that in the Travis CI test.
export DEFAULT_OPTIONAL_DEPENDENCY=${DEFAULT_OPTIONAL_DEPENDENCY:-"OFF"}

export BUILD_WITH_HANABI=${BUILD_WITH_HANABI:-$DEFAULT_OPTIONAL_DEPENDENCY}
export BUILD_WITH_ACPC=${BUILD_WITH_ACPC:-$DEFAULT_OPTIONAL_DEPENDENCY}
4 changes: 0 additions & 4 deletions open_spiel/scripts/travis_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,5 @@ source ./venv/bin/activate
python --version
pip3 install -r requirements.txt

# Within the tests, we build against all possible optional dependencies.
BUILD_WITH_HANABI="ON"
BUILD_WITH_ACPC="ON"

./open_spiel/scripts/build_and_run_tests.sh
deactivate

0 comments on commit f5fdb1a

Please sign in to comment.