Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code snippets for the Albacore article
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("ACME")]
[assembly: AssemblyProduct("AlbacoreDemo")]
[assembly: AssemblyCopyright("Wile E. Coyote")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
task :default => [:foo, :bar]
task :foo do
puts "foo"
end
task :bar do
puts "bar"
end
require 'albacore'
task :default => [:msbuild]
msbuild :msbuild do |msb|
msb.properties = { :configuration => :Debug }
msb.targets = [ :Clean, :Build ]
msb.solution = "AlbacoreDemo.sln"
end
mstest :mstest => [:msbuild] do |mstest|
mstest.command = "C:/Program\ Files\ (x86)/Microsoft Visual Studio 10.0/Common7/IDE/mstest.exe"
mstest.assemblies "AlbacoreDemo.Tests/bin/Debug/AlbacoreDemo.Tests.dll"
end
require 'albacore'
require 'version_bumper'
# snip
assemblyinfo :assemblyinfo do |asm|
asm.version = bumper_version.to_s
asm.file_version = bumper_version.to_s
asm.company_name = "ACME"
asm.product_name = "AlbacoreDemo"
asm.copyright = "Wile E. Coyote"
asm.output_file = "AlbacoreDemo/Properties/AssemblyInfo.cs"
end
msbuild :msbuild => [:assemblyinfo] do |msb|
# snip
end
output :output do |out|
out.from 'AlbacoreDemo'
out.to 'deploy'
out.file 'Web.Debug.config', :as => 'Web.config'
out.file 'global.asax'
out.file 'favicon.ico'
['bin', 'content', 'images', 'scripts', 'views'].each do |d|
out.dir d
end
end
Albacore.configure do |config|
config.mstest.command = "C:/Program\ Files\ (x86)/Microsoft Visual Studio 10.0/Common7/IDE/mstest.exe"
config.msbuild.targets = [ :Clean, :Build ]
end
require 'albacore'
require 'version_bumper'
Albacore.configure do |config|
config.mstest.command = "C:/Program\ Files\ (x86)/Microsoft Visual Studio 10.0/Common7/IDE/mstest.exe"
config.msbuild.targets = [ :Clean, :Build ]
end
task :default => [:msbuild, :mstest, :output]
desc "Builds the project using the MSBuild project files"
msbuild :msbuild => [:assemblyinfo] do |msb|
msb.properties = { :configuration => :Debug }
msb.solution = "AlbacoreDemo.sln"
end
desc "Runs the tests in the AlbacoreDemo.Tests project"
mstest :mstest => [:msbuild] do |mstest|
mstest.assemblies "AlbacoreDemo.Tests/bin/Debug/AlbacoreDemo.Tests.dll"
end
desc "Updates AssemblyInfo version number"
assemblyinfo :assemblyinfo do |asm|
asm.version = bumper_version.to_s
asm.file_version = bumper_version.to_s
asm.company_name = "ACME"
asm.product_name = "AlbacoreDemo"
asm.copyright = "Wile E. Coyote"
asm.output_file = "AlbacoreDemo/Properties/AssemblyInfo.cs"
end
desc "Prepares the files needed for deployment"
output :output do |out|
out.from 'AlbacoreDemo'
out.to 'deploy'
out.file 'Web.Debug.config', :as => 'Web.config'
out.file 'global.asax'
out.file 'favicon.ico'
['bin', 'content', 'images', 'scripts', 'views'].each do |d|
out.dir d
end
end
1.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.