Sha256: 9d5e9941423d4e99b2336fc850e2f9407843e8d22431ca85fa9a46a3efdad804

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

module Dev
module Cmd
class Compile < Array
  def refresh

    puts_debug "Dev::Cmd::Compile.refresh"
	strip_auto_entries
	windows=RUBY_PLATFORM.include?("w32")

	# jamfiles

	# vcxproj
    Dir.glob('**/*.vcxproj').each { |vcxproj| self << "{:cmd=> '<paths,msbuild> #{vcxproj} /property:Configuration=Release /property:Platform=Win32', :auto=>true}" } if windows

	# csproj
	csbuild="<paths,msbuild>"
	csbuild="xbuild" if !RUBY_PLATFORM.include?("w32")
	Dir.glob('**/*.csproj').each { |csproj| 
	  platforms=Dev::Cmd::Compile.extract_platforms(csproj)
	  platforms.each { |platform|
	    skip=(!RUBY_PLATFORM.include?("w32") && platform=="x64")
	    array << "{:cmd=> '#{csbuild} #{csproj} /property:Configuration=Release /property:Platform=\"#{platform}\" /p:OutputPath=./bin/#{platform}/Release', :auto=>true}" if !skip
	  }
	}

	# gemspec
    Dir.glob("*.gemspec").each { |gs| self << "{:cmd=> 'gem build #{gs}', :capture_output=> false, :auto=> true}" }
  end

  def self.extract_platforms(filename)
    results = Array::new
    text=File.read(filename)
    text.scan(/(\w+)<\/Platform/).each{ | var_match | results << var_match[0].to_s if !results.include?(var_match[0].to_s)}
    results
  end
end	# class Compile
end # module Cmd
end # module Dev

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dev-1.0.147 lib/dev/cmd/Compile.rb