Skip to content

Commit

Permalink
Use submodule for generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dlech committed Aug 31, 2017
1 parent ce0b77b commit b2e2342
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 43 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
@@ -1,3 +1,7 @@
[submodule "cmake"]
path = cmake
url = git://github.com/dlech/vala-cmake-modules
[submodule "doc/sphinx/_html_extra"]
path = doc/sphinx/_html_extra
url = https://github.com/ev3dev/ev3devKit.git
branch = html-extra
1 change: 1 addition & 0 deletions doc/sphinx/_html_extra
Submodule _html_extra added at 272fb2
16 changes: 2 additions & 14 deletions doc/sphinx/conf.py
Expand Up @@ -29,20 +29,6 @@

on_rtd = os.getenv('READTHEDOCS') == 'True'

if on_rtd:
# Download and extract non-sphinx docs
rtd_version = os.getenv('READTHEDOCS_VERSION')
if os.path.exists('_extra'):
shutil.rmtree('_extra')
os.mkdir('_extra')
r = requests.get('https://github.com/ev3dev/ev3devKit/archive/vala-api-docs/' + rtd_version + '.tar.gz')
r.raise_for_status()
t = tarfile.open(fileobj=StringIO.StringIO(r.content))
t.extractall('_extra')
os.rename('_extra/ev3devKit-vala-api-docs-' + rtd_version, '_extra/vala-api')

html_extra_path = ['_extra']


# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -123,6 +109,8 @@
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']

html_extra_path = ['_html_extra']


# -- Options for HTMLHelp output ------------------------------------------

Expand Down
39 changes: 12 additions & 27 deletions release-doc.sh
Expand Up @@ -4,33 +4,18 @@

set -e

GIT_REMOTE_URL=git@github.com:ev3dev/ev3devKit
DOC_DIR=valadoc
LANG=vala
base_dir=$(dirname $(readlink -f $0))
build_dir=${base_dir}/doc-build
html_extra_dir=${base_dir}/doc/sphinx/_html_extra

RTD_VERSION=$1
RTD_VERSION2=$2
rm -rf ${html_extra_dir}/vala-api

if [ ! -n "$RTD_VERSION" ]; then
echo "must specify version for readthedocs.org"
exit 1
fi
mkdir -p ${html_extra_dir}/vala-api

mkdir build-doc
cd build-doc
cmake -D CMAKE_BUILD_TYPE=Release ..
make doc
mkdir git
cd git
git init
git remote add origin $GIT_REMOTE_URL
git checkout -b $LANG-api-docs/$RTD_VERSION
cp -R ../$DOC_DIR/* .
git add .
git commit -m "documentation"
git push --force origin $LANG-api-docs/$RTD_VERSION
if [ -n "$RTD_VERSION2" ]; then
git push --force origin HEAD:$LANG-api-docs/$RTD_VERSION2
fi
cd ../..
rm -rf build-doc
rm -rf ${build_dir}
cmake -D CMAKE_BUILD_TYPE=Release -B${build_dir} -H${base_dir}
make -s -C ${build_dir} doc

cp -R ${build_dir}/valadoc/* ${html_extra_dir}/vala-api

rm -rf ${build_dir}
2 changes: 0 additions & 2 deletions release.sh
Expand Up @@ -9,8 +9,6 @@ version=$(dpkg-parsechangelog -S Version)
distribution=$(dpkg-parsechangelog -S Distribution)
codename=$(debian-distro-info --codename --${distribution})

./release-doc.sh ${version} stable

OS=debian DIST=${codename} ARCH=amd64 pbuilder-ev3dev build
OS=debian DIST=${codename} ARCH=i386 PBUILDER_OPTIONS="--binary-arch" pbuilder-ev3dev build
OS=debian DIST=${codename} ARCH=armhf PBUILDER_OPTIONS="--binary-arch" pbuilder-ev3dev build
Expand Down

0 comments on commit b2e2342

Please sign in to comment.