Vulkan-Docs/doc/specs/vulkan/genRelease

84 lines
2.7 KiB
Plaintext
Raw Normal View History

2016-02-16 09:53:44 +00:00
#!/usr/bin/python3
import time
from datetime import *
# This script builds a full release package including XHTML and PDF
# versions of the specified branches (usually 1.0 and wsi_extensions,
2016-02-16 09:53:44 +00:00
# but tags or commits can be used as well). Other files in the release
# directory are removed, including man pages, XHTML chunked, HTML,
# validity output, etc.
#
# Both branches must be fully committed and up to date when the script
# is run, with no outstanding un-added / un-committed files. Both
# branches must have fully regnerated all automatically-regeneratable
# files. After completing the build, the current branch is set to
# 'master' and suggestions for creating tags are printed out.
2016-02-16 09:53:44 +00:00
# branch = branch or commit or tag name
# label = textual label to apply
# outdir = directory to generate specs in
def buildRelease(branch,label,outdir,targets):
global root, xml, spec
print('echo Info: Generating branch=' + branch,
'label=' + label,
'outdir=' + outdir)
print('git checkout', branch)
print('echo Info: Generating headers and spec include files')
print('cd', xml)
print('make clobber full_install')
print('echo Info: Cleaning spec in', outdir)
print('cd', spec)
print('rm -rf',
outdir + '/man',
outdir + '/xhtml',
outdir + '/pdf',
outdir + '/chunked',
outdir + '/vkspec.html',
'specversion.txt')
print('echo Info: Generating spec')
print('make specversion.txt')
print('make -j 4 OUTDIR=' + outdir, ' NOTEOPTS="-a implementation-guide"', targets)
print('rm', outdir + '/pdf/vkspec.xml')
print('git checkout -- specversion.txt')
2016-02-16 09:53:44 +00:00
# Main
global root, xml, spec
# Root of the Vulkan git repo
root = '/home/tree/git/Vulkan-Docs'
2016-02-16 09:53:44 +00:00
# Directory with vk.xml and generation tools
xml = root + '/src/spec'
# Directory with spec sources
spec = root + '/doc/specs/vulkan'
# These can be changed to tags, etc.
corebranch = 'master'
wsibranch = 'wsi_extensions'
2016-02-16 09:53:44 +00:00
# date in YYYYMMDD format
now = datetime.today().strftime('%Y%m%d')
# Generate specs
wsitargets='xhtml chunked pdf'
coretargets=wsitargets + ' styleguide'
buildRelease(corebranch, 'core', root + '/out/core', coretargets)
buildRelease(wsibranch, 'core+wsi', root + '/out/wsi', wsitargets)
2016-02-16 09:53:44 +00:00
print('echo Info: post-generation cleanup')
print('git checkout master')
2016-02-16 09:53:44 +00:00
print('echo To tag the spec branches, execute these commands:')
print('echo git checkout', corebranch)
print('echo git tag -a -m \\"Tag core API specification for', now, 'release\\"', 'v1.0-core-' + now)
print('echo git checkout', wsibranch)
print('echo git tag -a -m \\"Tag core+WSI API specification for', now, 'release\\"', 'v1.0-core+wsi-' + now)
print('echo git push --tags')