[Pkg-mozext-commits] [adblock-plus] 172/464: Added command to generate documentation (PyV8 module required)

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit fa265dc04e90c9d6cff9e9fa09e27031647a9333
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Thu Oct 20 18:26:36 2011 +0200

    Added command to generate documentation (PyV8 module required)
---
 build.py | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/build.py b/build.py
index 0f2ddd8..d54d4a6 100644
--- a/build.py
+++ b/build.py
@@ -5,7 +5,7 @@
 # compliance with the License. You may obtain a copy of the License at
 # http://www.mozilla.org/MPL/
 
-import os, sys, re, buildtools
+import os, sys, re, subprocess, buildtools
 from getopt import getopt, GetoptError
 
 class Command(object):
@@ -215,6 +215,35 @@ def showDescriptions(baseDir, scriptName, opts, args, type):
       )).encode('utf-8')
 
 
+def generateDocs(baseDir, scriptName, opts, args, type):
+  if len(args) == 0:
+    print 'No target directory specified for the documentation'
+    usage(scriptName, type, 'docs')
+    return
+  targetDir = args[0]
+
+  toolkit = None
+  for option, value in opts:
+    if option in ('-t', '--toolkit'):
+      toolkit = value
+
+  if toolkit == None:
+    toolkit = os.path.join(baseDir, 'jsdoc-toolkit')
+    if not os.path.exists(toolkit):
+      subprocess.Popen(['hg', 'clone', 'https://hg.adblockplus.org/jsdoc-toolkit/', toolkit]).communicate()
+
+  command = [sys.executable,
+             os.path.join(toolkit, 'jsrun.py'),
+             '-t=' + os.path.join(toolkit, 'templates', 'jsdoc'),
+             '-d=' + targetDir,
+             '-a',
+             '-p',
+             '-x=js,jsm',
+             os.path.join(baseDir, 'modules'),
+             os.path.join(baseDir, 'components')]
+  subprocess.Popen(command).communicate()
+
+
 def runReleaseAutomation(baseDir, scriptName, opts, args, type):
   buildtoolsRepo = buildtools.__path__[0]
   keyFile = None
@@ -277,6 +306,13 @@ with addCommand(showDescriptions, 'showdesc') as command:
   command.params = '[options]'
   command.supportedTypes = ('gecko')
 
+with addCommand(generateDocs, 'docs') as command:
+  command.shortDescription = 'Generate documentation'
+  command.description = 'Generate documentation files and write them into the specified directory.'
+  command.addOption('JsDoc Toolkit location', short='t', long='toolkit', value='dir')
+  command.params = '[options] <directory>'
+  command.supportedTypes = ('gecko')
+
 with addCommand(runReleaseAutomation, 'release') as command:
   command.shortDescription = 'Run release automation'
   command.description = 'Note: If you are not the project owner then you '\

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list