Sha256: 232df63aa81e7e3e7ba7d60bb6e0f58a1b2fb8907dfc3cb07e3bb1de3b47965f

Contents?: true

Size: 1.62 KB

Versions: 74

Compression:

Stored size: 1.62 KB

Contents

# ==========================================================================
# Generator: PROJECT
# Copyright: ©2006-2011 Strobe Inc. and contributors
#            portions copyright ©2009 Apple Inc.
# ==========================================================================

namespace :generator do

  # Accept the following types of arguments:
  #
  #  project .             #=> Make current working directory. like sc-init
  #  project project_name  #=> Create project_name, namespace: ProjectName
  #  project ProjectName   #=> Create project_name, namespace: ProjectName
  #  project NameSpace path/to/project #=> Create path/to/project, NameSpace
  #
  task :prepare do
    # get arguments & normalize
    gen = GENERATOR
    namespace = gen.arguments[1]
    project_path = gen.arguments[2]
    
    if project_path
      project_path = File.expand_path(project_path)
      namespace = File.basename(project_path) if namespace == '.'
    elsif namespace == '.'
      project_path = Dir.pwd
      namespace = File.basename(project_path)
    else
      project_path = Dir.pwd / gen.snake_case(namespace)
    end
      
    # Setup standard options for generating a project
    gen.target_name = gen.target = gen.method_name = gen.class_name = nil
    gen.build_root = File.dirname(project_path) # dir where project dir lives
    gen.filename = File.basename(project_path) # project dir name
    gen.namespace = gen.camel_case namespace
  end
  
end

# default behavior for a template is to just copy the contents of the
# templates directory to the end destination. Add any additional configs here.
config :templates,
  :root_dir   => '_file_path_'
  

Version data entries

74 entries across 47 versions & 1 rubygems

Version Path
sproutcore-1.7.1.beta lib/gen/html_project/Buildfile
sproutcore-1.6.0.1-java lib/gen/html_project/Buildfile
sproutcore-1.6.0.1-java lib/gen/project/Buildfile
sproutcore-1.6.0.1 lib/gen/project/Buildfile
sproutcore-1.6.0.1 lib/gen/html_project/Buildfile
sproutcore-1.6.0.1-x86-mingw32 lib/gen/html_project/Buildfile
sproutcore-1.6.0.1-x86-mingw32 lib/gen/project/Buildfile
sproutcore-1.6.0 lib/gen/html_project/Buildfile
sproutcore-1.6.0 lib/gen/project/Buildfile
sproutcore-1.6.0-java lib/gen/project/Buildfile
sproutcore-1.6.0-java lib/gen/html_project/Buildfile
sproutcore-1.6.0.rc.2-x86-mingw32 lib/gen/html_project/Buildfile
sproutcore-1.6.0.rc.2-x86-mingw32 lib/gen/project/Buildfile
sproutcore-1.6.0.rc.2 lib/gen/html_project/Buildfile
sproutcore-1.6.0.rc.2 lib/gen/project/Buildfile
sproutcore-1.6.0.rc.2-java lib/gen/project/Buildfile
sproutcore-1.6.0.rc.2-java lib/gen/html_project/Buildfile
sproutcore-1.6.0.rc.1-x86-mingw32 lib/gen/html_project/Buildfile
sproutcore-1.6.0.rc.1-x86-mingw32 lib/gen/project/Buildfile
sproutcore-1.6.0.rc.1 lib/gen/html_project/Buildfile