-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault.ps1
86 lines (69 loc) · 2.57 KB
/
default.ps1
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Include ".\Tools\psake\psake_ext.ps1"
properties {
$base_dir = resolve-path .
$revision = Generate-Revision(2010)
$lib_dir = "$base_dir\external"
$build_dir = "$base_dir\lib"
$buildartifacts_dir = "$build_dir\"
$sln_file = "$base_dir\Source\FluentMetadata.sln"
$version = "0.5.1.$revision"
$tools_dir = "$base_dir\Tools"
$release_dir = "$base_dir\Release"
}
task default -depends Test
task Clean {
remove-item -force -recurse $buildartifacts_dir -ErrorAction SilentlyContinue
remove-item -force -recurse $release_dir -ErrorAction SilentlyContinue
}
task Init -depends Clean {
Generate-Assembly-Info `
-file "$base_dir\Source\GlobalAssemblyInfo.cs" `
-title "FluentMetadata $version" `
-description "A Metadata Framework for ASP.MVC, FluentNHibernate and Entity Framework CodeFirst" `
-product "FluentMetadata $version" `
-version $version `
-clsCompliant "false" `
-copyright "Copyright © Albert Weinert 2010"
}
task Compile -depends Init {
new-item $buildartifacts_dir -itemType directory
exec { msbuild /t:Rebuild /verbosity:minimal "/p:OutDir=$buildartifacts_dir" "/p:Platform=Any CPU" "/p:Configuration=Release" "$sln_file" }
copy-item readme.txt $build_dir\readme.txt
}
task Test20 -depends Compile {
exec { & $tools_dir\xUnit\xunit.console.exe $build_dir\FluentMetadata.Core.Specs.dll }
exec { & $tools_dir\xUnit\xunit.console.exe $build_dir\FluentMetadata.MVC.Specs.dll }
}
task Test40 -depends Test20 {
exec { & $tools_dir\xUnit\xunit.console.clr4.exe $build_dir\FluentMetadata.EntityFramework.Specs.dll }
}
task Test -depends Test40
task CleanGem -ContinueOnError {
Remove-Item .\*.gem
exec { gem uninstall fluentmetadata -a -x }
}
task Gem -depends CleanGem, Compile {
$version | out-file .\VERSION -encoding ASCII
exec { gem build .\FluentMetadata.gemspec }
exec { gem install fluentmetadata }
}
task Release -depends Test, Gem {
new-item $release_dir -itemType directory
exec {
& $tools_dir\Zip\zip.exe -9 -A -j `
$release_dir\FluentMetadata.$version.zip `
$build_dir\readme.txt `
$build_dir\FluentMetadata.Core.dll `
$build_dir\FluentMetadata.MVC.dll `
$build_dir\FluentMetadata.FluentNHibernate.dll `
$build_dir\FluentMetadata.EntityFramework.dll
}
}
task Publish -depends Release {
exec { & $tools_dir\WinSCP\winscp.com /command `
"open [email protected]" `
"cd /wikiupload/projects/fluentmetadata/" `
"put $release_dir\FluentMetadata.$version.zip" `
"exit"
}
}