Sha256: 25edfc62b52da3a0cf802793dbf11abe5e104848a478551a1361f7497f7cab16

Contents?: true

Size: 1.97 KB

Versions: 1

Compression:

Stored size: 1.97 KB

Contents

require 'rake/clean'

Dir.glob("#{File.dirname(__FILE__)}/*.rb").each{|rb| 
  require_relative(rb)
}

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

# Clean Files
CLEAN.include('**/*.{sdf,sud,ncb,cache,user}')

# Clean Folders
CLEAN.include('obj') if File.exists?('obj')
CLEAN.include('tmp') if File.exists?('tmp')

# CLOBBER Files
CLOBBER.include('**/*.gem')
CLOBBER.include('**/*.{dll,pdb}')

# CLOBBER Folders
CLOBBER.include('bin') if File.exists?('bin')
CLOBBER.include('doc') if File.exists?('doc')

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'))
        Rake::Task["clobber"].invoke
        Rake::Task["clobber"].reenable
        puts `git add -A` if(File.exists?('.gitignore'))
        if(Git.has_changes?  || !RAKE_DEFAULT_EXISTS)
    		  [:setup,:build,:test,:publish,:clobber,: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,:clobber,: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}"}
    CLEAN.include('rake.default')
  end # :default
end

class Dev
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dev-2.0.72 lib/dev.rb