Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added buildsupport as a submodule

  • Loading branch information...
commit e9a439decfffa686c3ffa3755f89f8bf6fe8f903 1 parent 66a7acb
@joshuaflanagan joshuaflanagan authored
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "buildsupport"]
+ path = buildsupport
+ url = git://github.com/DarthFubuMVC/buildsupport.git
View
112 build_support/BuildUtils.rb
@@ -1,112 +0,0 @@
-require 'erb'
-
-class NUnitRunner
- include FileTest
-
- def initialize(paths)
- @sourceDir = paths.fetch(:source, 'source')
- @resultsDir = paths.fetch(:results, 'results')
- @compilePlatform = paths.fetch(:platform, '')
- @compileTarget = paths.fetch(:compilemode, 'debug')
-
- @nunitExe = File.join(Dir.glob("src/packages/NUnit*").first, "tools", "nunit-console#{(@compilePlatform.empty? ? '' : "-#{@compilePlatform}")}.exe").gsub('/','\\') + ' /nothread'
- end
-
- def executeTests(assemblies)
- Dir.mkdir @resultsDir unless exists?(@resultsDir)
-
- assemblies.each do |assem|
- file = File.expand_path("#{@sourceDir}/#{assem}/bin/#{@compileTarget}/#{assem}.dll")
- sh "#{@nunitExe} \"#{file}\""
- end
- end
-end
-
-class MSBuildRunner
- def self.compile(attributes)
- compileTarget = attributes.fetch(:compilemode, 'debug')
- solutionFile = attributes[:solutionfile]
-
- attributes[:projFile] = solutionFile
- attributes[:properties] ||= []
- attributes[:properties] << "Configuration=#{compileTarget}"
- attributes[:extraSwitches] = ["maxcpucount:2", "v:m", "t:rebuild"]
-
- self.runProjFile(attributes);
- end
-
- def self.runProjFile(attributes)
- version = attributes.fetch(:clrversion, 'v4.0.30319')
- compileTarget = attributes.fetch(:compilemode, 'debug')
- projFile = attributes[:projFile]
-
- frameworkDir = File.join(ENV['windir'].dup, 'Microsoft.NET', 'Framework', version)
- msbuildFile = File.join(frameworkDir, 'msbuild.exe')
-
- properties = attributes.fetch(:properties, [])
-
- switchesValue = ""
-
- properties.each do |prop|
- switchesValue += " /property:#{prop}"
- end
-
- extraSwitches = attributes.fetch(:extraSwitches, [])
-
- extraSwitches.each do |switch|
- switchesValue += " /#{switch}"
- end
-
- targets = attributes.fetch(:targets, [])
- targetsValue = ""
- targets.each do |target|
- targetsValue += " /t:#{target}"
- end
-
- sh "#{msbuildFile} #{projFile} #{targetsValue} #{switchesValue}"
- end
-end
-
-class AspNetCompilerRunner
- def self.compile(attributes)
-
- webPhysDir = attributes.fetch(:webPhysDir, '')
- webVirDir = attributes.fetch(:webVirDir, 'This_Value_Is_Not_Used')
-
- frameworkDir = File.join(ENV['windir'].dup, 'Microsoft.NET', 'Framework', 'v4.0.30319')
- aspNetCompiler = File.join(frameworkDir, 'aspnet_compiler.exe')
-
- sh "#{aspNetCompiler} -nologo -errorstack -c -p #{webPhysDir} -v #{webVirDir}"
- end
-end
-
-class AsmInfoBuilder
- attr_reader :buildnumber
-
- def initialize(baseVersion, properties)
- @properties = properties;
-
- @buildnumber = baseVersion + (ENV["CCNetLabel"].nil? ? '0' : ENV["CCNetLabel"].to_s)
- @properties['Version'] = @properties['InformationalVersion'] = buildnumber;
- end
-
-
-
- def write(file)
- template = %q{
-using System;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-<% @properties.each {|k, v| %>
-[assembly: Assembly<%=k%>Attribute("<%=v%>")]
-<% } %>
- }.gsub(/^ /, '')
-
- erb = ERB.new(template, 0, "%<>")
-
- File.open(file, 'w') do |file|
- file.puts erb.result(binding)
- end
- end
-end
View
30 build_support/Ruby_Not_Installed.txt
@@ -1,30 +0,0 @@
-
-**********************************************
-WE'RE SORRY!
-Ruby not installed?
-**********************************************
-
-It appears you do not have Ruby installed.
-This project uses the "Rake" build system from Ruby.
-
-If you *DO* have Ruby installed, please make sure the
-Ruby\bin folder is in your PATH.
-
-If you *DON'T* have Ruby installed then, in order to
-run "Rake", please perform the following steps:
-
- 1.) Download and install Ruby 1.8.6 (or later --
- "1.8.6. One-Click installer recommended for Windows)
-
- - Main Download URL:
- http://www.ruby-lang.org/en/downloads/
-
- - 1.8.6 One-Click installer:
- http://rubyforge.org/frs/download.php/29263/ruby186-26.exe
- (md5: 00540689d1039964bc8d844b2b0c7db6)
-
-
- 2.) Install the Rake "Gem" and related "Gems" by running
- InstallGems.bat in the same folder as this Build.bat file
-
-**********************************************
View
64 build_support/nugs.rb
@@ -1,64 +0,0 @@
-namespace :nug do
- @nuget = "lib/nuget.exe"
- @nugroot = File.expand_path("/nugs")
- @dependencies = ['FubuCore','Bottles', 'FubuLocalization']
-
- desc "Build the nuget package"
- task :build do
- FileList["packaging/nuget/*.nuspec"].each do |spec|
- sh "#{@nuget} pack #{spec} -o #{ARTIFACTS} -Version #{BUILD_NUMBER} -Symbols"
- end
- end
-
- desc "pulls new NuGet updates from your local machine"
- task :pull, [:location] do |t, args|
- args.with_defaults(:location => 'local')
- location = args[:location]
-
- @dependencies.each do |f|
- sh "#{@nuget} install #{f} /Source #{@nugroot} /ExcludeVersion /OutputDirectory .\\lib"
- end
- end
-
- desc "pushes new NuGet udates to your local machine"
- task :push, [:location] => [:build] do |t, args|
- args.with_defaults(:location => 'local')
- location = args[:location]
-
- FileUtils.makedirs(@nugroot)
-
- Dir["#{ARTIFACTS}/*.nupkg"].each do |fn|
- puts "Copying package #{fn} to #{@nugroot}"
- FileUtils.cp fn, @nugroot
- end
- end
-
- def unzip_file (file, destination)
- require 'rubygems'
- require 'zip/zip'
- Zip::ZipFile.open(file) { |zip_file|
- zip_file.each { |f|
- f_path=File.join(destination, f.name)
- FileUtils.mkdir_p(File.dirname(f_path))
- zip_file.extract(f, f_path) unless File.exist?(f_path)
- }
- }
- end
-
- desc "Pushes nuget packages to the official feed"
- task :release do
- require 'open-uri'
-
- mkdir_p 'packaging/release'
- rm_r Dir.glob("packaging/release/*.*")
-
- artifact_url = "http://teamcity.codebetter.com/guestAuth/repository/downloadAll/#{@teamcity_build_id}/.lastSuccessful/artifacts.zip"
- artifact = open(artifact_url)
- unzip_file artifact.path, "packaging/release"
- FileList['packaging/release/*.nupkg'].exclude(".symbols.nupkg").each do |nupkg|
- sh "#{@nuget} push #{nupkg}" do |ok, res|
- puts "May not have published #{nupkg}" unless ok
- end
- end
- end
-end
1  buildsupport
@@ -0,0 +1 @@
+Subproject commit d1ca845b09c4262293d2b6aa2823e670a651b0da
View
8 rakefile.rb
@@ -1,6 +1,8 @@
COMPILE_TARGET = ENV['config'].nil? ? "debug" : ENV['config']
-require File.dirname(__FILE__) + "/build_support/BuildUtils.rb"
-require File.dirname(__FILE__) + "/build_support/nugs.rb"
+
+buildsupportfiles = Dir["#{File.dirname(__FILE__)}/buildsupport/*.rb"]
+raise "Run `git submodule update --init` to populate your buildsupport folder." unless buildsupportfiles.any?
+buildsupportfiles.each { |ext| load ext }
include FileTest
require 'albacore'
@@ -25,7 +27,7 @@
task :default => [:compile, :unit_test]
desc "Target used for the CI server"
-task :ci => [:default,:package,"nug:build"]
+task :ci => [:default,:package,"nuget:build"]
desc "Update the version information for the build"
assemblyinfo :version do |asm|
Please sign in to comment.
Something went wrong with that request. Please try again.