-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.targets
121 lines (96 loc) · 4.83 KB
/
Module.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<Project InitialTargets="GetModuleItems" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- A module is a special MSBuild project file that describes
a group of related resources that are to be build.
It may contain the following items:
- NestedModule: A child module.
- CSharpProject: Path of a C# project file.
- TestAssembly: Path of a compiled test assembly to run.
- DocumentedAssembly: Path of an assembly with XML documentation to include.
- Binary: Path of a file to copy into the build\target\bin dir.
- Document: Path of a file to copy into the build\target\docs dir.
- Extra: Path of a file to copy into the build\target\extras dir.
- File: Path of a file to copy into the build\target dir.
(Binary, Document and File may have optional Folder metadata
to specify a relative destination path within the respective dir.)
It can also add additional build actions by overriding the BeforeBuild and AfterBuild targets.
-->
<PropertyGroup>
<LibsDir>$(RootDir)\libs</LibsDir>
<SourceDir>$(RootDir)\src</SourceDir>
<BuildDir>$(RootDir)\build</BuildDir>
<BuildReportsDir>$(BuildDir)\reports</BuildReportsDir>
<BuildReleaseDir>$(BuildDir)\release</BuildReleaseDir>
<BuildTempDir>$(BuildDir)\temp</BuildTempDir>
<TargetDir>$(BuildDir)\target</TargetDir>
<TargetBinDir>$(TargetDir)\bin</TargetBinDir>
<TargetDocsDir>$(TargetDir)\docs</TargetDocsDir>
<TargetExtrasDir>$(TargetDir)\extras</TargetExtrasDir>
<MSBuildCommunityTasksPath>$(LibsDir)\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
<NCoverExplorerPath>$(LibsDir)\NCoverExplorer</NCoverExplorerPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets"/>
<UsingTask AssemblyFile="$(NCoverExplorerPath)\NCoverExplorer.MSBuildTasks.dll" TaskName="NCoverExplorer.MSBuildTasks.NCoverExplorer" />
<Target Name="GetModuleItems"
Outputs="@(ModuleItem)">
<Error Text="RootDir property must be defined."
Condition="'$(RootDir)'==''" />
<MSBuild Projects="@(NestedModule)"
Targets="GetModuleItems"
Properties="RootDir=$(RootDir)"
Condition="'@(NestedModule)'!=''">
<Output TaskParameter="TargetOutputs" ItemName="NestedModuleItem" />
</MSBuild>
<CreateItem Include="@(NestedModuleItem)"
Condition="'@(NestedModuleItem)'!=''">
<Output TaskParameter="Include" ItemName="%(NestedModuleItem.ItemName)" />
</CreateItem>
<CreateItem Include="@(CSharpProject->'%(FullPath)')"
AdditionalMetadata="ItemName=CSharpProject">
<Output TaskParameter="Include" ItemName="ModuleItem" />
</CreateItem>
<CreateItem Include="@(TestAssembly->'%(FullPath)')"
AdditionalMetadata="ItemName=TestAssembly">
<Output TaskParameter="Include" ItemName="ModuleItem" />
</CreateItem>
<CreateItem Include="@(DocumentedAssembly->'%(FullPath)')"
AdditionalMetadata="ItemName=DocumentedAssembly">
<Output TaskParameter="Include" ItemName="ModuleItem" />
</CreateItem>
<CreateItem Include="@(Binary->'%(FullPath)')"
AdditionalMetadata="ItemName=Binary">
<Output TaskParameter="Include" ItemName="ModuleItem" />
</CreateItem>
<CreateItem Include="@(Document->'%(FullPath)')"
AdditionalMetadata="ItemName=Document">
<Output TaskParameter="Include" ItemName="ModuleItem" />
</CreateItem>
<CreateItem Include="@(Extra->'%(FullPath)')"
AdditionalMetadata="ItemName=Extra">
<Output TaskParameter="Include" ItemName="ModuleItem" />
</CreateItem>
<CreateItem Include="@(File->'%(FullPath)')"
AdditionalMetadata="ItemName=File">
<Output TaskParameter="Include" ItemName="ModuleItem" />
</CreateItem>
</Target>
<Target Name="RecursiveBeforeBuild" DependsOnTargets="BeforeBuild;_NestedRecursiveBeforeBuild"/>
<Target Name="RecursiveAfterBuild" DependsOnTargets="_NestedRecursiveAfterBuild;AfterBuild"/>
<Target Name="_NestedRecursiveBeforeBuild">
<MSBuild Projects="@(NestedModule)"
Targets="RecursiveBeforeBuild"
Properties="RootDir=$(RootDir)"
Condition="'@(NestedModule)'!=''" />
</Target>
<Target Name="_NestedRecursiveAfterBuild">
<MSBuild Projects="@(NestedModule)"
Targets="RecursiveAfterBuild"
Properties="RootDir=$(RootDir)"
Condition="'@(NestedModule)'!=''" />
</Target>
<!-- Override this target to add custom before build actions -->
<Target Name="BeforeBuild">
</Target>
<!-- Override this target to add custom after build actions -->
<Target Name="AfterBuild">
</Target>
</Project>