This repository has been archived by the owner on Oct 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ClariusLabs.targets
59 lines (51 loc) · 2.71 KB
/
ClariusLabs.targets
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- VS seems to keep adding this import automatically. Maybe add it via project template instead -->
<!--<Import Project="$(SolutionDir).nuget\nuget.targets" />-->
<Target Name="CopyNuSpec" BeforeTargets="Build" Condition="$(NuGet) == 'true'">
<ItemGroup>
<NuSpec Include="**\*.nuspec" />
</ItemGroup>
<Copy SourceFiles="@(NuSpec)" DestinationFolder="$(PackageRoot)" ContinueOnError="false" />
</Target>
<Target Name="PrepareNuGet" AfterTargets="Build" Condition="$(NuGet) == 'true'">
<ItemGroup>
<SymbolSource Include="**\*.cs" Exclude="bin\**\*.cs">
<Visible>False</Visible>
</SymbolSource>
<SymbolSource Include="**\*.xaml" Exclude="bin\**\*.xaml">
<Visible>False</Visible>
</SymbolSource>
<SymbolSource Include="$(IntermediateOutputPath)**\*.cs">
<Visible>False</Visible>
</SymbolSource>
</ItemGroup>
<Copy SourceFiles="@(SymbolSource)"
DestinationFiles="@(SymbolSource->'$(PackageRoot)src\%(RecursiveDir)%(Filename)%(Extension)')"
ContinueOnError="false"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" />
<Copy SourceFiles="$(SolutionDir)Src\GlobalAssemblyInfo.cs"
DestinationFiles="$(PackageRoot)src\Properties\GlobalAssemblyInfo.cs"
ContinueOnError="false"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" />
<!-- Remove output binaries that shouldn't be included in the package -->
<ItemGroup>
<NonPrimaryAssembly Include="@(FileWrites)" Exclude="@(MainAssembly);@(_DebugSymbolsOutputPath)" />
</ItemGroup>
<Delete Files="@(NonPrimaryAssembly)" ContinueOnError="false" />
</Target>
<Target Name="AfterClean" AfterTargets="Clean" Condition="$(NuGet) == 'true'">
<ItemGroup>
<FileToClean Include="$(PackageRoot)**\*.*" />
<FileToClean Include="$(PackageRoot)*.nuspec" />
</ItemGroup>
<Delete Files="@(FileToClean)" ContinueOnError="true" TreatErrorsAsWarnings="true" />
<RemoveDir Directories="$(PackageRoot)lib;$(PackageRoot)src" ContinueOnError="true" />
</Target>
</Project>