Sha256: e4a59d8adc41f0d40c9cb2861cc5cf29baec9f2e9c53cacda2f5c32a1cc5e316

Contents?: true

Size: 1.84 KB

Versions: 86

Compression:

Stored size: 1.84 KB

Contents

require 'rake'
require_relative('info.rb')
require_relative('../base/array.rb')
require_relative('../base/dir.rb')
require_relative('../base/environment.rb')
require_relative('../base/projects.rb')
require_relative('../base/project.rb')
require_relative('../base/timer.rb')

puts "defining DEFAULT TASK" if Environment.default.debug?

work_up_to_date=false
if(defined?(DEV))
  puts "DEFAULT: DEV is defined" if DEV.env.debug?
  project=DEV.projects.current
  puts "project is nil" if DEV.env.debug? && project.nil?
  if(!project.nil?)
    if(project.work_up_to_date?)
      puts "project work is up to date" if DEV.env.debug?
      work_up_to_date=true
    else
      puts "project work is NOT up to date" if DEV.env.debug?
    end
  end
end

if(defined?(NO_DEFAULT_TASK))
  puts "NO_DEFAULT_TASK is defined" if Environment.default.debug?
else
  default_tasks=nil
  default_tasks=DEFAULT_TASKS if defined? DEFAULT_TASKS
  if(default_tasks.nil?)
    if(work_up_to_date)
      default_tasks=[]
    elsif(File.exists?('.git'))
      default_tasks=[:setup,:build,:test,:add,:commit,:publish,:clean,:push,:pull]
    elsif File.exists?('.svn')
      default_tasks=[:setup,:build,:test,:add,:commit,:publish,:clean,:update]
    else
      default_tasks=[:setup,:build,:test,:publish]
    end
  end

  puts "default_tasks=#{default_tasks}" if Environment.default.debug?
  desc "default task #{default_tasks.to_s}"
  task :default do
    default_tasks.each{|task| 
      Rake::Task[task].invoke 
    }
    project.mark_work_up_to_date if !project.nil?
    puts "[:default] completed in #{TIMER.elapsed_str}" if !Environment.default.colorize?
    if Environment.default.colorize?
      require 'ansi/code'
      puts ANSI.white + ANSI.bold + ":default"  + " completed in " + ANSI.yellow + "#{TIMER.elapsed_str}" + ANSI.reset
    end
  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
dev-2.1.56 lib/tasks/default.rb
dev-2.1.55 lib/tasks/default.rb
dev-2.1.54 lib/tasks/default.rb
dev-2.1.53 lib/tasks/default.rb
dev-2.1.52 lib/tasks/default.rb
dev-2.1.51 lib/tasks/default.rb
dev-2.1.50 lib/tasks/default.rb
dev-2.1.49 lib/tasks/default.rb
dev-2.1.48 lib/tasks/default.rb
dev-2.1.47 lib/tasks/default.rb
dev-2.1.46 lib/tasks/default.rb
dev-2.1.45 lib/tasks/default.rb
dev-2.1.44 lib/tasks/default.rb
dev-2.1.43 lib/tasks/default.rb
dev-2.1.42 lib/tasks/default.rb
dev-2.1.41 lib/tasks/default.rb
dev-2.1.40 lib/tasks/default.rb
dev-2.1.39 lib/tasks/default.rb
dev-2.1.38 lib/tasks/default.rb
dev-2.1.37 lib/tasks/default.rb