-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
71 lines (66 loc) · 4.7 KB
/
Directory.Build.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
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- 部分属性还未赋值, 因此放到属性最后面 -->
<Import Project="CustomProperty.props"/>
<!-- Config README.md file source -->
<Choose>
<When Condition="Exists('README.md')">
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<None Condition="Exists('$(RepositoryDirectory)README.md')" Include="$(RepositoryDirectory)README.md" Pack="true" PackagePath="" />
</ItemGroup>
</Otherwise>
</Choose>
<!-- Config LICENSE file source -->
<Choose>
<When Condition="Exists('LICENSE')">
<ItemGroup>
<None Include="LICENSE" Pack="true" PackagePath="" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<None Condition="Exists('$(RepositoryDirectory)LICENSE')" Include="$(RepositoryDirectory)LICENSE" Pack="true" PackagePath="" />
</ItemGroup>
</Otherwise>
</Choose>
<!-- 将属性值打印到日志, 这样你就知道这个值大概表示什么了 -->
<Target Condition="'$(TargetFramework)' != ''" Name="Test" BeforeTargets="$(LogTargets)">
<!--<Message Importance="high" Text="AssemblyName: $(AssemblyName)" />-->
<!--<Message Importance="high" Text="RootNamespace: $(RootNamespace)" />-->
<Message Importance="high" Text="TargetFramework: $(TargetFramework)" />
<Message Importance="high" Text="TargetFrameworkVersion: '$(TargetFrameworkVersion)'" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="--------------------------------------------------------------------------------" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] LogTargets: $(LogTargets)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] MsgLogFile: $(MsgLogFile)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] SolutionDir: $(SolutionDir)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] ProjectGuid: $(ProjectGuid)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] ProjectName: $(ProjectName)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] MSBuildProjectName: $(MSBuildProjectName)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] ProjectPriFileName: $(ProjectPriFileName)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] AssemblyName: $(AssemblyName)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] RootNamespace: $(RootNamespace)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] PlatformTarget: $(PlatformTarget)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] RepositoryUrl: $(RepositoryUrl)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] PackageId: $(PackageId)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] PackageTags: $(PackageTags)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] Platform: $(Platform)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] PlatformID: $(PlatformID)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] PlatformName: $(PlatformName)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] PlatformTarget: $(PlatformTarget)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] Version: $(Version)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] VersionPrefix: $(VersionPrefix)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] AssemblyVersion: $(AssemblyVersion)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] FileVersion: $(FileVersion)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] Optimize: $(Optimize)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] TargetFramework: $(TargetFramework)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] TargetFrameworkVersion: $(TargetFrameworkVersion)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] RuntimeIdentifier: $(RuntimeIdentifier)" />
<WriteLinesToFile File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] RuntimeIdentifiers: $(RuntimeIdentifiers)" />
<WriteLinesToFile Condition="Exists('LICENSE')" File="$(MsgLogFile)" Lines="$(NowTime) [$(Configuration)] Exists LICENSE file" />
</Target>
</Project>