forked from robv8r/resharper-annotations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.proj
60 lines (53 loc) · 2.65 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
54
55
56
57
58
59
60
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Rebuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputDirectory>bin</OutputDirectory>
<Version>1.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<NuSpecFiles Include="src\*.nuspec" />
<XmlAnnotationFiles Include="src\annotations\**\*.xml" />
</ItemGroup>
<Target Name="Clean">
<ItemGroup>
<_FilesToDelete Include="$(OutputDirectory)\**\*.*"/>
</ItemGroup>
<Delete Files="@(_FilesToDelete)" />
<ItemGroup>
<_FoldersContainingFoldersToDelete Include="$([System.IO.Directory]::GetDirectories("$(MSBuildProjectDirectory)", '$(OutputDirectory)', System.IO.SearchOption.AllDirectories))" />
<_FoldersToDelete Include="$([System.IO.Directory]::GetDirectories("%(_FoldersContainingFoldersToDelete.FullPath)", '*'))" Condition=" '@(_FoldersContainingFoldersToDelete)' != '' " />
</ItemGroup>
<Message Importance="high" Text="@(_FoldersContainingFoldersToDelete)" />
<RemoveDir Directories="@(_FoldersToDelete)" />
</Target>
<Target Name="Build">
<MakeDir Directories="$(OutputDirectory)"/>
<DownloadFile Condition="!EXISTS('$(OutputDirectory)\NuGet.exe')" Address="http://build.nuget.org/NuGet.exe" FileName="$(OutputDirectory)\NuGet.exe" />
<Exec
Command=""$(OutputDirectory)\NuGet.exe" pack -Properties "version=$(Version)" -OutputDirectory "$(OutputDirectory)" "%(NuSpecFiles.FullPath)"" />
<Delete Files="$(OutputDirectory)\NuGet.exe" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
<Target Name="SortXmlSources" Outputs="%(XmlAnnotationFiles.Identity)">
<XslTransformation
OutputPaths="%(XmlAnnotationFiles.RelativeDir)sorted.%(XmlAnnotationFiles.FileName).xml"
XmlInputPaths="%(XmlAnnotationFiles.Identity)"
XslInputPath="src\xslt\sort.xslt" />
<Move SourceFiles="%(XmlAnnotationFiles.RelativeDir)sorted.%(XmlAnnotationFiles.FileName).xml" DestinationFiles="%(XmlAnnotationFiles.Identity)" />
</Target>
<UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll" >
<ParameterGroup>
<Address ParameterType="System.String" Required="true"/>
<FileName ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System" />
<Code Type="Fragment" Language="cs">
<![CDATA[
new System.Net.WebClient().DownloadFile(Address, FileName);
]]>
</Code>
</Task>
</UsingTask>
</Project>