2016-08-10 17:33:43 +00:00
|
|
|
#!/bin/bash
|
2016-06-29 03:35:16 +00:00
|
|
|
|
|
|
|
case "$1" in
|
2017-03-23 12:35:53 +00:00
|
|
|
"before_install")
|
|
|
|
;;
|
2016-06-29 03:35:16 +00:00
|
|
|
"install")
|
|
|
|
case "${TRAVIS_OS_NAME}" in
|
|
|
|
"osx")
|
2020-03-31 12:38:01 +00:00
|
|
|
brew update >/dev/null
|
2016-06-29 03:35:16 +00:00
|
|
|
brew install binutils
|
|
|
|
|
|
|
|
case "${CC}" in
|
|
|
|
"gcc-"*)
|
2018-04-13 09:44:34 +00:00
|
|
|
which ${CC} || brew install $(echo "${CC}" | sed 's/\-/@/') || brew link --overwrite $(echo "${CC}" | sed 's/\-/@/')
|
2016-06-29 03:35:16 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "${BUILD_SYSTEM}" in
|
2017-03-23 12:35:53 +00:00
|
|
|
"bazel")
|
2020-03-31 12:38:01 +00:00
|
|
|
brew cask install homebrew/cask-versions/adoptopenjdk8
|
2017-03-23 12:35:53 +00:00
|
|
|
brew install bazel
|
|
|
|
;;
|
2016-06-29 03:35:16 +00:00
|
|
|
esac
|
|
|
|
;;
|
2017-02-19 09:06:13 +00:00
|
|
|
"linux")
|
|
|
|
case "${CC}" in
|
|
|
|
"pgcc")
|
2017-03-23 15:23:57 +00:00
|
|
|
wget 'https://raw.githubusercontent.com/nemequ/pgi-travis/de6212d94fd0e7d07a6ef730c23548c337c436a7/install-pgi.sh'
|
|
|
|
echo 'acd3ef995ad93cfb87d26f65147395dcbedd4c3c844ee6ec39616f1a347c8df5 install-pgi.sh' | sha256sum -c --strict || exit 1
|
|
|
|
/bin/sh install-pgi.sh
|
2017-02-19 09:06:13 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
2016-06-29 03:35:16 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
"script")
|
|
|
|
case "${BUILD_SYSTEM}" in
|
|
|
|
"cmake")
|
|
|
|
mkdir builddir && cd builddir
|
2016-07-28 20:31:09 +00:00
|
|
|
CMAKE_FLAGS=
|
|
|
|
if [ "${CROSS_COMPILE}" = "yes" ]; then
|
|
|
|
CMAKE_FLAGS="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${RC_COMPILER}"
|
|
|
|
fi
|
2018-09-27 09:00:33 +00:00
|
|
|
cmake ${CMAKE_FLAGS} -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DENABLE_SANITIZER="${SANITIZER}" -DCMAKE_C_FLAGS="${CFLAGS}" .. || exit 1
|
|
|
|
make VERBOSE=1 || exit 1
|
|
|
|
ctest -V || exit 1
|
2016-06-29 03:35:16 +00:00
|
|
|
;;
|
|
|
|
"python")
|
disable buidling/deployment of python wheels (#583)
* [appveyor] remove 'deploy' stage; only test python 2.7 and 3.6
all the other python versions are being built and tested on
https://github.com/google/brotli-wheels/blob/d571d63/appveyor.yml
* remove terrify submodule as not needed any more
* [travis] just test py2.7 and 3.6 on linux; remove extra osx python builds
All the other python versions for OSX are being built/tested on:
https://github.com/google/brotli-wheels/blob/d571d63/.travis.yml
Also, there's no need to build and deploy wheels here, as that's done
in the separate repository.
* [setup.py] only rebuild if dependency are newer; fix typo in list of 'depends'
https://github.com/python/cpython/blob/v3.6.2/Lib/distutils/command/build_ext.py#L485-L500
* [ci] only run 'python setup.py test'
if we run 'python setup.py built test', the setuptools 'test' command will
forcibly re-run the build_ext subcommand because it wants to pass the --inplace
option (it ignores whether it's up to date, just re-runs it all the time).
with this we go from running built_ext twice, to running it only once per build
* [Makefile] run 'build_ext --inplace' instead of 'develop' as default target
The 'develop' command is like 'install' in the sense that it
modifies the user's python environment.
The default make target should be less intrusive, i.e. just building
the extension module in-place without modify anything in the user's
environment.
We don't need to tell make about the dependency between 'test' and
'build' target as that is baked in the `python setup.py test` command.
* [Makefile] add 'develop' target; remove unnecessary 'tests' target
`make test` is good enough
* [Makefile] `setup.py test` requires setuptools; run `python -m unittest`
This will work even if setuptools is not installed, which is unlikely
nowadays but still our `setup.py` works with plain distutils, so
we may well have our tests work without setuptools.
* [python/README.md] add ref to 'develop' target; remove 'tests', just 'make test'
* [setup.py] import modules as per nicksay's comment
https://github.com/google/brotli/pull/583#discussion_r131981049
* [Makefile] add 'develop' to .PHONY targets
remove 'tests' from .PHONY
* [appveyor] remove unused setup scripts
We don't need to install custom python versions, we are
using the pre-installed ones on Appveyor.
* [appveyor] remove unneeded setup code
2017-08-23 18:45:13 +00:00
|
|
|
python setup.py test
|
2016-06-29 03:35:16 +00:00
|
|
|
;;
|
2017-03-22 18:13:59 +00:00
|
|
|
"maven")
|
|
|
|
cd java/org/brotli
|
|
|
|
mvn install && cd integration && mvn verify
|
|
|
|
;;
|
2017-11-30 19:54:04 +00:00
|
|
|
"autotools")
|
|
|
|
./bootstrap && ./configure && make
|
|
|
|
;;
|
2017-09-26 11:49:30 +00:00
|
|
|
"fuzz")
|
|
|
|
./c/fuzz/test_fuzzer.sh
|
|
|
|
;;
|
2017-03-23 12:35:53 +00:00
|
|
|
"bazel")
|
2018-06-04 15:53:16 +00:00
|
|
|
bazel build -c opt ...:all &&
|
|
|
|
cd go && bazel test -c opt ...:all && cd .. &&
|
|
|
|
cd java && bazel test -c opt ...:all && cd .. &&
|
2021-06-23 07:40:57 +00:00
|
|
|
cd js && bazel test -c opt ...:all && cd .. &&
|
2018-06-04 15:53:16 +00:00
|
|
|
cd research && bazel build -c opt ...:all && cd ..
|
2017-03-23 12:35:53 +00:00
|
|
|
;;
|
2016-06-29 03:35:16 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
"after_success")
|
|
|
|
;;
|
2017-03-24 11:54:20 +00:00
|
|
|
"before_deploy")
|
|
|
|
case "${BUILD_SYSTEM}" in
|
|
|
|
"bazel")
|
|
|
|
export RELEASE_DATE=`date +%Y-%m-%d`
|
2017-04-23 12:07:08 +00:00
|
|
|
perl -p -i -e 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : $&/eg' scripts/.bintray.json
|
2017-05-29 15:55:14 +00:00
|
|
|
zip -j9 brotli.zip bazel-bin/libbrotli*.a bazel-bin/libbrotli*.so bazel-bin/brotli
|
2017-03-24 11:54:20 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
2016-06-29 03:35:16 +00:00
|
|
|
esac
|