summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: da14b1e9aa79d132ecb2292b731e463cdb03a38d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Rene Rivera 2015.

branches:
  only:
    - master
    - develop

sudo: required

language: c

compiler:
  - gcc

git:
  # We avoid fetching submodules so that we can set the EOL
  # style to fetch them as needed.
  submodules: false

addons:
  apt:
    packages:
      - p7zip-full
      - docutils-common
      - docutils-doc
      - docbook
      - docbook-xml
      - docbook-xsl
      - xsltproc
      - doxygen
      - dvipsk-ja
      - texlive

env:
  global:
    - secure: "DC12OV65iyBzELywj19yI4S8DmmBmZO8hbT3Iq0kJ4yo0aMQzzJDsVpmm2Jwk/Qf/yLyBsAhkpanScJJ9eEekmK8OZN8H9EJ1kgai58IWk0gWKKzJ0lyQH/vsYEyfxCSwqejoIdd07nQh5B/1L5Th3I2vLT2udHUPU2Np/MKgUw="
  matrix:
    - TRAVIS_EMPTY_JOB_WORKAROUND=true

matrix:
  exclude:
    - env: TRAVIS_EMPTY_JOB_WORKAROUND=true
  include:
    # Simple integrated status tests check.
    - env: STATUS_TESTS=true
    
    # Build release package for LF end-of-line style text files.
    - env: RELEASE_BUILD=LF
    
    # Build release package for CRLF end-of-line style text files (i.e. for Windows).
    - env: RELEASE_BUILD=CRLF

install:
  # Set where we will place all our build byproducts.
  - |
    export "BOOST_BUILD_DIR=${TRAVIS_BUILD_DIR}/../build"
  
  # We use RapidXML for some doc building tools.
  - |
    cd "${TRAVIS_BUILD_DIR}/.."
    wget -O rapidxml.zip http://sourceforge.net/projects/rapidxml/files/latest/download
    unzip -n -d rapidxml rapidxml.zip
    export RAPIDXML=`ls -1d ${PWD}/rapidxml/rapidxml-*`
  # Need docutils for building some docs.
  - |
    sudo pip install docutils

before_script:
  # Fail the whole script whenever any command fails
  - |
    set -e
  
  # Fetch the rest of the Boost submodules in the appropriate
  # EOL style.
  - |
    if [[ "${STATUS_TESTS}" == "true" ]]; then
      cd "${TRAVIS_BUILD_DIR}"
      git submodule update --init --recursive
    fi
  - |
    if [[ "${RELEASE_BUILD}" == "LF" ]]; then
      cd "${TRAVIS_BUILD_DIR}"
      git config core.eol lf
      git config core.autocrlf false
      git rm --cache -r .
      git reset --quiet --hard HEAD
      git submodule update --init --recursive
    fi
  - |
    if [[ "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}"
      git config core.eol crlf
      git config core.autocrlf false
      git rm --cache -r .
      git reset --quiet --hard HEAD
      git submodule update --init --recursive
    fi

script:
  # Simple integrated status tests check. Currently this only
  # veryfies that we will not get build system errors from things
  # like missing test files.
  - |
    if [[ "${STATUS_TESTS}" == "true" ]]; then
      cd "${TRAVIS_BUILD_DIR}"
      ./bootstrap.sh
      ./b2 -n
      cd status
      ../b2 -n -d0
    fi
  
  # Build a packaged release. This involves building a fresh set
  # of docs and selectively packging parts of the tree. We try and
  # avoid creating extra files in the base tree to avoid including
  # extra stuff in the archives. Which means that we reset the git
  # tree state to cleanup after building.
  
  # Set up where we will "install" built tools.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      mkdir -p "${BOOST_BUILD_DIR}/dist/bin"
      export "PATH=${BOOST_BUILD_DIR}/dist/bin:${PATH}"
    fi
  
  # Bootstrap Boost Build engine.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/tools/build"
      ./bootstrap.sh
      cp -p b2 "${BOOST_BUILD_DIR}/dist/bin/b2"
      git clean -dfqx
    fi
  
  # Generate include dir structure.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}"
      b2 -q -d0 headers
    fi
  
  # Build doxygen_xml2qbk for building Boost Geometry docs.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk"
      b2 -q -d0 --build-dir="${BOOST_BUILD_DIR}" --distdir="${BOOST_BUILD_DIR}/dist"
      cd "${TRAVIS_BUILD_DIR}/libs/geometry"
      git clean -dfqx
    fi
  
  # Build Quickbook documentation tool.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/tools/quickbook"
      b2 -q -d0 --build-dir="${BOOST_BUILD_DIR}" --distdir="${BOOST_BUILD_DIR}/dist"
      git clean -dfqx
    fi
  
  # Build auto-index documentation tool.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/tools/auto_index/build"
      b2 -q -d0 --build-dir="${BOOST_BUILD_DIR}" --distdir="${BOOST_BUILD_DIR}/dist"
      cd "${TRAVIS_BUILD_DIR}/tools/auto_index"
      git clean -dfqx
    fi
  
  # Set up build config.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      echo "using quickbook : \"${BOOST_BUILD_DIR}/dist/bin/quickbook\" ;" >> "${HOME}/user-config.jam"
      echo "using auto-index : \"${BOOST_BUILD_DIR}/dist/bin/auto_index\" ;" >> "${HOME}/user-config.jam"
      echo "using docutils ;" >> "${HOME}/user-config.jam"
      echo "using doxygen ;" >> "${HOME}/user-config.jam"
    fi
  
  # Pre-build Boost Geometry docs.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/libs/geometry/doc"
      python make_qbk.py --release-build
    fi
  
  # Build the full docs, and all the submodule docs.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/doc"
      (while true ; do sleep 60 && echo "[[ ALIVE? ]]" ; done ;) &
      AWAKE_PID=$!
      b2 -q -d0 --build-dir="${BOOST_BUILD_DIR}" --distdir="${BOOST_BUILD_DIR}/dist" --release-build --enable-index
      kill $AWAKE_PID
    fi
  
  # Make the real distribution tree from the base tree. The
  # distribution tree is "marked" with the commit hash to be
  # able to track a package to the commit we test.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" || "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/.."
      wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/MakeBoostDistro.py"
      chmod +x MakeBoostDistro.py
      export BOOST_RELEASE=boost_${TRAVIS_BRANCH}_${TRAVIS_COMMIT}
      ./MakeBoostDistro.py "${TRAVIS_BUILD_DIR}" "${BOOST_RELEASE}"
    fi
  
  # Create packages for LF style content.
  - |
    if [[ "${RELEASE_BUILD}" == "LF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/.."
      tar -zcf "${BOOST_RELEASE}.tar.gz" "${BOOST_RELEASE}"
      tar -cjf "${BOOST_RELEASE}.tar.bz2" "${BOOST_RELEASE}"
      ls -la
    fi
  
  # Create packages for CRLF style content.
  - |
    if [[ "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/.."
      zip -qr "${BOOST_RELEASE}.zip" "${BOOST_RELEASE}"
      7z a -r "${BOOST_RELEASE}.7z" "${BOOST_RELEASE}" > /dev/null
      ls -la
    fi

after_success:
  # Publish created packages depending on the EOL style and branch.
  # We post archives to distribution services. But currently we only
  # post master packages as they happen less often. And we are
  # unlikely to ever want anything else as a package for the
  # releases.
  - |
    if [[ "${TRAVIS_BRANCH}" == "master" && "${RELEASE_BUILD}" == "LF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/.."
      curl -T "${BOOST_RELEASE}.tar.gz" "-ugrafikrobot:${BINTRAY}" "https://api.bintray.com/content/boostorg/snapshots/${TRAVIS_BRANCH}/${TRAVIS_COMMIT}/${BOOST_RELEASE}.tar.gz?publish=1"
      curl -T "${BOOST_RELEASE}.tar.bz2" "-ugrafikrobot:${BINTRAY}" "https://api.bintray.com/content/boostorg/snapshots/${TRAVIS_BRANCH}/${TRAVIS_COMMIT}/${BOOST_RELEASE}.tar.bz2?publish=1"
    fi
  - |
    if [[ "${TRAVIS_BRANCH}" == "master" && "${RELEASE_BUILD}" == "CRLF" ]]; then
      cd "${TRAVIS_BUILD_DIR}/.."
      curl -T "${BOOST_RELEASE}.zip" "-ugrafikrobot:${BINTRAY}" "https://api.bintray.com/content/boostorg/snapshots/${TRAVIS_BRANCH}/${TRAVIS_COMMIT}/${BOOST_RELEASE}.zip?publish=1"
      curl -T "${BOOST_RELEASE}.7z" "-ugrafikrobot:${BINTRAY}" "https://api.bintray.com/content/boostorg/snapshots/${TRAVIS_BRANCH}/${TRAVIS_COMMIT}/${BOOST_RELEASE}.7z?publish=1"
    fi