Skip to content

Instantly share code, notes, and snippets.

@taylorsmith
Created June 6, 2012 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taylorsmith/2883686 to your computer and use it in GitHub Desktop.
Save taylorsmith/2883686 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment