Skip to content

Commit

Permalink
Option for a fast build for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
BSVino committed Aug 16, 2014
1 parent 54a6da8 commit de848bf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
5 changes: 5 additions & 0 deletions build_full.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

\Python27\python.exe compile.py --full

pause
22 changes: 20 additions & 2 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@
import shutil
import time
import sys
import argparse

import opengl
import shared

sys.path.append("htmlmin")
import htmlmin

parser = argparse.ArgumentParser(description="Compile OpenGL documentation, generate a static webpage.")

parser.add_argument('--full', dest='buildmode', action='store_const', const='full', default='fast', help='Full build (Default: fast build)')

args = parser.parse_args()

if args.buildmode == 'full':
print "FULL BUILD"
else:
print "FAST BUILD"

def create_directory(dir):
if not os.path.exists(dir):
os.makedirs(dir)
Expand Down Expand Up @@ -194,13 +206,19 @@ def spew_category(name, commands):
raise IOError("Couldn't find page for command " + command + " (" + version + ")")

fp = open(command_file)
command_html = fp.read().decode('utf8')
command_html = fp.read()
fp.close()

if args.buildmode == 'full':
command_html = command_html.decode('utf8')

output_html = header_for_command + command_html + footer_for_command

output = open(output_dir + version_dir + "/" + command, "w")
output.write(htmlmin.minify(output_html, remove_comments=True, reduce_boolean_attributes=True, remove_all_empty_space=True).encode('ascii', 'xmlcharrefreplace'))
output_string = output_html
if args.buildmode == 'full':
output_string = htmlmin.minify(output_html, remove_comments=True, reduce_boolean_attributes=True, remove_all_empty_space=True).encode('ascii', 'xmlcharrefreplace')
output.write(output_string)
output.close()

written += 1
Expand Down

0 comments on commit de848bf

Please sign in to comment.