-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault.ps1
68 lines (54 loc) · 2.31 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
properties {
$resharper_ver = "v5.1"
$xunit_ver = "v1.6"
$base_dir = resolve-path .
$lib_dir = "$base_dir\external"
$thirdparty_dir = "$base_dir\ThirdParty"
$build_dir = "$base_dir\Build"
$buildartifacts_dir = "$build_dir\"
$sln_file = "$base_dir\Source\xUnit.ReSharper.Naming.sln"
$version = "0.5.2."
$tools_dir = "$base_dir\Tools"
$release_dir = "$base_dir\Release"
$release_name = "${version}_X${xunit_ver}_R${resharper_ver}"
}
$assversion = $version
task default -depends Release
task Clean {
remove-item -force -recurse $buildartifacts_dir -ErrorAction SilentlyContinue
remove-item -force -recurse $release_dir\*${release_name}*.* -ErrorAction SilentlyContinue
remove-item -force -recurse $lib_dir\ReSharper\*.* -ErrorAction SilentlyContinue
remove-item -force -recurse $lib_dir\xUnit\*.* -ErrorAction SilentlyContinue
}
task CopyThirdParty -depends Clean {
new-item $lib_dir\ReSharper -itemType directory -ErrorAction SilentlyContinue
new-item $lib_dir\xUnit -itemType directory -ErrorAction SilentlyContinue
copy "$thirdparty_dir\ReSharper_$resharper_ver\*.*" "$lib_dir\ReSharper\"
copy "$thirdparty_dir\xunit_$xunit_ver\*.*" "$lib_dir\xunit\"
}
task Init -depends CopyThirdParty {
. $tools_dir\psake\psake_ext.ps1
$buildver = GetAssemblyBuild("$lib_dir\ReSharper\JetBrains.ReSharper.Psi.dll")
$finalversion = "$version$buildver"
Generate-Assembly-Info `
-file "$base_dir\Source\GlobalAssemblyInfo.cs" `
-title "xUnit.ReSharper.Naming" `
-description "Additional Naming Entities for ReSharper $resharper_ver" `
-product "xUnit.ReSharper.Naming $finalversion" `
-version $finalversion `
-clsCompliant "false" `
-copyright "Copyright © Albert Weinert 2010"
new-item $release_dir -itemType directory -ErrorAction SilentlyContinue
new-item $buildartifacts_dir -itemType directory
}
task Compile -depends Init {
exec { msbuild /t:rebuild "/p:OutDir=$buildartifacts_dir" "/p:Configuration=Release" "/p:Platform=Any CPU" "$sln_file" }
}
task Release -depends Compile {
exec {
& $tools_dir\Zip\zip.exe -9 -A -j `
$release_dir\xUnit.ReSharper.Naming.$release_name.zip `
$build_dir\xUnit.ReSharper.Naming.dll readme.txt `
$lib_dir\xUnit\xUnit.dll
}
}