-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.props
76 lines (68 loc) · 4.19 KB
/
Directory.Build.props
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
<Project>
<Import Project="Version.props" />
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<!--统一所有项目输出目录-->
<BaseOutputPath>$(SolutionDir)Output\bin\$(Configuration)\$(TargetFramework)</BaseOutputPath>
<OutputPath>$(SolutionDir)Output\bin\$(Configuration)\$(TargetFramework)\$(MSBuildProjectName)</OutputPath>
<PackageOutputPath>$(OutputPath)</PackageOutputPath>
<BaseIntermediateOutputPath>$(SolutionDir)Output\obj\$(Configuration)\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<!--<IntermediateOutputPath>$(SolutionDir)Output\obj\$(Configuration)\$(MSBuildProjectName)</IntermediateOutputPath>-->
<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Platforms>AnyCPU;x64;x86</Platforms>
<LangVersion>latest</LangVersion>
<!--指示编译器是否应为相同的输入产生相同的程序集-->
<Deterministic>true</Deterministic>
<WarningLevel>4</WarningLevel>
<Nullable>annotations</Nullable>
<SatelliteResourceLanguages>zh-Hans</SatelliteResourceLanguages>
<ProduceReferenceAssemblie>false</ProduceReferenceAssemblie>
<!--Nuget包说明配置 $(MSBuildToolsPath)-->
<PackageId>$(MSBuildProjectName)</PackageId>
<Authors>写代码的厨子</Authors>
<Company>CookCSharp</Company>
<Product>$(MSBuildProjectName)</Product>
<Title>$(MSBuildProjectName)</Title>
<Description>基于.NTE8.0的工具箱</Description>
<Copyright>Copyright © 2022 CookCSharp. All rights reserved.</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageTags>windows,desktop,toolbox</PackageTags>
<RepositoryUrl>https://gitee.com/cook-csharp/$(MSBuildProjectName)</RepositoryUrl>
<PackageProjectUrl>https://github.com/chancezheng/CookPopularControl</PackageProjectUrl>
<PackageReleaseNotes>desktop toolkit</PackageReleaseNotes>
</PropertyGroup>
<Target Name="RemoveWpfTempFolder" AfterTargets="PostBuildEvent">
<Exec Command="FOR /D %%G in ("$(MSBuildThisFileDirectory)Output\bin\$(Configuration)\$(TargetFramework)\*_*_wpftmp") DO RMDIR /S /Q "%%~G"" />
</Target>
<!--将引用包输出到指定目录-->
<!--<ItemDefinitionGroup Condition="$(Configuration) == Release">
<ReferenceCopyLocalPaths>
<DestinationSubDirectory>$(MSBuildProjectName)\</DestinationSubDirectory>
</ReferenceCopyLocalPaths>
</ItemDefinitionGroup>-->
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="$(Configuration) == Release and $(TargetName) != 'ProcessTools'">
<!--<CreateItem Include="$(TargetDir)$(TargetName)*.*" Condition="$(TargetName) == 'AppHostPatcher'">
<Output TaskParameter="Include" ItemName="MoveAppHostPatcherFilesAfterBuild" />
</CreateItem>
<Move SourceFiles="@(MoveAppHostPatcherFilesAfterBuild)" DestinationFolder="$(TargetDir)$(MSBuildProjectName)" />-->
<!--<CreateItem Include="$(TargetDir)$(TargetName)*.*" Exclude="$(TargetDir)$(TargetName).exe" Condition="$(TargetName) != 'AppHostPatcher'">
<Output TaskParameter="Include" ItemName="MoveFilesAfterBuild" />
</CreateItem>
<Move SourceFiles="@(MoveFilesAfterBuild)" DestinationFolder="$(TargetDir)$(MSBuildProjectName)" />-->
<CreateItem Include="$(TargetDir)$(TargetName)*.exe" Condition="$(TargetName) != 'AppHostPatcher'">
<Output TaskParameter="Include" ItemName="MoveFilesAfterBuild" />
</CreateItem>
<Move SourceFiles="@(MoveFilesAfterBuild)" DestinationFolder="$(TargetDir)..\" />
<!--example:AppHostPatcher\AppHostPatcher FileTools.exe FileTools\FileTools.dll-->
<PropertyGroup>
<AppHostPatcherCommand>$(BaseOutputPath)AppHostPatcher\AppHostPatcher.exe $(TargetDir)..\$(TargetName).exe $(MSBuildProjectName)\$(TargetFileName)</AppHostPatcherCommand>
</PropertyGroup>
<Exec WorkingDirectory="$(OutputPath)" Command="$(AppHostPatcherCommand)" Condition="$(TargetName) != 'AppHostPatcher'"/>
<Message Text="$(BaseOutputPath)AppHostPatcher\AppHostPatcher.exe $(TargetDir)..\$(TargetName).exe $(MSBuildProjectName)\$(TargetFileName)" />
</Target>
</Project>