Commit 694dfd9d authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Added --extjs command line option.

This defines the location of ExtJS directory.
It will be copied or symlinked to <output-dir>/extjs

This will allow us for now to skip adding the whole Ext4
to our small jsduck repo.
parent d9662f60
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@ opts = OptionParser.new do | opts |
    app.template_dir = path
  end

  opts.on('--extjs=PATH', "Directory containing ExtJS.") do |path|
    app.extjs_dir = path
  end

  opts.on('--template-links', "Instead of copying template files, create symbolic links.",
    "Useful for template files development.",
    "Only works on platforms supporting symbolic links.") do
@@ -110,6 +114,9 @@ elsif File.exists?(app.output_dir) && !File.directory?(app.output_dir)
elsif !File.exists?(File.dirname(app.output_dir))
  puts "Oh noes!  The parent directory for #{output_dir} doesn't exist."
  exit(1)
elsif !app.export && !app.extjs_dir
  puts "You must specify directory containing ExtJS using --extjs option :("
  exit(1)
end

app.run()
+7 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ module JsDuck
    attr_accessor :output_dir
    attr_accessor :template_dir
    attr_accessor :template_links
    attr_accessor :extjs_dir
    attr_accessor :input_files
    attr_accessor :verbose
    attr_accessor :export
@@ -33,6 +34,7 @@ module JsDuck
      @output_dir = nil
      @template_dir = nil
      @template_links = false
      @extjs_dir = nil
      @input_files = []
      @verbose = false
      @export = nil
@@ -69,6 +71,11 @@ module JsDuck
        else
          copy_template(@template_dir, @output_dir)
        end
        if @template_links
          File.symlink(File.expand_path(@extjs_dir), @output_dir+"/extjs")
        else
          FileUtils.cp_r(File.expand_path(@extjs_dir), @output_dir+"/extjs")
        end
        @timer.time(:generating) { write_src(@output_dir+"/source", parsed_files) }
        @timer.time(:generating) { write_tree(@output_dir+"/output/tree.js", relations) }
        @timer.time(:generating) { write_members(@output_dir+"/output/members.js", relations) }