-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vezel.Zig.Sdk.Pack.targets
72 lines (64 loc) · 2.57 KB
/
Vezel.Zig.Sdk.Pack.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
<Project>
<PropertyGroup>
<PublicHeadersPath Condition="'$(PublicHeadersPath)' != ''">$([MSBuild]::EnsureTrailingSlash('$(PublicHeadersPath)'))</PublicHeadersPath>
</PropertyGroup>
<PropertyGroup>
<PackDependsOn>
_PackNativeAssets;
$(PackDependsOn)
</PackDependsOn>
</PropertyGroup>
<Target Name="_PackNativeAssets">
<!--
Since we claim to support netstandard1.0 but do not package any managed
assemblies, NuGet will warn during package validation. We place a dummy
file in the lib directory to silence it.
-->
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)../content/_._"
Pack="true"
PackagePath="lib/$(TargetFramework)" />
</ItemGroup>
<!--
Zig projects need to package all source code. C and C++ projects only
need to package public header files. We allow packaging headers with
Zig projects, but not Zig sources with C/C++ projects.
-->
<ItemGroup>
<None Include="$(PublicHeadersPath)**/*.h; $(PublicHeadersPath)**/*.hxx"
Exclude="$(DefaultItemExcludes)"
Pack="true"
PackagePath="include"
Condition="'$(PublicHeadersPath)' != ''" />
<None Include="**/*.zig"
Exclude="$(DefaultItemExcludes)"
Pack="true"
PackagePath="zig"
Condition="'$(CompilerMode)' == 'Zig'" />
</ItemGroup>
<ItemGroup>
<_RuntimeIdentifiers Include="$(RuntimeIdentifiers)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="_PackNativeBinary"
Properties="RuntimeIdentifier=%(_RuntimeIdentifiers.Identity)">
<Output TaskParameter="TargetOutputs"
ItemName="_NativeBinary" />
</MSBuild>
<ItemGroup>
<None Include="@(_NativeBinary)" />
</ItemGroup>
</Target>
<Target Name="_PackNativeBinary"
Returns="@(_NativeBinary)">
<PropertyGroup>
<_PackageNativePath>runtimes</_PackageNativePath>
<_PackageNativePath Condition="'$(OutputType)' == 'Exe'">tools</_PackageNativePath>
</PropertyGroup>
<ItemGroup>
<_NativeBinary Include="$(TargetPath)"
Pack="true"
PackagePath="$(_PackageNativePath)/$(RuntimeIdentifier)/native" />
</ItemGroup>
</Target>
</Project>