Created
May 21, 2012 08:11
-
-
Save ianoxley/2761120 to your computer and use it in GitHub Desktop.
Code snippets for the Albacore article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :default => [:foo, :bar] | |
task :foo do | |
puts "foo" | |
end | |
task :bar do | |
puts "bar" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'albacore' | |
task :default => [:msbuild] | |
msbuild :msbuild do |msb| | |
msb.properties = { :configuration => :Debug } | |
msb.targets = [ :Clean, :Build ] | |
msb.solution = "AlbacoreDemo.sln" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msbuild :msbuild => [:assemblyinfo] do |msb| | |
# snip | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.0.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment