Sha256: 65db583dcc682a0256ed2308d0a8d24c16579806acbf2b5c1445a9dffe80940e

Contents?: true

Size: 1.63 KB

Versions: 35

Compression:

Stored size: 1.63 KB

Contents

# ==========================================================================
# Generator: PROJECT
# Copyright: ©2006-2009 Sprout Systems, 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

35 entries across 35 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.20090721145285 gen/project/Buildfile
sproutcore-1.4.4-java lib/gen/project/Buildfile
sproutcore-1.4.4 lib/gen/project/Buildfile
sproutcore-1.4.3.1 lib/gen/project/Buildfile
sproutcore-1.4.3-java lib/gen/project/Buildfile
sproutcore-1.4.3 lib/gen/project/Buildfile
sproutcore-1.4.2-java lib/gen/project/Buildfile
sproutcore-1.4.2 lib/gen/project/Buildfile
sproutcore-1.4.1-java lib/gen/project/Buildfile
sproutcore-1.4.1 lib/gen/project/Buildfile
sproutcore-1.4.0-java lib/gen/project/Buildfile
sproutcore-1.4.0 lib/gen/project/Buildfile
sproutcore-1.4.0.rc.5 lib/gen/project/Buildfile
sproutcore-1.4.0.rc.4 lib/gen/project/Buildfile
sproutcore-1.4.0.rc.3 lib/gen/project/Buildfile
sproutcore-1.4.0.rc.2 lib/gen/project/Buildfile
sproutcore-1.4.0.rc gen/project/Buildfile
sproutcore-1.0.1049.pre.2 gen/project/Buildfile
sproutcore-1.0.1049.pre.1 gen/project/Buildfile
sproutcore-1.0.1046 gen/project/Buildfile