|
1 | 1 | <Project Sdk="Microsoft.NET.Sdk"> |
2 | 2 |
|
3 | 3 | <!-- |
4 | | - Compile-validation lane. |
| 4 | + Backend compile-validation lane. |
5 | 5 |
|
6 | 6 | The product assembly targets net11.0-tizen11.0 and cannot be restored until Samsung publishes |
7 | 7 | the 11.0.100 workload manifest. That would normally leave every NUI-touching source file in this |
8 | | - repository completely unverified. |
9 | | -
|
10 | | - Samsung.Tizen.Ref.API15 does, however, ship real `ref/net8.0` reference assemblies for the whole |
11 | | - of TizenFX. This project pulls them down with PackageDownload (which skips NuGet's TFM |
12 | | - compatibility check) and compiles the backend's Tizen-only sources against them with TIZEN |
13 | | - defined, on a plain net11.0 host. |
| 8 | + repository completely unverified. This project compiles the backend's Tizen-only sources against |
| 9 | + the real TizenFX reference assemblies with TIZEN defined, on a plain net11.0 host. |
14 | 10 |
|
15 | 11 | This is NOT a neutral fallback for the product - it produces no shippable output |
16 | 12 | (IsPackable=false, reference-only assemblies, never executed). It exists purely so `#if TIZEN` |
17 | 13 | code is type-checked in CI instead of being taken on faith. |
| 14 | +
|
| 15 | + SCOPE: backend sources ONLY. |
| 16 | +
|
| 17 | + This lane used to compile the sample's sources too. That was wrong in two ways, both of which a |
| 18 | + review caught: |
| 19 | +
|
| 20 | + * It produced a single merged Core+sample assembly, so the sample never actually crossed the |
| 21 | + package boundary it exists to demonstrate. A sample that touched an internal, or a type it |
| 22 | + could not see through a real assembly reference, would have compiled clean here. |
| 23 | + * The analyzer saw one merged public surface with both baseline pairs attached, so PublicAPI |
| 24 | + ownership was false-green: moving a Core type into the SAMPLE's baseline still passed. |
| 25 | + Verified by mutation - Microsoft.Maui.Platforms.Tizen.TizenFlyoutView was moved into the |
| 26 | + sample baseline and the build still succeeded. |
| 27 | +
|
| 28 | + The sample is now compiled by tests/Maui.Tizen.Sample.RefPackCompile, which reaches this |
| 29 | + assembly through a ProjectReference exactly as a package consumer would. |
18 | 30 | --> |
19 | 31 |
|
20 | 32 | <Import Project="$(RepositoryRoot)eng/Maui.props" /> |
|
23 | 35 | <PropertyGroup> |
24 | 36 | <TargetFramework>$(DotNetTfm)</TargetFramework> |
25 | 37 | <IsTizenProject>false</IsTizenProject> |
26 | | - <AssemblyName>Maui.Tizen.Core.RefPackCompile</AssemblyName> |
| 38 | + |
| 39 | + <!-- |
| 40 | + Deliberately the REAL product assembly name, not a lane-specific one. The sample lane |
| 41 | + references this project, and the point of that reference is to reproduce what a consumer sees |
| 42 | + when they reference the Maui.Tizen.Core package. Referencing something called |
| 43 | + "Maui.Tizen.Core.RefPackCompile" would exercise a boundary that does not exist in the product. |
| 44 | + --> |
| 45 | + <AssemblyName>Maui.Tizen.Core</AssemblyName> |
27 | 46 | <RootNamespace>Microsoft.Maui.Platforms.Tizen</RootNamespace> |
28 | 47 |
|
29 | 48 | <IsPackable>false</IsPackable> |
|
33 | 52 |
|
34 | 53 | <EnableDefaultCompileItems>false</EnableDefaultCompileItems> |
35 | 54 |
|
36 | | - <!-- The whole point of this lane: exercise the `#if TIZEN` branches. --> |
37 | 55 | <!-- |
38 | | - TIZEN only. PLATFORM was also defined here but NOT by the product, which meant a future |
39 | | - `#if PLATFORM` block would compile in this lane and vanish from the shipping assembly - the |
40 | | - exact class of drift this lane exists to prevent. No source uses it today; removed before one |
41 | | - does. A test pins the two define sets together. |
| 56 | + TIZEN only, and it must stay that way. PLATFORM was also defined here but NOT by the product, |
| 57 | + which meant a future `#if PLATFORM` block would compile in this lane and vanish from the |
| 58 | + shipping assembly - the exact class of drift this lane exists to prevent. |
| 59 | + RefPackLaneAndProductDefineTheSameSymbols pins the two define sets together. |
42 | 60 | --> |
43 | 61 | <DefineConstants>$(DefineConstants);TIZEN</DefineConstants> |
44 | 62 | </PropertyGroup> |
45 | 63 |
|
46 | 64 | <!-- |
47 | 65 | Runs the PublicAPI analyzer over the REAL product sources with the REAL slice baselines. |
48 | | - src/Maui.Tizen.Core cannot be built without the Samsung workload, so this is the only lane |
49 | | - where RS0016/RS0017 can actually be enforced before that ships. |
| 66 | + src/Maui.Tizen.Core cannot be built without the Samsung workload, so this is the only lane where |
| 67 | + RS0016/RS0017 can actually be enforced before that ships. |
| 68 | +
|
| 69 | + ONLY the backend baseline is attached. The sample's baseline belongs to the sample's own |
| 70 | + compilation, and attaching it here is precisely what made ownership unverifiable. |
50 | 71 | --> |
51 | 72 | <ItemGroup> |
52 | 73 | <PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers"> |
53 | 74 | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
54 | 75 | <PrivateAssets>all</PrivateAssets> |
55 | 76 | </PackageReference> |
56 | | - <!-- |
57 | | - The product baseline. This is the one that matters: it is what src/Maui.Tizen.Core itself |
58 | | - consumes, and what a reviewer should read to see this package's public surface. |
59 | | - --> |
| 77 | + |
60 | 78 | <AdditionalFiles Include="$(RepositoryRoot)src/Maui.Tizen.Core/PublicAPI/slice/PublicAPI.Shipped.txt" /> |
61 | 79 | <AdditionalFiles Include="$(RepositoryRoot)src/Maui.Tizen.Core/PublicAPI/slice/PublicAPI.Unshipped.txt" /> |
62 | | - |
63 | | - <!-- |
64 | | - The sample's baseline, kept separate so the product baseline is not polluted with app types. |
65 | | - This lane compiles the sample sources too (so they are type-checked against real TizenFX), and |
66 | | - the analyzer sees one merged API surface, hence both files. |
67 | | - --> |
68 | | - <AdditionalFiles Include="$(RepositoryRoot)samples/Maui.Tizen.Sample/PublicAPI/PublicAPI.Shipped.txt" /> |
69 | | - <AdditionalFiles Include="$(RepositoryRoot)samples/Maui.Tizen.Sample/PublicAPI/PublicAPI.Unshipped.txt" /> |
70 | 80 | </ItemGroup> |
71 | 81 |
|
72 | 82 | <ItemGroup> |
73 | 83 | <PackageReference Include="Microsoft.Maui.Core" /> |
74 | | - |
75 | | - <!-- |
76 | | - PackageDownload rather than PackageReference: these packages publish no net11.0-compatible |
77 | | - assets, so a normal reference fails restore with NU1202. We only want the files on disk. |
78 | | - --> |
79 | | - <PackageDownload Include="$(TizenReferencePackId)" Version="[$(TizenReferencePackVersion)]" /> |
80 | | - <PackageDownload Include="Tizen.UIExtensions.NUI" Version="[$(TizenUIExtensionsPackageVersion)]" /> |
81 | 84 | <PackageReference Include="Microsoft.Maui.Graphics" /> |
82 | 85 | </ItemGroup> |
83 | 86 |
|
84 | | - <Target Name="_AddTizenReferenceAssemblies" BeforeTargets="ResolveAssemblyReferences"> |
85 | | - <PropertyGroup> |
86 | | - <_TizenRefPackDir>$(NuGetPackageRoot)$(TizenReferencePackId.ToLowerInvariant())/$(TizenReferencePackVersion)/ref/net8.0/</_TizenRefPackDir> |
87 | | - <_TizenUIExtensionsDir>$(NuGetPackageRoot)tizen.uiextensions.nui/$(TizenUIExtensionsPackageVersion)/lib/tizen10.0/</_TizenUIExtensionsDir> |
88 | | - </PropertyGroup> |
89 | | - |
90 | | - <Error Condition="!Exists('$(_TizenRefPackDir)Tizen.NUI.dll')" |
91 | | - Code="MAUITIZEN0102" |
92 | | - Text="Could not find Tizen.NUI.dll under '$(_TizenRefPackDir)'. Expected it from $(TizenReferencePackId) $(TizenReferencePackVersion); run 'dotnet restore' for this project first." /> |
93 | | - |
94 | | - <ItemGroup> |
95 | | - <Reference Include="$(_TizenRefPackDir)Tizen.NUI.dll" Private="false" /> |
96 | | - <Reference Include="$(_TizenRefPackDir)Tizen.NUI.Components.dll" Private="false" /> |
97 | | - <Reference Include="$(_TizenRefPackDir)Tizen.Applications.Common.dll" Private="false" /> |
98 | | - <Reference Include="$(_TizenRefPackDir)Tizen.Applications.UI.dll" Private="false" /> |
99 | | - <Reference Include="$(_TizenRefPackDir)Tizen.Log.dll" Private="false" /> |
100 | | - <Reference Include="$(_TizenRefPackDir)Tizen.dll" Private="false" /> |
101 | | - <Reference Include="$(_TizenUIExtensionsDir)Tizen.UIExtensions.NUI.dll" Private="false" Condition="Exists('$(_TizenUIExtensionsDir)Tizen.UIExtensions.NUI.dll')" /> |
102 | | - </ItemGroup> |
103 | | - </Target> |
| 87 | + <Import Project="$(RepositoryRoot)eng/targets/TizenRefPack.targets" /> |
104 | 88 |
|
105 | 89 | <ItemGroup> |
106 | 90 | <Compile Include="@(MauiTizenPortableCompile)" LinkBase="Backend" /> |
107 | 91 | <Compile Include="@(MauiTizenHandlerCompile)" LinkBase="Backend" /> |
108 | 92 | <Compile Include="@(MauiTizenPlatformCompile)" LinkBase="Backend" /> |
109 | | - <Compile Include="@(MauiTizenSampleCompile)" LinkBase="Sample" /> |
110 | 93 | </ItemGroup> |
111 | 94 |
|
112 | 95 | </Project> |
0 commit comments