Repository navigation
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
102 lines (90 loc) · 5.42 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
102 lines (90 loc) · 5.42 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<Project>
<!-- Imported *after* each project file, unlike Directory.Build.props which is imported before
it. That ordering is the whole reason this file exists: `IsPackable` is set inside
Marey.Tests.fsproj, so a condition on it in the .props would be evaluated before the
property had a value and would pack a readme into the test project. -->
<!-- Each package gets its own readme, because the gallery page is most of what a first-time
visitor sees and seven packages sharing one page tells none of their stories. A project
that has not written one falls back to the repository-wide `NUGET.md` rather than
shipping blank. `PackageReadmeFile` names the file *inside* the package, so it has to
move in step with whichever file is packed. -->
<PropertyGroup Condition="'$(IsPackable)' != 'false' AND Exists('$(MSBuildProjectDirectory)\PackageReadme.md')">
<PackageReadmeFile>PackageReadme.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup Condition="'$(IsPackable)' != 'false'">
<None Condition="Exists('$(MSBuildProjectDirectory)\PackageReadme.md')"
Include="$(MSBuildProjectDirectory)\PackageReadme.md"
Pack="true"
PackagePath="\"
Visible="false" />
<None Condition="!Exists('$(MSBuildProjectDirectory)\PackageReadme.md')"
Include="$(MSBuildThisFileDirectory)NUGET.md"
Pack="true"
PackagePath="\"
Visible="false" />
</ItemGroup>
<!-- One icon for all seven packages, unlike the readme: the point of a package icon is that
the family is recognisable at a glance in a gallery listing. -->
<ItemGroup Condition="'$(IsPackable)' != 'false'">
<None Include="$(MSBuildThisFileDirectory)assets\icon.png"
Pack="true"
PackagePath="\"
Visible="false" />
</ItemGroup>
<!-- A package Fable can consume. Fable compiles a library from source, so a project
that sets `MareyFable` packs its `.fsproj` and its `.fs` files under `fable/`, which is
where Fable looks for them, and carries the tags Fable's package checks read. A .NET
consumer sees two extra folders in the package and nothing else. `tests/Marey.Fable`
built against the packed packages is the gate that the folders are complete. -->
<PropertyGroup Condition="'$(MareyFable)' == 'true'">
<PackageTags>$(PackageTags) fable fable-library fable-javascript fable-dotnet</PackageTags>
</PropertyGroup>
<ItemGroup Condition="'$(MareyFable)' == 'true' AND '$(IsPackable)' != 'false'">
<None Include="$(MSBuildProjectFullPath)" Pack="true" PackagePath="fable/" Visible="false" />
<None Include="@(Compile)" Pack="true" PackagePath="fable/" Visible="false" />
</ItemGroup>
<!-- `-p:MareyApiSig=<dir>` writes each project's inferred signature to
`<dir>/<project>.<tfm>.fsi`, which `tools/api/listing.fsx` turns into the checked-in public
API listing. Here rather than in the .props because `TargetFramework` of a single-target
project is only set once the project file has been read. -->
<PropertyGroup Condition="'$(MareyApiSig)' != ''">
<OtherFlags>$(OtherFlags) --sig:$(MareyApiSig)/$(MSBuildProjectName).$(TargetFramework).fsi</OtherFlags>
</PropertyGroup>
<!-- Marey's packages share their internals with each other and with the two test
projects, so plumbing one package needs from another (an axis spec from an erased scale, a
prefix for a symbol) is `internal` rather than public surface a user meets and 1.0 has to
keep. The packages pin each other exactly (below), so a user cannot mix versions that
disagree about an internal. A new package joins this list. -->
<ItemGroup Condition="'$(IsPackable)' != 'false' AND $(MSBuildProjectName.StartsWith('Marey.'))">
<InternalsVisibleTo Include="Marey.Anim" />
<InternalsVisibleTo Include="Marey.Backend.Gpu" />
<InternalsVisibleTo Include="Marey.Backend.Skia" />
<InternalsVisibleTo Include="Marey.Backend.Svg" />
<InternalsVisibleTo Include="Marey.Backend.Tikz" />
<InternalsVisibleTo Include="Marey.Backend.Web" />
<InternalsVisibleTo Include="Marey.Core" />
<InternalsVisibleTo Include="Marey.Fields" />
<InternalsVisibleTo Include="Marey.Html" />
<InternalsVisibleTo Include="Marey.Interact" />
<InternalsVisibleTo Include="Marey.Plot" />
<InternalsVisibleTo Include="Marey.Sim" />
<InternalsVisibleTo Include="Marey.Toolchain" />
<InternalsVisibleTo Include="Marey.Tools.Tex" />
<InternalsVisibleTo Include="Marey.Tools.Video" />
<InternalsVisibleTo Include="Marey.Units" />
<InternalsVisibleTo Include="Marey.Verso" />
<InternalsVisibleTo Include="Marey.Witnesses" />
<InternalsVisibleTo Include="Marey.Analyzers" />
<InternalsVisibleTo Include="Marey.Analyzers.Tests" />
<InternalsVisibleTo Include="Marey.Tests" />
<InternalsVisibleTo Include="Marey.CSharp.Tests" />
</ItemGroup>
<!-- Marey's packages are released together and reach each other's internals, so each depends on
exactly the version of the others it was built with: `[1.0.0]`, not `>= 1.0.0`. Without the
pin a user could upgrade one package past the internals another one calls. -->
<Target Name="PinMareyProjectReferences" AfterTargets="_GetProjectReferenceVersions">
<ItemGroup>
<_ProjectReferencesWithVersions Update="@(_ProjectReferencesWithVersions)" ProjectVersion="[%(ProjectVersion)]" />
</ItemGroup>
</Target>
</Project>