diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-12-05 13:41:17 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-12-08 21:35:14 -0500 |
commit | b9160dbf831d0a72dd32b4043986198c9c561cbf (patch) | |
tree | 9e9795b06ff22bd2f25a3798ad321c665aca0e6f | |
parent | 3b4470e7577adfb3a0ff1e6e4f721ecdfde53d3e (diff) |
Better release zip generation
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | docs/.gitignore | 1 | ||||
-rw-r--r-- | jarmonbuild/commands.py | 32 |
3 files changed, 24 insertions, 13 deletions
@@ -1,3 +1,5 @@ *.pyc -*.zip + /build/ +/test.rrd +/jarmon-*.zip diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..6a7cbfd --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +/apidocs/ diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index e4c20ca..ebd6ebc 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -72,11 +72,11 @@ class BuildApidocsCommand(BuildCommand): """ parser = OptionParser( - usage='build [options] %s VERSION' % (self.command_name,)) + usage='build [options] %s VERSION [DIRECTORY]' % (self.command_name,)) parser.disable_interspersed_args() options, args = parser.parse_args(argv) - if len(args) != 1: + if len(args) != 1 and len(args) != 2: parser.error('Wrong number of arguments. This command expects a ' 'version number only.') @@ -85,6 +85,8 @@ class BuildApidocsCommand(BuildCommand): tmpdir = gettempdir() workingbranch_dir = self.workingbranch_dir build_dir = self.build_dir + apidocs_dir = os.path.join(args[1] if len(args) == 2 else build_dir, 'docs', 'apidocs') + yuidoc_dir = os.path.join(build_dir, YUIDOC_DIR) # Check for yuidoc dependencies for r in pkg_resources.parse_requirements(YUIDOC_DEPENDENCIES): @@ -130,9 +132,7 @@ class BuildApidocsCommand(BuildCommand): self.log.debug('YUI Doc checksum verified') # Remove any existing apidocs so that we can track removed files - shutil.rmtree(os.path.join(build_dir, 'docs', 'apidocs'), True) - - yuidoc_dir = os.path.join(build_dir, YUIDOC_DIR) + shutil.rmtree(apidocs_dir, True) # extract yuidoc folder from the downloaded zip file self.log.debug( @@ -147,10 +147,8 @@ class BuildApidocsCommand(BuildCommand): sys.executable, os.path.join(yuidoc_dir, 'bin', 'yuidoc.py'), os.path.join(workingbranch_dir, 'jarmon'), - '--parseroutdir=%s' % ( - os.path.join(build_dir, 'docs', 'apidocs'),), - '--outputdir=%s' % ( - os.path.join(build_dir, 'docs', 'apidocs'),), + '--parseroutdir=%s' % (apidocs_dir,), + '--outputdir=%s' % (apidocs_dir,), '--template=%s' % ( os.path.join( workingbranch_dir, 'jarmonbuild', 'yuidoc_template'),), @@ -187,11 +185,21 @@ class BuildReleaseCommand(BuildCommand): workingbranch_dir = self.workingbranch_dir build_dir = self.build_dir + self.log.debug('Clean the build folder') + shutil.rmtree(build_dir, True) + os.mkdir(build_dir) + self.log.debug('Export versioned files to a build folder') check_call(('git', '--work-tree=%s' % (build_dir,), 'checkout', '-f')) self.log.debug('Generate apidocs') - BuildApidocsCommand().main([buildversion]) + BuildApidocsCommand().main([buildversion, build_dir]) + + self.log.debug('Generate jsdeps') + BuildJavascriptDependenciesCommand().main([build_dir]) + + self.log.debug('Generate testdata') + BuildTestDataCommand().main([build_dir]) self.log.debug('Generate archive') archive_root = 'jarmon-%s' % (buildversion,) @@ -224,7 +232,7 @@ class BuildTestDataCommand(BuildCommand): start = int(datetime(1980, 1, 1, 0, 0).strftime('%s')) dss = [] rras = [] - filename = os.path.join(self.build_dir, 'test.rrd') + filename = os.path.join(argv[0] if len(argv) > 0 else self.build_dir, 'test.rrd') rows = 12 step = 10 @@ -264,7 +272,7 @@ class BuildJavascriptDependenciesCommand(BuildCommand): self.log.debug('Compiling javascript dependencies') depjs_path = os.path.join( - self.workingbranch_dir, + argv[0] if len(argv) > 0 else self.workingbranch_dir, 'docs/examples/assets/js/dependencies.js') # Get the closure params from the original file |