Sha256: 9d7370e4c30d548ded5cf8cd9809548e850683790b9f4dca7e608fa6d68eed86

Contents?: true

Size: 1.36 KB

Versions: 7

Compression:

Stored size: 1.36 KB

Contents

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

module SC
  class Tools

    desc "PROJECT [APP]",
      "Generates a SproutCore project with an initial application"
    method_options('--dry-run' => false, :force => 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
      generator = project.generator_for 'app',
        :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

7 entries across 7 versions & 1 rubygems

Version Path
sproutcore-1.4.4-java lib/sproutcore/tools/init.rb
sproutcore-1.4.4 lib/sproutcore/tools/init.rb
sproutcore-1.4.3.1 lib/sproutcore/tools/init.rb
sproutcore-1.4.3-java lib/sproutcore/tools/init.rb
sproutcore-1.4.3 lib/sproutcore/tools/init.rb
sproutcore-1.4.2-java lib/sproutcore/tools/init.rb
sproutcore-1.4.2 lib/sproutcore/tools/init.rb