Created
September 14, 2010 04:52
-
-
Save mikeobrien/578564 to your computer and use it in GitHub Desktop.
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 "rubygems" | |
require "rake/gempackagetask" | |
ReleasePath = "D:/Websites/public.mikeobrien.net/wwwroot/Releases/WcfRestContrib/#{ENV['GO_PIPELINE_LABEL']}" | |
task :default => [:build] | |
desc "Generate assembly info." | |
assemblyinfo :assemblyInfo do |asm| | |
asm.version = ENV["GO_PIPELINE_LABEL"] | |
asm.company_name = "Ultraviolet Catastrophe" | |
asm.product_name = "Wcf Rest Contrib" | |
asm.title = "Wcf Rest Contrib" | |
asm.description = "Goodies for Wcf Rest." | |
asm.copyright = "Copyright (c) 2010 Ultraviolet Catastrophe" | |
asm.output_file = "src/WcfRestContrib/Properties/AssemblyInfo.cs" | |
end | |
desc "Builds the application." | |
msbuild :build => :assemblyInfo do |msb| | |
msb.path_to_command = File.join(ENV['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe') | |
msb.properties :configuration => :Release | |
msb.targets :Clean, :Build | |
msb.solution = "src/WcfRestContrib.sln" | |
end | |
desc "Inits the deploy" | |
task :initDeploy => :build do | |
if !Dir.exists?(ReleasePath) then | |
FileUtils.mkdir_p(ReleasePath) | |
end | |
end | |
desc "Prepares the gem files to be packaged." | |
task :prepareGemFiles => :build do | |
gem = "gem" | |
lib = "#{gem}/files/lib" | |
docs = "#{gem}/files/docs" | |
pkg = "#{gem}/pkg" | |
if Dir.exists?(gem) then | |
FileUtils.rm_rf gem | |
end | |
FileUtils.mkdir_p(lib) | |
FileUtils.mkdir_p(pkg) | |
FileUtils.mkdir_p(docs) | |
Dir.glob("src/WcfRestContrib/bin/Release/*") do |name| | |
FileUtils.cp(name, lib) | |
end | |
Dir.glob("src/docs/**/*") do |name| | |
FileUtils.cp(name, docs) | |
end | |
end | |
desc "Creates gem" | |
task :createGem => :prepareGemFiles do | |
FileUtils.cd("gem/files") do | |
spec = Gem::Specification.new do |spec| | |
spec.platform = Gem::Platform::RUBY | |
spec.summary = "Goodies for .NET WCF Rest" | |
spec.name = "wcfrestcontrib" | |
spec.version = "#{ENV['GO_PIPELINE_LABEL']}" | |
spec.files = Dir["lib/**/*"] + Dir["docs/**/*"] | |
spec.authors = ["Mike O'Brien"] | |
spec.homepage = "http://github.com/mikeobrien/WcfRestContrib" | |
spec.description = "The WCF REST Contrib library adds functionality to the current .NET WCF REST implementation." | |
end | |
Rake::GemPackageTask.new(spec) do |package| | |
package.package_dir = "../pkg" | |
end | |
Rake::Task["package"].invoke | |
end | |
end | |
desc "Push the gem to ruby gems" | |
task :pushGem => :createGem do | |
result = system("gem", "push", "gem/pkg/wcfrestcontrib-#{ENV['GO_PIPELINE_LABEL']}.gem") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment