-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
47 lines (38 loc) · 3.13 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
47 lines (38 loc) · 3.13 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
<Project>
<!-- Flip in-repo Kontent.Ai.* PackageReferences to ProjectReferences.
dotnet build # default: against published packages
dotnet build /p:UseProjectReferences=true # against repo source
The default is the mode everything ships from; the switched leg is the early warning
for sibling breaking changes. CI runs both, both blocking.
Evaluated inline rather than in a target, so restore sees the result. SourceGeneration
is absent on purpose - it is consumed as an analyzer, so swapping would change how it is
applied. Keep this list in step with eng/products.json. -->
<ItemGroup Condition="'$(UseProjectReferences)' == 'true'">
<ProjectReference Include="$(MSBuildThisFileDirectory)src/delivery/Kontent.Ai.Delivery/Kontent.Ai.Delivery.csproj"
Condition="@(PackageReference->AnyHaveMetadataValue('Identity', 'Kontent.Ai.Delivery'))" />
<PackageReference Remove="Kontent.Ai.Delivery" />
<ProjectReference Include="$(MSBuildThisFileDirectory)src/delivery/Kontent.Ai.Delivery.Abstractions/Kontent.Ai.Delivery.Abstractions.csproj"
Condition="@(PackageReference->AnyHaveMetadataValue('Identity', 'Kontent.Ai.Delivery.Abstractions'))" />
<PackageReference Remove="Kontent.Ai.Delivery.Abstractions" />
<ProjectReference Include="$(MSBuildThisFileDirectory)src/delivery/Kontent.Ai.Delivery.Caching/Kontent.Ai.Delivery.Caching.csproj"
Condition="@(PackageReference->AnyHaveMetadataValue('Identity', 'Kontent.Ai.Delivery.Caching'))" />
<PackageReference Remove="Kontent.Ai.Delivery.Caching" />
<ProjectReference Include="$(MSBuildThisFileDirectory)src/delivery/Kontent.Ai.Urls/Kontent.Ai.Urls.csproj"
Condition="@(PackageReference->AnyHaveMetadataValue('Identity', 'Kontent.Ai.Urls'))" />
<PackageReference Remove="Kontent.Ai.Urls" />
<ProjectReference Include="$(MSBuildThisFileDirectory)src/management/Kontent.Ai.Management/Kontent.Ai.Management.csproj"
Condition="@(PackageReference->AnyHaveMetadataValue('Identity', 'Kontent.Ai.Management'))" />
<PackageReference Remove="Kontent.Ai.Management" />
</ItemGroup>
<!-- Packing must never happen in source-reference mode: a ProjectReference packs with the
referenced project's $(Version) from eng/Versions.props, not the floor declared in
Directory.Packages.props, so it would declare a dependency that is either unpublished
or never asked for. A structural guard, because nothing stops a future script from
omitting /p:UseProjectReferences=false. On GenerateNuspec rather than Pack - that is the
target the no-build pack path in release.yml hits. -->
<Target Name="RefuseSourceModePack" BeforeTargets="GenerateNuspec"
Condition="'$(UseProjectReferences)' == 'true'">
<Error Code="KONTENT001"
Text="Refusing to pack with UseProjectReferences=true: sibling versions would come from eng/Versions.props instead of the dependency floors declared in Directory.Packages.props. Pack in the default package-reference mode." />
</Target>
</Project>