Skip to content

Commit

Permalink
Merge pull request #886 from unoplatform/dev/nr/cpmoptional
Browse files Browse the repository at this point in the history
feat: Making CPM optional
  • Loading branch information
nickrandolph authored Nov 7, 2022
2 parents 25c326f + 2c0322c commit c4e8944
Show file tree
Hide file tree
Showing 16 changed files with 617 additions and 3 deletions.
24 changes: 24 additions & 0 deletions build/ci/.azure-pipelines.TemplateValidation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,35 @@ jobs:
$msbuild = vswhere -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
Set-PSDebug -Trace 1
$ErrorActionPreference = 'Stop'
# Create app with defaults
dotnet new unoapp-extensions -o UnoApp01
cd UnoApp01
& $msbuild /r /m UnoApp01.sln
if ($LASTEXITCODE -ne 0)
{
throw "Exit code must be zero."
}
cd ..
# Create app without reactive extensions
dotnet new unoapp-extensions -o UnoAppNoReactive01 --reactive false
cd UnoAppNoReactive01
& $msbuild /r /m UnoAppNoReactive01.sln
if ($LASTEXITCODE -ne 0)
{
throw "Exit code must be zero."
}
cd ..
# Create app with cpm enabled
dotnet new unoapp-extensions -o UnoAppCPM01 --cpm true
cd UnoAppCPM01
& $msbuild /r /m UnoAppCPM01.sln
if ($LASTEXITCODE -ne 0)
{
throw "Exit code must be zero."
}
cd ..
displayName: Build template app
2 changes: 2 additions & 0 deletions src/Uno.Extensions.Templates/Uno.Extensions.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@
<!-- Legacy projects -->
<XmlPoke XmlInputPath="%(_AllCSProjFiles.Identity)" Query="//x:PackageVersion[@Version='255.255.255.255']/@Version" Value="$(PackageVersion)" Namespaces="$(MSBuildDeveloperNamespace)" />
<XmlPoke XmlInputPath="%(_AllCSProjFiles.Identity)" Query="//x:PackageReference[@Version='255.255.255.255']/@VersionOverride" Value="$(PackageVersion)" Namespaces="$(MSBuildDeveloperNamespace)" />
<XmlPoke XmlInputPath="%(_AllCSProjFiles.Identity)" Query="//x:PackageReference[@Version='255.255.255.255']/@Version" Value="$(PackageVersion)" Namespaces="$(MSBuildDeveloperNamespace)" />

<!-- SDK Style projects -->
<XmlPoke XmlInputPath="%(_AllCSProjFiles.Identity)" Query="//PackageVersion[@Version='255.255.255.255']/@Version" Value="$(PackageVersion)" Namespaces="" />
<XmlPoke XmlInputPath="%(_AllCSProjFiles.Identity)" Query="//PackageReference[@Version='255.255.255.255']/@VersionOverride" Value="$(PackageVersion)" Namespaces="" />
<XmlPoke XmlInputPath="%(_AllCSProjFiles.Identity)" Query="//PackageReference[@Version='255.255.255.255']/@Version" Value="$(PackageVersion)" Namespaces="" />



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
"longName": "reactive",
"shortName": "reactive"
},
"cpm": {
"longName": "cpm",
"shortName": "cpm"
},
"wasm-pwa-manifest": {
"longName": "wasm-pwa-manifest",
"shortName": "pwa"
Expand All @@ -54,8 +58,8 @@
"shortName": "vscode"
},
"skipRestore": {
"longName": "skipPackageRestore",
"shortName": "skipRestore"
"longName": "skipRestore",
"shortName": "skip"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"isVisible":true
},
{
"id": "Reactive",
"id": "reactive",
"name": {
"text": "Data - Reactive Extensions"
},
Expand All @@ -141,6 +141,18 @@
},
"defaultValue": "true",
"isVisible":true
},
{
"id": "cpm",
"name": {
"text": "Central Package Management"
},
"description":
{
"text": "Enables Central Package Management - packages are versioned in central Directory.Packages.props file"
},
"defaultValue": "false",
"isVisible":false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
"defaultValue": "true",
"description": "Whether or not to use Reactive extensions"
},
"cpm": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false",
"description": "Whether or not to use Central Package Management - package versions are via central Directory.Packages.props file"
},
"mobile": {
"type": "computed",
"dataType": "bool",
Expand Down Expand Up @@ -154,6 +160,10 @@
"condition": "tests",
"path": "MyExtensionsApp.UITests\\MyExtensionsApp.UITests.csproj"
},
{
"condition": "cpm",
"path": "Directory.Packages.props"
},
{
"condition": "mobile",
"path": "MyExtensionsApp.Mobile\\MyExtensionsApp.Mobile.csproj"
Expand Down Expand Up @@ -263,6 +273,29 @@
"MyExtensionsApp.UITests/**/*"
]
},
{
"condition": "(!cpm)",
"exclude": [
"MyExtensionsApp//MyExtensionsApp.csproj",
"MyExtensionsApp.Mobile//MyExtensionsApp.Mobile.csproj",
"MyExtensionsApp.Skia.Gtk//MyExtensionsApp.Skia.Gtk.csproj",
"MyExtensionsApp.Skia.Linux.FrameBuffer//MyExtensionsApp.Skia.Linux.FrameBuffer.csproj",
"MyExtensionsApp.Skia.WPF//MyExtensionsApp.Skia.WPF.csproj",
"MyExtensionsApp.Tests//MyExtensionsApp.Tests.csproj",
"MyExtensionsApp.UITests//MyExtensionsApp.UITests.csproj",
"MyExtensionsApp.Wasm//MyExtensionsApp.Wasm.csproj",
"MyExtensionsApp.Windows//MyExtensionsApp.Windows.csproj",
"Directory.Build.props",
"Directory.Packages.props"
]
},
{
"condition": "(cpm)",
"exclude": [
"**/*.nocpm.props",
"**/*.nocpm.csproj"
]
},
{
"condition": "(!vscode)",
"exclude": [
Expand All @@ -275,6 +308,13 @@
"MyExtensionsApp.Wasm/manifest.json",
"MyExtensionsApp.Wasm/Assets/AppIcon-*"
]
},
{
"condition": "(!cpm)",
"rename": {
".nocpm.csproj": ".csproj",
"Directory.Build.nocpm.props": "Directory.Build.props"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project ToolsVersion="15.0">
<PropertyGroup>
<LangVersion>10.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<DebugType>portable</DebugType>
<DebugSymbols>True</DebugSymbols>
<SynthesizeLinkMetadata>true</SynthesizeLinkMetadata>

<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);Uno0001;CS1998;CA1416;NU1507</NoWarn>
</PropertyGroup>

<ItemGroup>
<!--This override is used to validate the use of specific version of the C# Compiler-->
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.2.0" PrivateAssets="all" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!--#if (android)
<TargetFrameworks>$(TargetFrameworks);net6.0-android</TargetFrameworks>
#endif -->
<!--#if (ios)
<TargetFrameworks>$(TargetFrameworks);net6.0-ios</TargetFrameworks>
#endif -->
<!--#if (macos)
<TargetFrameworks>$(TargetFrameworks);net6.0-macos</TargetFrameworks>
#endif -->
<!--#if (maccatalyst)
<TargetFrameworks>$(TargetFrameworks);net6.0-maccatalyst</TargetFrameworks>
#endif -->
<SingleProject>true</SingleProject>
<OutputType>Exe</OutputType>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-ios'">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">maccatalyst-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-macos'">osx-x64</RuntimeIdentifier>
<!-- Debugger workaround https://github.com/dotnet/maui-samples/blob/8aa6b8780b12e97b157514c3bdc54bb4a13001cd/HelloMacCatalyst/HelloMacCatalyst.csproj#L7 -->
<!-- <MtouchExtraArgs Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">$(MtouchExtraArgs) -setenv:MONO_THREADS_SUSPEND=preemptive</MtouchExtraArgs> -->
<!-- Required for C# Hot Reload -->
<UseInterpreter Condition="'$(Configuration)' == 'Debug' and '$(TargetFramework)' != 'net6.0-maccatalyst'">True</UseInterpreter>
<IsUnoHead>true</IsUnoHead>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)'=='net6.0-macos'">10.14</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.WinUI" Version="4.6.0-dev.962" />
<PackageReference Include="Uno.WinUI.RemoteControl" Version="4.6.0-dev.962" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.6.0-dev.962" />
<PackageReference Include="Uno.Material.WinUI" Version="2.4.0-dev.42"/>
<PackageReference Include="Uno.Toolkit.WinUI.Material" Version="2.4.0-dev.99"/>
<PackageReference Include="Uno.Toolkit.WinUI" Version="2.4.0-dev.99"/>
<PackageReference Include="Uno.Extensions.Authentication.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Hosting.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Localization.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Logging.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation.Toolkit.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Authentication" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Configuration" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Core" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Hosting" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Http" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Http.Refit" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Localization" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Logging.Serilog" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization.Http" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization.Refit" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Reactive" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Reactive.WinUI" Version="255.255.255.255"/>
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)'=='net6.0-android'">
<ItemGroup>
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0.4"/>
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.36" />
</ItemGroup>
<ItemGroup>
<AndroidEnvironment Include="Android/environment.conf" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-ios'">
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-ios'">
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<!-- https://github.com/xamarin/xamarin-macios/issues/14812 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.4.0" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-maccatalyst'">
<PropertyGroup>
<!-- Configure the GC -->
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<!-- Required for unknown crash as of .NET 6 Mobile Preview 13 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
<!-- https://github.com/xamarin/xamarin-macios/issues/14812 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>
<!-- Full globalization is required for Uno -->
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.4.0"/>
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-macos'">
<PropertyGroup>
</PropertyGroup>
</When>
</Choose>
<ItemGroup>
<ProjectReference Include="..\MyExtensionsApp\MyExtensionsApp.csproj" />
</ItemGroup>

<Import Project="..\MyExtensionsApp.UI\MyExtensionsApp.UI.projitems" Label="Shared" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup Condition="exists('..\MyExtensionsApp.Windows')">
<EmbeddedResource Include="..\MyExtensionsApp.Windows\Package.appxmanifest" LogicalName="Package.appxmanifest" />
<Content Include="..\MyExtensionsApp.Windows\Images\StoreLogo.png" Link="Assets\StoreLogo.png" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Include="..\MyExtensionsApp.UI\**\*.xaml" />
</ItemGroup>

<ItemGroup>
<Content Include="Assets\Fonts\uno-fluentui-assets.ttf" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.2" />
<PackageReference Include="SkiaSharp.Skottie" Version="2.88.2" />
<PackageReference Include="Uno.WinUI.Skia.Gtk" Version="4.6.0-dev.962" />
<PackageReference Include="Uno.WinUI.RemoteControl" Version="4.6.0-dev.962" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.6.0-dev.962" />
<PackageReference Include="Uno.Material.WinUI" Version="2.4.0-dev.42"/>
<PackageReference Include="Uno.Toolkit.WinUI.Material" Version="2.4.0-dev.99"/>
<PackageReference Include="Uno.Toolkit.WinUI" Version="2.4.0-dev.99"/>
<PackageReference Include="Uno.Extensions.Authentication.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Hosting.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Localization.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Logging.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation.Toolkit.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Authentication" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Configuration" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Core" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Hosting" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Http" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Http.Refit" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Localization" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Logging.Serilog" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization.Http" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization.Refit" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Reactive" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Reactive.WinUI" Version="255.255.255.255"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyExtensionsApp\MyExtensionsApp.csproj" />
</ItemGroup>

<Import Project="..\MyExtensionsApp.UI\MyExtensionsApp.UI.projitems" Label="Shared" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup Condition="exists('..\MyExtensionsApp.Windows')">
<EmbeddedResource Include="..\MyExtensionsApp.Windows\Package.appxmanifest" LogicalName="Package.appxmanifest" />
<Content Include="..\MyExtensionsApp.Windows\Images\StoreLogo.png" Link="Assets\StoreLogo.png" />
<Content Include="Assets\Fonts\uno-fluentui-assets.ttf" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Include="..\MyExtensionsApp.UI\**\*.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.2" />
<PackageReference Include="SkiaSharp.Skottie" Version="2.88.2" />
<PackageReference Include="Uno.WinUI.Skia.Linux.FrameBuffer" Version="4.6.0-dev.962" />
<PackageReference Include="Uno.WinUI.RemoteControl" Version="4.6.0-dev.962" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.6.0-dev.962" />
<PackageReference Include="Uno.Material.WinUI" Version="2.4.0-dev.42"/>
<PackageReference Include="Uno.Toolkit.WinUI.Material" Version="2.4.0-dev.99"/>
<PackageReference Include="Uno.Toolkit.WinUI" Version="2.4.0-dev.99"/>
<PackageReference Include="Uno.Extensions.Authentication.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Hosting.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Localization.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Logging.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation.Toolkit.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation.WinUI" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Authentication" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Configuration" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Core" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Hosting" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Http" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Http.Refit" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Localization" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Logging.Serilog" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Navigation" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization.Http" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Serialization.Refit" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Reactive" Version="255.255.255.255"/>
<PackageReference Include="Uno.Extensions.Reactive.WinUI" Version="255.255.255.255"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyExtensionsApp\MyExtensionsApp.csproj" />
</ItemGroup>

<Import Project="..\MyExtensionsApp.UI\MyExtensionsApp.UI.projitems" Label="Shared" />
</Project>
Loading

0 comments on commit c4e8944

Please sign in to comment.