Commit e2c78681 authored by Nick Poulden's avatar Nick Poulden
Browse files

Update Rakefile for Ext3.4

parent 57b63abd
Loading
Loading
Loading
Loading
+66 −28
Original line number Diff line number Diff line
@@ -179,6 +179,24 @@ class JsDuckRunner
    ]
  end

  def add_ext3
    @options += [
      "--title", "Sencha Docs - Ext JS 3.4",
      "--footer", "Ext JS 3.4 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
      "--ignore-global",
      "--no-warnings",
      "--output", "#{@out_dir}",
      "#{@sdk_dir}/../ext-3.4.0/src/core",
      "#{@sdk_dir}/../ext-3.4.0/src/data",
      "#{@sdk_dir}/../ext-3.4.0/src/dd",
      "#{@sdk_dir}/../ext-3.4.0/src/direct",
      "#{@sdk_dir}/../ext-3.4.0/src/ext-core/src",
      "#{@sdk_dir}/../ext-3.4.0/src/state",
      "#{@sdk_dir}/../ext-3.4.0/src/util",
      "#{@sdk_dir}/../ext-3.4.0/src/widgets"
    ]
  end

  def add_ext4
    @options += [
      "--title", "Sencha Docs - Ext JS 4.0",
@@ -193,14 +211,14 @@ class JsDuckRunner

  def add_touch
    head_html = <<-EOHTML
      <link rel="canonical" href="http://docs.sencha.com/touch/1-0/" />
      <meta name="description" content="Sencha Touch 1.0 API Documentation from Sencha. Documentation on how to create Javascript applications with Sencha Touch">
      <link rel="canonical" href="http://docs.sencha.com/touch/1-1/" />
      <meta name="description" content="Sencha Touch 1.1 API Documentation from Sencha. Documentation on how to create Javascript applications with Sencha Touch">
    EOHTML

    @options += [
      "--title", "Sencha Docs - Touch 1.0",
      "--title", "Sencha Docs - Touch 1.1",
      "--head-html", head_html,
      "--footer", "Sencha Touch 1.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
      "--footer", "Sencha Touch 1.1 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
      "--categories", "#{@sdk_dir}/touch/doc-resources/categories.json",
      "--videos", "#{@sdk_dir}/touch/doc-resources/videos.json",
      "--output", "#{@out_dir}",
@@ -399,9 +417,33 @@ class JsDuckRunner
                }
            });
        }

        Docs.otherProducts = [
          {
              text: 'Ext JS 4',
              href: 'http://docs.sencha.com/ext-js/4-0'
          },
          {
              text: 'Ext JS 3',
              href: 'http://docs.sencha.com/ext-js/3-4'
          },
          {
              text: 'Sencha Touch 2',
              href: 'http://docs.sencha.com/touch/2-0'
          },
          {
              text: 'Sencha Touch 1',
              href: 'http://docs.sencha.com/touch/1-1'
          },
          {
              text: 'Sencha Animator',
              href: 'http://docs.sencha.com/animator/1-0'
          }
        ];
      </script>
    EOHTML
    ]

  end

  # Copy over SDK examples
@@ -423,29 +465,6 @@ class JsDuckRunner
    system "cp -r #{@sdk_dir}/touch/build #{@out_dir}/touch"
  end

  def add_product_doc_urls
    @options += [
      "--body-html", <<-EOHTML
      <script type="text/javascript">
        Docs.otherProducts = [
          {
              text: 'Ext JS 4.0',
              href: 'http://docs.sencha.com/ext-js/4-0'
          },
          {
              text: 'Sencha Touch 2.0',
              href: 'http://docs.sencha.com/touch/2-0'
          },
          {
              text: 'Sencha Animator 1.0',
              href: 'http://docs.sencha.com/animator/1-0'
          }
        ];
      </script>
      EOHTML
    ]
  end

  def run
    # Pass multiple arguments to system, so we'll take advantage of the built-in escaping
    system(*["ruby", "bin/jsduck"].concat(@options))
@@ -498,6 +517,23 @@ task :ext4, [:mode] => :sass do |t, args|
  runner.run
end

desc "Run JSDuck on official Ext JS 3.4 build\n" +
     "ext3             - creates debug/development version\n" +
     "ext3[export]     - creates export/deployable version\n"
     "ext3[live]       - creates live version for deployment\n"
task :ext3, [:mode] => :sass do |t, args|
  mode = args[:mode] || "debug"
  throw "Unknown mode #{mode}" unless ["debug", "export"].include?(mode)
  compress if mode == "export"

  runner = JsDuckRunner.new
  runner.add_ext3
  runner.add_debug if mode == "debug"
  runner.add_seo
  runner.add_google_analytics if mode == "live"
  runner.run
end

desc "Run JSDuck on Sencha Touch (for internal use at Sencha)\n" +
     "touch       - creates debug/development version\n" +
     "touch[live] - create live version for deployment\n"
@@ -510,6 +546,7 @@ task :touch, [:mode] => :sass do |t, args|
  runner.add_touch
  runner.add_debug if mode == "debug"
  runner.add_seo if mode == "debug" || mode == "live"
  runner.add_google_analytics if mode == "live"
  runner.run
end

@@ -528,7 +565,7 @@ task :touch2, [:mode] => :sass do |t, args|
  runner.add_touch2_export_notice if mode == "export"
  runner.set_touch2_src if mode == "export"
  runner.add_seo if mode == "debug" || mode == "live"
  runner.add_product_doc_urls if mode == "live"
  runner.add_google_analytics if mode == "live"
  runner.run

  runner.copy_touch2_build if mode != "export"
@@ -560,6 +597,7 @@ task :animator, [:mode] => :sass do |t, args|
  runner.add_animator
  runner.add_debug if mode == "debug"
  runner.add_seo if mode == "debug" || mode == "live"
  runner.add_google_analytics if mode == "live"
  runner.run

  runner.copy_animator_examples