forked from chocolatey-archive/chocolatey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
53 lines (47 loc) · 2.26 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
51
52
53
<Project ToolsVersion="4.0"
DefaultTargets="Go"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GoDependsOn>Setup;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 $(baseDir)test.cmd" />
</Target>
<Target Name="Setup">
<Exec Command="cmd /c $(baseDir)setup.cmd" />
</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" DependsOnTargets="PrepareNuGetFiles">
<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)" />
<!--Exec Command="FOR /F "delims=|" %%I IN ('DIR %systemdrive%\chocolatey\lib\nuget.commandline.* /B /O:D') DO %systemdrive%\chocolatey\lib\%%I\tools\nuget pack "%(NuspecFiles.FullPath)" -NoPackageAnalysis" WorkingDirectory="$(BuildPath)" /-->
<Delete Files="@(FilesToDelete)" />
<RemoveDir Directories="@(DirectoriesToDelete)" />
</Target>
</Project>