forked from PrismLibrary/Prism
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
38 lines (32 loc) · 1.45 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
38 lines (32 loc) · 1.45 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
27
28
29
30
31
32
33
34
35
36
37
38
<Project>
<Import Project="winappsdk-workarounds.targets" Condition=" $(IsUnoProject) == 'true' " />
<PropertyGroup>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
</PropertyGroup>
<PropertyGroup Condition=" $(IsPackable) ">
<!-- Nuget source link -->
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<!-- Generate the NotTrimmable.cs file -->
<Target Name="AddNotTrimmableFile" BeforeTargets="BeforeCompile" Condition=" $(IsPackable) ">
<PropertyGroup>
<!-- Define the file path -->
<NotTrimmableFilePath>$(IntermediateOutputPath)NotTrimmable.g.cs</NotTrimmableFilePath>
</PropertyGroup>
<!-- Ensure the intermediate output directory exists -->
<MakeDir Directories="$(IntermediateOutputPath)" />
<!-- Write the contents to the file -->
<WriteLinesToFile
File="$(NotTrimmableFilePath)"
Lines="[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "False")]"
Overwrite="true"
Encoding="UTF-8" />
<!-- Include the generated file in the compilation -->
<ItemGroup>
<Compile Include="$(NotTrimmableFilePath)" />
</ItemGroup>
</Target>
</Project>