Skip to content

Commit

Permalink
feat: make UnoFeatures ignore casing
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed May 21, 2024
1 parent 7d3e553 commit e873d73
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 50 deletions.
12 changes: 6 additions & 6 deletions src/Uno.Sdk/targets/Uno.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@
<None Include="@(_IgnorePlatformFiles)" Sdk="Uno" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Dsp;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';dsp;'))">
<!-- New Material Theme Builder export format (Uno.Dsp 1.3+) -->
<UnoDspImportColors Include="Styles\*.json" Generator="Xaml" Condition="!$(UnoFeatures.Contains(';CSharpMarkup;'))" />
<UnoDspImportColors Include="Styles\*.json" Generator="CSharp" Condition="$(UnoFeatures.Contains(';CSharpMarkup;'))" />
<UnoDspImportColors Include="Styles\*.json" Generator="Xaml" Condition="!$(UnoFeatures.Contains(';csharpmarkup;'))" />
<UnoDspImportColors Include="Styles\*.json" Generator="CSharp" Condition="$(UnoFeatures.Contains(';csharpmarkup;'))" />

<!-- Legacy old DSP format for backward compatibility -->
<UnoDspImportColors Include="Styles\*.zip" Generator="Xaml" Condition="!$(UnoFeatures.Contains(';CSharpMarkup;'))" />
<UnoDspImportColors Include="Styles\*.zip" Generator="CSharp" Condition="$(UnoFeatures.Contains(';CSharpMarkup;'))" />
<UnoDspImportColors Include="Styles\*.zip" Generator="Xaml" Condition="!$(UnoFeatures.Contains(';csharpmarkup;'))" />
<UnoDspImportColors Include="Styles\*.zip" Generator="CSharp" Condition="$(UnoFeatures.Contains(';csharpmarkup;'))" />
</ItemGroup>

<ItemGroup Condition="($(UnoFeatures.Contains(';Configuration;')) OR $(UnoFeatures.Contains(';Extensions;'))) AND Exists('appsettings.json')">
<ItemGroup Condition="($(UnoFeatures.Contains(';configuration;')) OR $(UnoFeatures.Contains(';Extensions;'))) AND Exists('appsettings.json')">
<EmbeddedResource Include="appsettings.json" />
<EmbeddedResource Include="appsettings.*.json" DependentUpon="appsettings.json" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,46 @@
<_UseUnoExtensions>$(UnoFeatures.Contains(';Extensions;'))</_UseUnoExtensions>
</PropertyGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';AuthenticationMsal;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';authenticationmsal;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Authentication.MSAL.WinUI" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Microsoft.Identity.Client" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.WinUI.MSAL" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';AuthenticationOidc;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';authenticationoidc;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Authentication.Oidc.WinUI" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Authentication;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';authentication;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Authentication.WinUI" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(_UseUnoExtensions) OR $(UnoFeatures.Contains(';Configuration;'))">
<ItemGroup Condition="$(_UseUnoExtensions) OR $(UnoFeatures.Contains(';configuration;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Configuration" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(_UseUnoExtensions) OR $(UnoFeatures.Contains(';ExtensionsCore;')) OR $(UnoFeatures.Contains(';ThemeService;'))">
<ItemGroup Condition="$(_UseUnoExtensions) OR $(UnoFeatures.Contains(';extensionscore;')) OR $(UnoFeatures.Contains(';themeservice;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Core.WinUI" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(_UseUnoExtensions) OR $(UnoFeatures.Contains(';Hosting;'))">
<ItemGroup Condition="$(_UseUnoExtensions) OR $(UnoFeatures.Contains(';hosting;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Hosting.WinUI" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Http;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';http;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Http.WinUI" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Http.Refit" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Localization;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';localization;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Localization.WinUI" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(_UseUnoExtensions) OR $(UnoFeatures.Contains(';Logging;'))">
<ItemGroup Condition="$(_UseUnoExtensions) OR $(UnoFeatures.Contains(';logging;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Logging.WinUI" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';MauiEmbedding;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';mauiembedding;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Maui.WinUI" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Maui.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains('CSharpMarkup'))" />
<_UnoProjectSystemPackageReference Include="Microsoft.Maui.Controls" ProjectSystem="true" />
Expand All @@ -63,28 +63,28 @@
<_UnoProjectSystemPackageReference Include="Xamarin.AndroidX.Collection.Ktx" ProjectSystem="true" Condition="$(IsAndroid) == 'true'" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Navigation;')) AND !$(UnoFeatures.Contains(';Prism;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';navigation;')) AND !$(UnoFeatures.Contains(';prism;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Navigation.WinUI" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Navigation.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains('CSharpMarkup'))"/>
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Navigation.Toolkit.WinUI" ProjectSystem="true" Condition="$(UnoFeatures.Contains('Toolkit'))"/>
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Navigation.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';csharpmarkup;'))"/>
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Navigation.Toolkit.WinUI" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';toolkit;'))"/>
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';MVUX;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';mvux;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Reactive.WinUI" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Reactive.Messaging" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Reactive.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains('CSharpMarkup'))" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Reactive.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';csharpmarkup;'))" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Serialization;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';serialization;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Serialization.Http" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Serialization.Refit" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';LoggingSerilog;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';loggingserilog;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Logging.Serilog" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Storage;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';storage;'))">
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Storage.WinUI" ProjectSystem="true" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Uno.Sdk/targets/Uno.Features.targets
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>

<PropertyGroup>
<UnoFeatures>$([System.Text.RegularExpressions.Regex]::Replace($(UnoFeatures), '\s', ''))</UnoFeatures>
<UnoFeatures>$([System.Text.RegularExpressions.Regex]::Replace($(UnoFeatures), '\s', '').ToLower())</UnoFeatures>
<UnoFeatures Condition="$(UnoFeatures) == ''">;</UnoFeatures>
<UnoFeatures Condition="!$(UnoFeatures.StartsWith(';'))">;$(UnoFeatures)</UnoFeatures>
<UnoFeatures Condition="!$(UnoFeatures.EndsWith(';'))">$(UnoFeatures);</UnoFeatures>
</PropertyGroup>

<PropertyGroup Condition="$(UnoFeatures.Contains(';MauiEmbedding;'))">
<PropertyGroup Condition="$(UnoFeatures.Contains(';mauiembedding;'))">
<UseMaui>true</UseMaui>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
in order for VS and C# Dev Kit to show nuget references in their respective solution explorers.
The version is not required, and VS/Code waits for some design-time targets to be executed to evaluate it.
-->
<ItemGroup Condition="$(UnoFeatures.Contains(';Lottie;')) OR $(UnoFeatures.Contains(';Material;')) OR $(UnoFeatures.Contains(';Cupertino;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';lottie;')) OR $(UnoFeatures.Contains(';material;')) OR $(UnoFeatures.Contains(';cupertino;'))">
<_UnoProjectSystemPackageReference Include="Uno.WinUI.Lottie" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Skia;')) OR $(UnoFeatures.Contains(';Lottie;')) OR $(UnoFeatures.Contains(';Svg;')) OR $(UnoFeatures.Contains(';Material;')) OR $(UnoFeatures.Contains(';Cupertino;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';skia;')) OR $(UnoFeatures.Contains(';lottie;')) OR $(UnoFeatures.Contains(';svg;')) OR $(UnoFeatures.Contains(';material;')) OR $(UnoFeatures.Contains(';cupertino;'))">
<_UnoProjectSystemPackageReference Include="SkiaSharp.Views.Uno.WinUI" ProjectSystem="true"/>
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Svg;')) AND $(IsUnoHead) == 'true' AND '$(IsBrowserWasm)' != 'true' ">
<ItemGroup Condition="$(UnoFeatures.Contains(';svg;')) AND $(IsUnoHead) == 'true' AND '$(IsBrowserWasm)' != 'true' ">
<_UnoProjectSystemPackageReference Include="Uno.WinUI.Svg" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(IsBrowserWasm) != 'true' AND '$(IsPackable)' != 'true'">
<_UnoProjectSystemPackageReference Include="SkiaSharp.Skottie" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';Lottie;')) OR $(UnoFeatures.Contains(';Material;')) OR $(UnoFeatures.Contains(';Cupertino;'))" />
<_UnoProjectSystemPackageReference Include="Svg.Skia" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';Svg;')) AND $(IsUnoHead) == 'true'" />
<_UnoProjectSystemPackageReference Include="SkiaSharp.Skottie" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';lottie;')) OR $(UnoFeatures.Contains(';material;')) OR $(UnoFeatures.Contains(';cupertino;'))" />
<_UnoProjectSystemPackageReference Include="Svg.Skia" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';svg;')) AND $(IsUnoHead) == 'true'" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup Condition=" $(_IsExecutable) == 'true' ">
<_UnoProjectSystemPackageReference Include="Uno.WinUI.WebAssembly" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.WinUI.MediaPlayer.WebAssembly" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';MediaElement;'))"/>
<_UnoProjectSystemPackageReference Include="Uno.WinUI.MediaPlayer.WebAssembly" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';mediaelement;'))"/>
<_UnoProjectSystemPackageReference Include="Microsoft.Windows.Compatibility" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Wasm.Bootstrap" ProjectSystem="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<_UnoProjectSystemPackageReference Include="Uno.Core.Extensions.Logging.Singleton" ProjectSystem="true" Condition="$(_IsExecutable) == 'true'"/>
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Skia;')) OR $(UnoFeatures.Contains(';Lottie;')) OR $(UnoFeatures.Contains(';Svg;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';skia;')) OR $(UnoFeatures.Contains(';lottie;')) OR $(UnoFeatures.Contains(';svg;'))">
<_UnoProjectSystemPackageReference Include="SkiaSharp.Views.WinUI" ProjectSystem="true" />
</ItemGroup>
</Project>
34 changes: 17 additions & 17 deletions src/Uno.Sdk/targets/Uno.Implicit.Packages.ProjectSystem.targets
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,49 @@
</Otherwise>
</Choose>

<ItemGroup Condition="$(UnoFeatures.Contains(';Maps;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';maps;'))">
<_UnoProjectSystemPackageReference Include="Uno.WinUI.Maps" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Foldable;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';foldable;'))">
<_UnoProjectSystemPackageReference Include="Uno.WinUI.Foldable" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';CSharpMarkup;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';csharpmarkup;'))">
<_UnoProjectSystemPackageReference Include="Uno.WinUI.Markup" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Extensions.Markup.Generators" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Toolkit;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';toolkit;'))">
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';CSharpMarkup;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.Skia.WinUI" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';Skia;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI.Cupertino" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';Cupertino;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI.Material" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';Material;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI.Material.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';Material;')) AND $(UnoFeatures.Contains(';CSharpMarkup;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';csharpmarkup;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.Skia.WinUI" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';skia;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI.Cupertino" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';cupertino;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI.Material" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';material;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Toolkit.WinUI.Material.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';material;')) AND $(UnoFeatures.Contains(';csharpmarkup;'))" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Material;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';material;'))">
<_UnoProjectSystemPackageReference Include="Uno.Material.WinUI" ProjectSystem="true" />
<_UnoProjectSystemPackageReference Include="Uno.Material.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';CSharpMarkup;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Themes.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';CSharpMarkup;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Material.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';csharpmarkup;'))" />
<_UnoProjectSystemPackageReference Include="Uno.Themes.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';csharpmarkup;'))" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Cupertino;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';cupertino;'))">
<_UnoProjectSystemPackageReference Include="Uno.Cupertino.WinUI" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Prism;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';prism;'))">
<_UnoProjectSystemPackageReference Include="Prism.Uno.WinUI" ProjectSystem="true" Condition="!$(_IsExecutable)" />
<_UnoProjectSystemPackageReference Include="Prism.DryIoc.Uno.WinUI" ProjectSystem="true" Condition="$(_IsExecutable)" />
<_UnoProjectSystemPackageReference Include="Prism.Uno.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';CSharpMarkup;'))" />
<_UnoProjectSystemPackageReference Include="Prism.Uno.WinUI.Markup" ProjectSystem="true" Condition="$(UnoFeatures.Contains(';csharpmarkup;'))" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Dsp;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';dsp;'))">
<_UnoProjectSystemPackageReference Include="Uno.Dsp.Tasks" ProjectSystem="true" />
</ItemGroup>

<ItemGroup Condition="$(UnoFeatures.Contains(';Mvvm;'))">
<ItemGroup Condition="$(UnoFeatures.Contains(';mvvm;'))">
<_UnoProjectSystemPackageReference Include="CommunityToolkit.Mvvm" ProjectSystem="true" />
</ItemGroup>

Expand Down

0 comments on commit e873d73

Please sign in to comment.