diff --git a/.travis.yml b/.travis.yml index ca68392..cbcb084 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,30 @@ language: java dist: trusty sudo: false +env: + global: + - secure: VRPA9iYt/qXZU2VGlP0AKN0IcfOWtM8N2z4/mBbCaM6GAff6SYTRlfvjtUStvNgfJAig5T81fnYAyObT/3HyaDEYjyxWnaAqWaNJ4vHG/S2T9ajlVPg3udviQPXHQZOQ0co2+NUzwpJhuv5LLQYuMvwNszIiXWHSbOlDA1wLTsfJzvS7sSeLzDbi5fBffjwg6n1RQUsXEHbRokrHNFRX2ovxeXlONRTTMVaRq/rnJx8HFkHaj/6fdC2wOXE342RC+N/LbdzLVRzNzFNC1gSgRXU2NBhaKLXV4/xRucLJ+mHm/xeFZTmoeFAyHpUQEPPxEu/ogV/7aSxvqYX+N+6g0SkZn+JzKDSf/L7qnv8BKmlc04Mo6OncLVTtJgZYgUZtbVloRhnl5Xo0SdzonzYNQGZHvcCg5y0tljYe3Z5JXmE/dSwYl+LeoY7B2ImMFI0MPvjr83EnbSRRLoDZBiY0jFtrwB8hsIQ/QSVHLABCmlOWiQnOhIcZ1BqhBNUFKbXgDEBZnNSB78wW4ZjlPXFzWYYuVfJOnel+UugoJ49KmrT7W3BQOh+sUICJd8tDYakQR2ysYS9OY9985yRnYinJddFma4e6yKbcD5j6MU71/FwXvcu5ncjpxpAUOSlnDryTm3mp42lTikM1ojD/MNyi4de8Sr9zgDMTe+0LjsayYxU= + +addons: + apt: + update: true + matrix: include: - name: "Java 8 Tests" jdk: oraclejdk8 - name: "Coverage" jdk: oraclejdk8 - env: TESTENV=cover + env: TESTENV=cover FYI="this also builds documentation for tags" script: mvn clean cobertura:cobertura + addons: + apt: + packages: + - python3 + - python3-pip + - python-virtualenv + - make after_success: - - '[ "$TESTENV" == "cover" ] && bash <(curl -s https://codecov.io/bash)' + - '[[ "$TESTENV" == "cover" ]] && bash <(curl -s https://codecov.io/bash)' + - '[[ "$TESTENV" == "cover" ]] && [[ -n "$TRAVIS_TAG" ]] && ./deploy-docs.sh' diff --git a/README.md b/README.md index 53c0262..9fa7f99 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ This is the Engine.IO Server Library for Java ported from the [JavaScript server See also: [Engine.IO-client Java](https://github.com/socketio/engine.io-client-java) +## Documentation +Complete documentation can be found [here](https://socketio.github.io/engine.io-server-java/). + ## Installation This section will be updated when artifact is available on Maven Central. diff --git a/deploy-docs.sh b/deploy-docs.sh new file mode 100755 index 0000000..a7b5450 --- /dev/null +++ b/deploy-docs.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# This script builds the documentation and pushes it to github + +AUTHOR="Documentation Builder" +GH_REPO_REF="github.com/$TRAVIS_REPO_SLUG" + +set -e + +cd docs + +# Activate virtualenv +virtualenv -p python3 venv +. venv/bin/activate + +# Install dependencies +pip install -r requirements.txt + +# Build docs +make html + +cd _build + +# Configure git +git config --global push.default simple +git config user.name "Travis CI" +git config user.email "travis@travis-ci.org" + +# Clone docs branch +git clone -b gh-pages https://git@$GH_REPO_REF docs-upload +cd docs-upload + +# Remove existing docs +rm -rf * + +# Copy docs from build to repo +cp -r ../html/* ./ +echo "" > .nojekyll + +if [[ -f "index.html" ]]; then + # Commit + git add --all + git commit -m "Deploy code docs to GitHub Pages Travis build" + + git push --force "https://${GH_REPO_TOKEN}@${GH_REPO_REF}" > /dev/null 2>&1 +else + echo 'ERROR: index.html not found' + exit 1 +fi diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..a485625 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +/_build diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..08c1128 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = EngineIO +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/_static/.keep b/docs/_static/.keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/_themes/sphinx_rtd_theme/__init__.py b/docs/_themes/sphinx_rtd_theme/__init__.py new file mode 100644 index 0000000..67387b7 --- /dev/null +++ b/docs/_themes/sphinx_rtd_theme/__init__.py @@ -0,0 +1,19 @@ +"""Sphinx ReadTheDocs theme. + +From https://github.com/ryan-roemer/sphinx-bootstrap-theme. + +""" +from os import path + +__version__ = '0.4.1' +__version_full__ = __version__ + + +def get_html_theme_path(): + """Return list of HTML theme paths.""" + cur_dir = path.abspath(path.dirname(path.dirname(__file__))) + return cur_dir + +# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package +def setup(app): + app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__))) diff --git a/docs/_themes/sphinx_rtd_theme/breadcrumbs.html b/docs/_themes/sphinx_rtd_theme/breadcrumbs.html new file mode 100644 index 0000000..31550d8 --- /dev/null +++ b/docs/_themes/sphinx_rtd_theme/breadcrumbs.html @@ -0,0 +1,82 @@ +{# Support for Sphinx 1.3+ page_source_suffix, but don't break old builds. #} + +{% if page_source_suffix %} +{% set suffix = page_source_suffix %} +{% else %} +{% set suffix = source_suffix %} +{% endif %} + +{% if meta is defined and meta is not none %} +{% set check_meta = True %} +{% else %} +{% set check_meta = False %} +{% endif %} + +{% if check_meta and 'github_url' in meta %} +{% set display_github = True %} +{% endif %} + +{% if check_meta and 'bitbucket_url' in meta %} +{% set display_bitbucket = True %} +{% endif %} + +{% if check_meta and 'gitlab_url' in meta %} +{% set display_gitlab = True %} +{% endif %} + +
diff --git a/docs/_themes/sphinx_rtd_theme/footer.html b/docs/_themes/sphinx_rtd_theme/footer.html new file mode 100644 index 0000000..448d145 --- /dev/null +++ b/docs/_themes/sphinx_rtd_theme/footer.html @@ -0,0 +1,52 @@ + + diff --git a/docs/_themes/sphinx_rtd_theme/layout.html b/docs/_themes/sphinx_rtd_theme/layout.html new file mode 100644 index 0000000..82950a2 --- /dev/null +++ b/docs/_themes/sphinx_rtd_theme/layout.html @@ -0,0 +1,219 @@ +{# TEMPLATE VAR SETTINGS #} +{%- set url_root = pathto('', 1) %} +{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} +{%- if not embedded and docstitle %} + {%- set titlesuffix = " — "|safe + docstitle|e %} +{%- else %} + {%- set titlesuffix = "" %} +{%- endif %} +{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %} + + + + + + + {{ metatags }} + + {% block htmltitle %} +{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}
+ {% endif %} + {% endif %} +{{ context|e }}
+