class Compile

Public Instance Methods

execute(name, session, options) click to toggle source
# File lib/rakeoff/compile.rb, line 4
def execute(name, session, options)
        print_heading name
        
matches = Dir.glob("#{session.working_dir}/*.sln", File::FNM_CASEFOLD)

if matches.empty? 
        raise NoSolutionFile, "No *.sln file found in #{session.working_dir}".red
end

        if matches.length > 1
                raise MultipleSolutionFiles, "Multiple solution files found at #{session.working_dir}. Don't know which one to build!".red
        end

        match = matches.first

multi_core = session.framework_version[1,1].to_i > 2 ? '/m' : ''
        msbuild_path = "%windir%/microsoft.net/framework/#{session.framework_version}/msbuild.exe"

sh "#{msbuild_path} /t:Clean;Build /p:Configuration=#{session.configuration} #{options} /p:TrackFileAccess=false #{multi_core} /consoleloggerparameters:ErrorsOnly #{match}"
end