Sha256: 29796e6256eaa9137e3480aa29ef777f8c98a5ba3b4753b2e7f00046e176bb12

Contents?: true

Size: 1.5 KB

Versions: 17

Compression:

Stored size: 1.5 KB

Contents

# ===========================================================================
# Project:   Abbot - SproutCore Build Tools
# Copyright: ©2009 Apple Inc.
#            portions copyright @2006-2011 Strobe Inc.
#            and contributors
# ===========================================================================

module SC
  class Tools

    desc "init PROJECT [APP]",
      "Generates a SproutCore project with an initial application"
    method_options('--dry-run' => false, :force => false, '--statechart' => false)
    def init(project_name, app_name=nil)

    # Generate the project
     project_gen = SC.builtin_project.generator_for 'project',
      :arguments => ['project', project_name],
      :dry_run   => options[:"dry-run"],
      :force     => options[:force]

     project_gen.prepare!.build!

      # Next, get the project root & app name
      project_root = project_gen.build_root / project_gen.filename
      app_name = project_gen.filename if app_name.nil?

      # And get the app generator and run it
      project = SC::Project.load project_root, :parent => SC.builtin_project

      # Use the statechart_app generator if --statechart is provided
      app_type = options[:statechart] ? 'statechart_app' : 'app'

      generator = project.generator_for app_type,
        :arguments => ['app', app_name],
        :dry_run   => options[:"dry-run"],
        :force     => options[:force]
      generator.prepare!.build!

      project_gen.log_file(project_gen.source_root / 'INIT')
      return 0
    end

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/sproutcore/tools/init.rb
sproutcore-1.11.0.rc3 lib/sproutcore/tools/init.rb
sproutcore-1.11.0.rc2 lib/sproutcore/tools/init.rb
sproutcore-1.11.0.rc1 lib/sproutcore/tools/init.rb
sproutcore-1.10.3.1 lib/sproutcore/tools/init.rb
sproutcore-1.10.2 lib/sproutcore/tools/init.rb
sproutcore-1.10.1 lib/sproutcore/tools/init.rb
sproutcore-1.10.0 lib/sproutcore/tools/init.rb
sproutcore-1.10.0.rc.3 lib/sproutcore/tools/init.rb
sproutcore-1.10.0.rc.2 lib/sproutcore/tools/init.rb
sproutcore-1.10.0.rc.1 lib/sproutcore/tools/init.rb
sproutcore-1.9.2 lib/sproutcore/tools/init.rb
sproutcore-1.9.1 lib/sproutcore/tools/init.rb
sproutcore-1.9.0 lib/sproutcore/tools/init.rb
sproutcore-1.8.2.1 lib/sproutcore/tools/init.rb
sproutcore-1.8.1 lib/sproutcore/tools/init.rb
sproutcore-1.8.0 lib/sproutcore/tools/init.rb