forked from chocolatey-archive/chocolatey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
50 lines (44 loc) · 1.97 KB
/
build.proj
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
<Project ToolsVersion="4.0"
DefaultTargets="Go"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /-->
<PropertyGroup>
<GoDependsOn>Tests;PrepareNuGetFiles;Package</GoDependsOn>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<BuildDirectory>_packaged_output\</BuildDirectory>
<BuildPath>$(MSBuildProjectDirectory)\$(BuildDirectory)</BuildPath>
<NuGetDirectory>$(MSBuildProjectDirectory)\nuget</NuGetDirectory>
<NuGetFilesDirectory>$(MSBuildProjectDirectory)\src</NuGetFilesDirectory>
</PropertyGroup>
<Target Name="Go" DependsOnTargets="$(GoDependsOn)" />
<Target Name="Tests">
<Exec Command="cmd /c pester"/>
</Target>
<Target Name="PrepareNuGetFiles">
<ItemGroup>
<NuGetFiles Include="$(NuGetDirectory)\**\*" />
<NuGetFilesToPack Include="$(NuGetFilesDirectory)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(NuGetFiles)"
DestinationFiles="@(NuGetFiles->'$(BuildPath)\nuget\%(RecursiveDir)%(Filename)%(Extension)')"
Retries="3"
RetryDelayMilliseconds="300"
/>
<Copy SourceFiles="@(NuGetFilesToPack)"
DestinationFiles="@(NuGetFilesToPack->'$(BuildPath)\nuget\tools\chocolateyInstall\%(RecursiveDir)%(Filename)%(Extension)')"
Retries="3"
RetryDelayMilliseconds="300"
/>
</Target>
<Target Name="Package">
<ItemGroup>
<NuspecFiles Include="$(BuildPath)**\*nuspec" />
<FilesToDelete Exclude="$(BuildPath)\**\*.nupkg" Include="$(BuildPath)\**\*" />
<DirectoriesToDelete Include="$(BuildPath)\nuget" />
</ItemGroup>
<Exec Command="nuget pack "%(NuspecFiles.FullPath)" -NoPackageAnalysis" WorkingDirectory="$(BuildPath)" />
<Delete Files="@(FilesToDelete)" />
<RemoveDir Directories="@(DirectoriesToDelete)" />
</Target>
</Project>