|
| 1 | +#!/usr/bin/env bash |
| 2 | +# |
| 3 | +# compatibility-collision-probe.sh — reproducible evidence for the Maui.Tizen.Compatibility |
| 4 | +# capability decision recorded in /docs/tizen-maps-compatibility-status.md. |
| 5 | +# |
| 6 | +# Claim being verified: none of the compatibility-renderer base infrastructure |
| 7 | +# (VisualElementRenderer<TElement>, ViewHandlerDelegator<TElement>, ItemTemplateAdaptor) |
| 8 | +# exists in the REAL, published, plain-net11.0 Microsoft.Maui.Controls.Core package. Unlike |
| 9 | +# Maps (see maps-neutral-stub-probe.sh), there is no neutral "*.Standard.cs" fallback for |
| 10 | +# these types - they only ever existed inside a platform-specific compilation upstream. That |
| 11 | +# means a Tizen ListView/TableView/Frame compatibility renderer cannot be built today against |
| 12 | +# any public net11 contract: it would need Maui.Tizen.Controls's own Tizen-specific |
| 13 | +# ItemTemplateAdaptor (src/Maui.Tizen.Controls/Core/Handlers/Items/Tizen/ItemTemplateAdaptor.cs) |
| 14 | +# and a from-scratch VisualElementRenderer/ViewHandlerDelegator, none of which compile yet |
| 15 | +# (Phase 2, not started - see docs/migration.md). This corroborates |
| 16 | +# src/Maui.Tizen.Compatibility/README.md's own "provisional, likely deleted" assessment with |
| 17 | +# concrete, reproducible evidence rather than leaving it as an unverified guess. |
| 18 | +# |
| 19 | +# This builds a throwaway console app against the exact package version pinned in |
| 20 | +# /Directory.Packages.props, using this repository's own /nuget.config. Plain net11.0 only - |
| 21 | +# no Tizen workload involved. |
| 22 | + |
| 23 | +set -euo pipefail |
| 24 | + |
| 25 | +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" |
| 26 | +WORKDIR="$(mktemp -d)" |
| 27 | +trap 'rm -rf "$WORKDIR"' EXIT |
| 28 | + |
| 29 | +MAUI_VERSION="$(python3 -c " |
| 30 | +import re |
| 31 | +text = open('$REPO_ROOT/Directory.Packages.props').read() |
| 32 | +m = re.search(r'Microsoft\.Maui\.Controls\.Core\" Version=\"([^\"]+)\"', text) |
| 33 | +print(m.group(1)) |
| 34 | +")" |
| 35 | + |
| 36 | +echo "==> Probing Microsoft.Maui.Controls.Core $MAUI_VERSION (plain net11.0, no Tizen involved)" |
| 37 | + |
| 38 | +cp "$REPO_ROOT/nuget.config" "$WORKDIR/nuget.config" |
| 39 | + |
| 40 | +cat > "$WORKDIR/probe.csproj" <<EOF |
| 41 | +<Project Sdk="Microsoft.NET.Sdk"> |
| 42 | + <PropertyGroup> |
| 43 | + <OutputType>Exe</OutputType> |
| 44 | + <TargetFramework>net11.0</TargetFramework> |
| 45 | + <Nullable>enable</Nullable> |
| 46 | + </PropertyGroup> |
| 47 | + <ItemGroup> |
| 48 | + <PackageReference Include="Microsoft.Maui.Controls.Core" Version="$MAUI_VERSION" /> |
| 49 | + <PackageReference Include="Microsoft.Maui.Core" Version="$MAUI_VERSION" /> |
| 50 | + </ItemGroup> |
| 51 | +</Project> |
| 52 | +EOF |
| 53 | + |
| 54 | +cat > "$WORKDIR/Program.cs" <<'EOF' |
| 55 | +using System; |
| 56 | +
|
| 57 | +int failures = 0; |
| 58 | +
|
| 59 | +void CheckAbsent(string assemblyQualifiedName, string label) |
| 60 | +{ |
| 61 | + var t = Type.GetType(assemblyQualifiedName); |
| 62 | + if (t is null) |
| 63 | + { |
| 64 | + Console.WriteLine($"CONFIRMED ABSENT: {label}"); |
| 65 | + } |
| 66 | + else |
| 67 | + { |
| 68 | + Console.Error.WriteLine($"FAIL: {label} unexpectedly FOUND ({t}) - re-evaluate the capability decision, a neutral fallback may now exist."); |
| 69 | + failures++; |
| 70 | + } |
| 71 | +} |
| 72 | +
|
| 73 | +void CheckPresent(string assemblyQualifiedName, string label) |
| 74 | +{ |
| 75 | + var t = Type.GetType(assemblyQualifiedName); |
| 76 | + if (t is not null) |
| 77 | + { |
| 78 | + Console.WriteLine($"present (as expected, just a sanity check the assembly loaded): {label} -> {t}"); |
| 79 | + } |
| 80 | + else |
| 81 | + { |
| 82 | + Console.Error.WriteLine($"FAIL: {label} not found - the probe itself may be broken (assembly failed to load)."); |
| 83 | + failures++; |
| 84 | + } |
| 85 | +} |
| 86 | +
|
| 87 | +// The controls (bindable objects) DO exist in the neutral assembly - only the renderer/ |
| 88 | +// adaptor infrastructure that would make them actually draw anything is missing. These are |
| 89 | +// sanity checks that the probe is loading the right assembly at all. |
| 90 | +CheckPresent("Microsoft.Maui.Controls.ListView, Microsoft.Maui.Controls", "ListView (control)"); |
| 91 | +CheckPresent("Microsoft.Maui.Controls.TableView, Microsoft.Maui.Controls", "TableView (control)"); |
| 92 | +CheckPresent("Microsoft.Maui.Controls.Frame, Microsoft.Maui.Controls", "Frame (control)"); |
| 93 | +
|
| 94 | +// The renderer/adaptor infrastructure a Tizen compatibility renderer would need to derive |
| 95 | +// from or implement against. None of these have a neutral/no-platform fallback upstream. |
| 96 | +CheckAbsent("Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer`1, Microsoft.Maui.Controls", "VisualElementRenderer<TElement>"); |
| 97 | +CheckAbsent("Microsoft.Maui.Controls.Handlers.Compatibility.ViewHandlerDelegator`1, Microsoft.Maui.Controls", "ViewHandlerDelegator<TElement> (internal)"); |
| 98 | +CheckAbsent("Microsoft.Maui.Controls.Handlers.Items.ItemTemplateAdaptor, Microsoft.Maui.Controls", "ItemTemplateAdaptor"); |
| 99 | +
|
| 100 | +Environment.Exit(failures > 0 ? 1 : 0); |
| 101 | +EOF |
| 102 | + |
| 103 | +(cd "$WORKDIR" && dotnet run --project probe.csproj) |
0 commit comments