Repository navigation
Expand file tree
/
Copy pathPublishApp.targets
More file actions
26 lines (26 loc) · 1.5 KB
/
Copy pathPublishApp.targets
File metadata and controls
26 lines (26 loc) · 1.5 KB
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
<Project>
<PropertyGroup>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<EnableCompressionInSingleFile>$(SelfContained)</EnableCompressionInSingleFile>
<RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</RepoRoot>
<PublishDir>$(RepoRoot)publish\$(MSBuildProjectName)-$(Platform)-$(Configuration)-$(RuntimeIdentifier)\</PublishDir>
</PropertyGroup>
<Target Name="ExcludePdbFromPublish" AfterTargets="ComputeFilesToPublish">
<ItemGroup>
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.Extension)' == '.pdb'" />
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.Extension)' == '.xml'" />
</ItemGroup>
</Target>
<Target Name="RenamePublishExe" AfterTargets="Publish" Condition="Exists('$(PublishDir)$(AssemblyName).exe')">
<Move SourceFiles="$(PublishDir)$(AssemblyName).exe" DestinationFiles="$(PublishDir)codec.exe" />
</Target>
<Target Name="ZipPublishOutput" AfterTargets="Publish">
<PropertyGroup>
<_ZipFileName>$(MSBuildProjectName)-$(Platform)-$(Configuration)-$(RuntimeIdentifier)-v$(Version).zip</_ZipFileName>
</PropertyGroup>
<ZipDirectory SourceDirectory="$(PublishDir)" DestinationFile="$(RepoRoot)publish\$(_ZipFileName)" Overwrite="true" />
</Target>
</Project>