Class: Bozo::Compilers::WebProject2008

Inherits:
Project
  • Object
show all
Defined in:
lib/bozo/compilers/msbuild.rb

Instance Method Summary collapse

Methods inherited from Project

#clean, #framework_version, #generate_args, #initialize, #location, #windowsize_path

Constructor Details

This class inherits a constructor from Bozo::Compilers::Project

Instance Method Details

#build(configuration) ⇒ Object



240
241
242
243
244
# File 'lib/bozo/compilers/msbuild.rb', line 240

def build(configuration)
  super

  zip_website if configuration[:websites_as_zip]
end

#populate_config(config) ⇒ Object



266
267
268
269
270
271
272
273
274
275
# File 'lib/bozo/compilers/msbuild.rb', line 266

def populate_config(config)
  config[:targets] << :'ResolveReferences'
  config[:targets] << :'_CopyWebApplication'

  config[:properties][:OutDir] = location + '/bin/'
  config[:properties][:WebProjectOutputDir] = windowsize_path location
  config[:properties][:_DebugSymbolsProduced] = false

  config[:properties][:solutiondir] = windowsize_path(File.expand_path('.') + '//')
end

#zip_location_dir(zip_file_name) ⇒ Object



254
255
256
257
258
259
260
261
262
263
264
# File 'lib/bozo/compilers/msbuild.rb', line 254

def zip_location_dir(zip_file_name)
  zip_path = location + "/#{zip_file_name}"

  Zip::ZipFile.open(zip_path, Zip::ZipFile::CREATE) do |zipfile|
    Dir["#{location}/**/**"].each do |file|
      zipfile.add(file.sub(location + '/', ''), file)
    end
  end

  zip_path
end

#zip_websiteObject



246
247
248
249
250
251
252
# File 'lib/bozo/compilers/msbuild.rb', line 246

def zip_website
  zip_file = zip_location_dir 'Site.zip'

  Dir["#{location}/**/**"].reject { |f| f == zip_file }.each do |file|
    FileUtils.rm_rf file
  end
end