Sha256: f1ddf7afc71e3ed6c52c1657891a7f852715f6200483ecd668bdc95016692d85

Contents?: true

Size: 1.97 KB

Versions: 13

Compression:

Stored size: 1.97 KB

Contents

puts __FILE__ if defined?(DEBUG)

require_relative('info.rb')
require_relative('../base/array.rb')
require_relative('../base/projects.rb')
require_relative('../base/timer.rb')

RAKE_DEFAULT_EXISTS=File.exists?('rake.default')

current=Projects.current
#if(!current.nil?)
#  INFO.add "#{current[:name]} #{current[:url]}"
#end

if(!defined?(NO_DEFAULT_TASK)) 
  desc 'perform project commands to push gem development'
  task :default do
    if(defined?(DEFAULT_TASKS))
      DEFAULT_TASKS.each{|task| Rake::Task[task].invoke}
    else
    	if(File.exists?('.git'))
        CLEAN.exclude('rake.default')
        Rake::Task["clean"].invoke
        Rake::Task["clean"].reenable
        CLEAN.include('rake.default')
        puts `git add -A` if(File.exists?('.gitignore'))
        if(Git.has_changes?)#  || !RAKE_DEFAULT_EXISTS)
          puts 'Git changes detected.'
          puts `git status`
    		  [:setup,:build,:test,:publish,:clean,:add,:commit,:push,:pull,:info].each{|task| Rake::Task[task].invoke}
        elsif !RAKE_DEFAULT_EXISTS
          puts 'rake.default does not exist.'
          [:setup,:build,:test,:publish,:clean,:add,:commit,:push,:pull,:info].each{|task| Rake::Task[task].invoke}
        else
          puts 'no changes detected.'
          #[:pull].each{|task| Rake::Task[task].invoke}
        end
    	else
  	  	if(File.exists?('.svn'))
          if(Svn.has_changes? || !File.exists?('rake.default'))
  	  		  [:setup,:build,:test,:publish,:clean,:add,:commit,:update,:info].each{|task| Rake::Task[task].invoke}
          else
            puts 'no changes detected.'
            #[:update].each{|task| Rake::Task[task].invoke}
          end
  	  	else
          [:setup,:build,:test,:publish,:info].each{|task| Rake::Task[task].invoke}
  	  	end
  	 end
    end
    
    puts "[:default] completed in #{TIMER.elapsed_str}"
    File.open('rake.default','w'){|f|f.puts "[:default] completed in #{TIMER.elapsed_str}"}
  end # :default
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dev-2.0.162 lib/tasks/default.rb
dev-2.0.161 lib/tasks/default.rb
dev-2.0.160 lib/tasks/default.rb
dev-2.0.159 lib/tasks/default.rb
dev-2.0.158 lib/tasks/default.rb
dev-2.0.157 lib/tasks/default.rb
dev-2.0.156 lib/tasks/default.rb
dev-2.0.155 lib/tasks/default.rb
dev-2.0.154 lib/tasks/default.rb
dev-2.0.153 lib/tasks/default.rb
dev-2.0.152 lib/tasks/default.rb
dev-2.0.151 lib/tasks/default.rb
dev-2.0.150 lib/tasks/default.rb