public
Created

  • Download Gist
Rakefile.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
require 'albacore'
require 'coyote/rake'
 
client = "{{ client }}"
root_dir = File.expand_path("#{File.dirname(__FILE__)}")
build_dir = "#{root_dir}/build"
src_dir = "#{root_dir}/src"
solution = "#{src_dir}/#{client}.sln"
release_dir = "#{build_dir}/release"
bin_dir = "#{release_dir}/bin"
package_dir = "#{build_dir}/package"
 
desc "Build all the things!"
task :default => [:build]
 
desc "Build the solution and precompile assets"
task :build => ['solution:build','assets:build']
 
task :package => ['solution:clean','solution:package','solution:zip']
 
namespace :solution do
desc "Builds the solution"
msbuild :build do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "#{solution}"
end
 
msbuild :package do |msb|
msb.targets [:Clean, :Rebuild]
msb.properties = {
:configuration => :Release,
:UseWPP_CopyWebApplication => true,
:PipelineDependsOnBuild => false,
:webprojectoutputdir => "#{release_dir}/",
:outdir => "#{bin_dir}/"
}
msb.solution = "#{src_dir}/#{client}.Umbraco/#{client}.Umbraco.csproj"
end
 
task :clean do
rm_rf build_dir
end
 
zip :zip do |zip|
mkdir package_dir
zip.directories_to_zip "#{release_dir}"
zip.output_file = 'release.zip'
zip.output_path = package_dir
end
end
 
namespace :assets do
desc "Precompiles Sass/CSS and CoffeeScript/JS"
task :build => ['css:build','js:build']
end
 
namespace :css do
desc "Compile CSS and SASS from source"
task :build do
puts "To Do... :(\n"
end
 
desc "Watch CSS source files for changes and recompile automatically"
task :watch do
puts "To Do... :(\n"
end
end
 
namespace :js do
desc "Compile JavaScript and CoffeeScript from source"
coyote :build do |config|
puts "Compiling JavaScript from source...\n"
config.input = "#{src_dir}/#{client}.Umbraco/assets/javascripts/app/application.coffee"
config.output = "#{src_dir}/#{client}.Umbraco/scripts/application.js"
config.options = { :compress => true }
end
 
desc "Watch JS/CS source files for changes and recompile automatically"
coyote :watch do |config|
config.input = "#{src_dir}/#{client}.Umbraco/assets/javascripts/app/application.coffee"
config.output = "#{src_dir}/#{client}.Umbraco/scripts/application.js"
config.options = { :quiet => true }
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.