Source

pyHai / build.bat

@ECHO OFF
SETLOCAL

SET ME_PATH=%~dps0
SET PYTHON_BIN=C:\Python27\python.exe
SET EPYDOC_SCRIPT=C:\Python27\Scripts\epydoc
SET ZIP_BIN=C:\PROGRA~1\7-Zip\7z.exe
SET PKG_NAME=pyhai
SET TEMP_DIR=%TEMP%\%PKG_NAME%_build

PUSHD %ME_PATH%

REM epydocs
%PYTHON_BIN% %EPYDOC_SCRIPT% --css src\build\epydoc.css --html src\%PKG_NAME% --output apidocs\%PKG_NAME% -v
IF EXIST docs\_build\html\api RMDIR /S /Q docs\_build\html\api
XCOPY /E /I /Q apidocs\%PKG_NAME% docs\_build\html\api
IF EXIST docs\%PKG_NAME%.apidoc.zip DEL apidocs\%PKG_NAME%.apidoc.zip
IF EXIST docs\%PKG_NAME%.apidoc.tar.gz DEL apidocs\%PKG_NAME%.apidoc.tar.gz
PUSHD docs\_build\html\
%ZIP_BIN% a -tzip -r %PKG_NAME%.htmldoc.zip *
POPD
IF EXIST docs\%PKG_NAME%.htmldoc.zip DEL docs\%PKG_NAME%.htmldoc.zip
MOVE docs\_build\html\%PKG_NAME%.htmldoc.zip docs\%PKG_NAME%.htmldoc.zip
%ZIP_BIN% a -tzip -r apidocs\%PKG_NAME%.apidoc.zip apidocs\%PKG_NAME%\*
%ZIP_BIN% a -ttar -r %PKG_NAME%.apidoc.tar apidocs\%PKG_NAME%\*
%ZIP_BIN% a -tgzip -r apidocs\%PKG_NAME%.apidoc.tar.gz %PKG_NAME%.apidoc.tar
IF EXIST %PKG_NAME%.apidoc.tar DEL %PKG_NAME%.apidoc.tar

REM Sphinx docs
PUSHD .\docs
sphinx-build -b html -d _build/doctrees  . _build/html
POPD

REM repos
PUSHD .\src
%PYTHON_BIN% setup.py build
%PYTHON_BIN% setup.py sdist --format=zip,gztar,bztar
%PYTHON_BIN% setup.py bdist --format=zip,gztar,bztar
%PYTHON_BIN% setup.py clean
POPD

REM cleanup
IF EXIST %TEMP_DIR% rmdir /Q /S %TEMP_DIR%

POPD

:XIT
ENDLOCAL