if we cannot https we must http for nuget

This commit is contained in:
Tommy Parnell
2015-06-19 22:09:53 -05:00
parent 263d7e664b
commit 29582a0a9a
2 changed files with 12 additions and 4 deletions

View File

@@ -20,9 +20,11 @@ task :build => [:compile]
desc 'Run the tests' desc 'Run the tests'
task :test => [:nunit] task :test => [:nunit]
desc 'run Static analysis linters'
task :lint => [:build, :cs_lint]
desc 'Retrieve, Build, Test' desc 'Retrieve, Build, Test'
task :preflight => [:clean, :retrieve, :build, :test, :cs_lint] task :preflight => [:clean, :retrieve, :build, :test, :lint]
desc 'cleans up artifacts' desc 'cleans up artifacts'
task :clean do task :clean do
@@ -46,8 +48,7 @@ test_runner :nunit do |tests|
tests.exe = "packages/NUnit.Runners.2.6.4/tools/nunit-console.exe" # executable to run tests with tests.exe = "packages/NUnit.Runners.2.6.4/tools/nunit-console.exe" # executable to run tests with
end end
desc 'run static analysis' task :cs_lint do
task :cs_lint => :build do
unless Dir.exists?('output') unless Dir.exists?('output')
Dir.mkdir('output') Dir.mkdir('output')

View File

@@ -7,10 +7,17 @@ namespace :tools do
if !FileTest.exist?("#{NUGET}/nuget.exe") if !FileTest.exist?("#{NUGET}/nuget.exe")
puts 'Downloading nuget from nuget.org' puts 'Downloading nuget from nuget.org'
begin
FileUtils.mkdir_p("#{NUGET}") FileUtils.mkdir_p("#{NUGET}")
File.open("#{NUGET}/nuget.exe", "wb") do |file| File.open("#{NUGET}/nuget.exe", "wb") do |file|
file.write open('https://nuget.org/nuget.exe').read file.write open('https://nuget.org/nuget.exe').read
end end
rescue
FileUtils.rm_rf("#{NUGET}/nuget.exe")
File.open("#{NUGET}/nuget.exe", "wb") do |file|
file.write open('http://nuget.org/nuget.exe').read
end
end
end end
end end