-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile.rb
65 lines (54 loc) · 1.7 KB
/
Rakefile.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env ruby
require 'albacore'
require 'fileutils'
CONFIG = 'Debug'
RAKE_DIR = File.expand_path(File.dirname(__FILE__))
SOLUTION_DIR = RAKE_DIR + "/src"
SRC_DIR = SOLUTION_DIR + "/src/"
SOLUTION_FILE = 'JaySmith.DomainEvents.sln'
NUGET = SOLUTION_DIR + "/.nuget/nuget.exe"
# --------------------------------------------------------------------------------------------
task :default => ['build:msbuild']
task :package => ['package:packall']
task :push => ['package:pushall']
namespace :build do
msbuild :msbuild, [:targets] do |msb, args|
args.with_defaults(:targets => :Build)
msb.properties :configuration => CONFIG
msb.targets args[:targets]
msb.solution = "#{SOLUTION_DIR}/#{SOLUTION_FILE}"
end
end
namespace :package do
def create_packs()
sh 'src/.nuget/nuget.exe pack src/JaySmith.DomainEvents/JaySmith.DomainEvents.csproj -o pack'
sh 'src/.nuget/nuget.exe pack src/JaySmith.DomainEvents.StructureMap/JaySmith.DomainEvents.StructureMap.csproj -o pack'
end
task :packall => [ :clean ] do
Dir.mkdir('pack')
create_packs
Dir.glob('pack/*') { |file| FileUtils.move(file,'nuget/') }
Dir.rmdir('pack')
end
task :pushall => [ :clean ] do
Dir.mkdir('pack')
create_packs
Dir.chdir('pack')
Dir.glob('*').each do |file|
sh '../src/.nuget/nuget.exe push ' + file
FileUtils.move(file,'../nuget/')
end
Dir.chdir('..')
Dir.rmdir('pack')
end
task :clean do
if Dir.exists? 'pack'
Dir.chdir('pack')
Dir.glob('*').each do |file|
rm file
end
Dir.chdir('..')
Dir.rmdir('pack')
end
end
end