Skip to content

Commit

Permalink
Modify release generation process to respect the new generated / output
Browse files Browse the repository at this point in the history
directory paths.
  • Loading branch information
oddhack committed May 15, 2020
1 parent 8bd1271 commit 2171507
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 45 deletions.
21 changes: 15 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,22 @@ clean_man:
clean_checks:
$(QUIET)$(RMRF) $(CHECKDIR)

# Generated directories and files to remove
CLEAN_GEN_PATHS = \
$(APIPATH) \
$(HOSTSYNCPATH) \
$(VALIDITYPATH) \
$(METAPATH) \
$(INTERFACEPATH) \
$(REFPATH) \
$(GENERATED)/include \
$(GENERATED)/__pycache__ \
$(PDFMATHDIR) \
$(GENERATED)/api.py \
$(GENERATED)/extDependency.*

clean_generated:
$(QUIET)$(RMRF) $(APIPATH) $(HOSTSYNCPATH) $(VALIDITYPATH) \
$(METAPATH) $(INTERFACEPATH) $(REFPATH) \
$(GENERATED)/include \
$(GENERATED)/__pycache__ \
$(PDFMATHDIR)
$(QUIET)$(RM) $(GENERATED)/api.py $(GENERATED)/extDependency.*
$(QUIET)$(RMRF) $(CLEAN_GEN_PATHS)

clean_validusage:
$(QUIET)$(RM) $(VUDIR)/validusage.json
Expand Down
37 changes: 11 additions & 26 deletions scripts/genRelease
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ if __name__ == '__main__':

args = parser.parse_args()

# Look for api.py in the specified directory
if args.genpath is not None:
sys.path.insert(0, args.genpath)
import api

# Ensure gen/extDependency.py is up-to-date before we import it.
# If it is up to date, 'make' will print a useless warning without '-s'.
subprocess.check_call(['make', '-s', 'GENERATED=' + args.genpath, 'extDependency'])
Expand All @@ -92,9 +87,6 @@ if __name__ == '__main__':
if args.outDir == '':
outDir = '/home/tree/git/registry/vulkan/specs'

# Always build PDF for public releases
args.pdf = True

refPageTargets = ''

if not args.norefpages:
Expand Down Expand Up @@ -122,36 +114,35 @@ if __name__ == '__main__':
if args.v12:
if args.allspec:
# Build ref pages and validusage targets only for 1.2 + all exts
buildBranch('1.2-extensions',
# Formerly set xmlTargets = 'clobber install', but we no longer
# generate headers in the registry tree.
buildBranch(targetDir = '1.2-extensions',
versions = allVersions,
extensions = allExts,
ratified = False,
apititle = '(with all registered Vulkan extensions)',
xmlTargets = 'clobber install',
specTargets = specTargets + ' validusage' + refPageTargets,
repoDir = repoDir,
outDir = outDir)

if args.khrspec:
buildBranch('1.2-khr-extensions',
buildBranch(targetDir = '1.2-khr-extensions',
versions = allVersions,
extensions = khrExts,
ratified = True,
apititle = '(with KHR extensions)',
xmlTargets = 'clobber install',
specTargets = specTargets,
repoDir = repoDir,
outDir = outDir)

if args.corespec:
# Build style guide and registry documentation targets only for 1.2
# + no extensions.
buildBranch('1.2',
buildBranch(targetDir = '1.2',
versions = allVersions,
extensions = None,
ratified = True,
apititle = None,
xmlTargets = 'clobber install',
specTargets = specTargets + ' styleguide registry',
repoDir = repoDir,
outDir = outDir,
Expand All @@ -160,34 +151,31 @@ if __name__ == '__main__':
# Vulkan 1.1 specs
if args.v11:
if args.allspec:
buildBranch('1.1-extensions',
buildBranch(targetDir = '1.1-extensions',
versions = Version1_1,
extensions = allExts,
ratified = False,
apititle = '(with all registered Vulkan extensions)',
xmlTargets = 'clobber install',
specTargets = specTargets,
repoDir = repoDir,
outDir = outDir)

if args.khrspec:
buildBranch('1.1-khr-extensions',
buildBranch(targetDir = '1.1-khr-extensions',
versions = Version1_1,
extensions = khrExts,
ratified = True,
apititle = '(with KHR extensions)',
xmlTargets = 'clobber install',
specTargets = specTargets,
repoDir = repoDir,
outDir = outDir)

if args.corespec:
buildBranch('1.1',
buildBranch(targetDir = '1.1',
versions = Version1_1,
extensions = None,
ratified = True,
apititle = None,
xmlTargets = 'clobber install',
specTargets = specTargets,
repoDir = repoDir,
outDir = outDir)
Expand All @@ -198,34 +186,31 @@ if __name__ == '__main__':
# Vulkan 1.0 specs.
if args.v10:
if args.allspec:
buildBranch('1.0-extensions',
buildBranch(targetDir = '1.0-extensions',
versions = Version1_0,
extensions = allExts,
ratified = False,
apititle = '(with all registered Vulkan extensions)',
xmlTargets = 'clobber install',
specTargets = specTargets,
repoDir = repoDir,
outDir = outDir)

if args.khrspec:
buildBranch('1.0-wsi_extensions',
buildBranch(targetDir = '1.0-wsi_extensions',
versions = Version1_0,
extensions = khrExts,
ratified = True,
apititle = '(with KHR extensions)',
xmlTargets = 'clobber install',
specTargets = specTargets,
repoDir = repoDir,
outDir = outDir)

if args.corespec:
buildBranch('1.0',
buildBranch(targetDir = '1.0',
versions = Version1_0,
extensions = None,
ratified = True,
apititle = None,
xmlTargets = 'clobber install',
specTargets = specTargets,
repoDir = repoDir,
outDir = outDir)
Expand Down
27 changes: 14 additions & 13 deletions scripts/genspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ def buildRelease(label,
'vkspec.html styleguide.html apispec.html apispec.pdf registry.html',
')')

# print('echo Info: Generating headers and spec include files')
print('cd', xmlDir)
print('make', outarg, xmlTargets)
if xmlTargets != '':
# print('echo Info: Generating headers and spec include files')
print('cd', xmlDir)
print('make', outarg, xmlTargets)

# print('echo Info: Generating ref pages sources and spec targets')
print('cd', specDir)
Expand All @@ -108,7 +109,7 @@ def buildRelease(label,
# specTargets require ref page sources, and they aren't already present
# at the time the make is invoked, that target will not be built.
if needRefSources:
print('make', outarg, versarg, extarg, 'man/apispec.txt')
print('make', outarg, versarg, extarg, 'refpages')
# Now make the actual targets.
print('make -O -k -j 8',
outarg, versarg, extarg, ratifiedarg, titlearg,
Expand All @@ -122,15 +123,15 @@ def buildRelease(label,
print('')


def buildBranch(targetDir,
versions,
extensions,
ratified,
apititle,
xmlTargets,
specTargets,
repoDir,
outDir,
def buildBranch(targetDir = '',
versions = '',
extensions = '',
ratified = False,
apititle = '(NO TITLE SPECIFIED)',
xmlTargets = '',
specTargets = '',
repoDir = '',
outDir = '',
needRefSources=False):
"""Build all target documents.
Expand Down

0 comments on commit 2171507

Please sign in to comment.