Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/pipelines/common/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
provisioning_script: $(provisionator.path)
provisioning_extra_args: $(provisionator.extraArguments)

- pwsh: |
- powershell: |
$(System.DefaultWorkingDirectory)/build.ps1 --target provision --TeamProject="$(System.TeamProject)"
displayName: 'Cake Provision'
condition: eq(variables['provisioningCake'], 'true')
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@

<Target Name="_CopyToNuspecDir" AfterTargets="Build">
<ItemGroup>
<_CopyItems Include="$(TargetDir)*.dll" />
<_CopyItems Include="$(TargetDir)*.dll" Exclude="$(TargetDir)System.*.dll" />
<_CopyItems Include="$(TargetDir)System.CodeDom.dll" />
</ItemGroup>
<Copy SourceFiles="@(_CopyItems)" DestinationFolder="..\..\..\..\.nuspec\" ContinueOnError="true" Retries="0" />
</Target>
Expand Down
10 changes: 8 additions & 2 deletions src/Core/src/Platform/iOS/MauiUIApplicationDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ namespace Microsoft.Maui
{
public class MauiUIApplicationDelegate<TApplication> : UIApplicationDelegate, IUIApplicationDelegate where TApplication : MauiApp
{
public override UIWindow? Window
{
get;
set;
}

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
if (!(Activator.CreateInstance(typeof(TApplication)) is TApplication app))
Expand All @@ -32,15 +38,15 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary l

var content = (window.Page as IView) ?? window.Page.View;

var uiWindow = new UIWindow
Window = new UIWindow
{
RootViewController = new UIViewController
{
View = content.ToNative(window.MauiContext)
}
};

uiWindow.MakeKeyAndVisible();
Window.MakeKeyAndVisible();

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ public IEnumerable<ResizedImageInfo> Generate()
fileInfo.Directory.Create();

Logger.Log("Converting Background SVG to Android Drawable Vector: " + backgroundFile);
var bgConvertErr = Svg2VectorDrawable.Svg2Vector.Convert(backgroundFile, backgroundDestination);
if (!string.IsNullOrEmpty(bgConvertErr))
throw new Svg2AndroidDrawableConversionException(bgConvertErr, backgroundFile);
Svg2VectorDrawable.Svg2Vector.Convert(backgroundFile, backgroundDestination);

var foregroundDestination = Path.Combine(fullIntermediateOutputPath.FullName, "drawable", AppIconName + "_foreground.xml");
fileInfo = new FileInfo(foregroundDestination);
Expand All @@ -72,9 +70,7 @@ public IEnumerable<ResizedImageInfo> Generate()
if (foregroundExists)
{
Logger.Log("Converting Foreground SVG to Android Drawable Vector: " + foregroundFile);
var fgConvertErr = Svg2VectorDrawable.Svg2Vector.Convert(foregroundFile, foregroundDestination);
if (!string.IsNullOrEmpty(fgConvertErr))
throw new Svg2AndroidDrawableConversionException(fgConvertErr, foregroundFile);
Svg2VectorDrawable.Svg2Vector.Convert(foregroundFile, foregroundDestination);
}
else
{
Expand Down
9 changes: 7 additions & 2 deletions src/SingleProject/Resizetizer/src/AppleIconAssetsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.IO;

namespace Microsoft.Maui.Resizetizer
Expand Down Expand Up @@ -48,10 +49,14 @@ public IEnumerable<ResizedImageInfo> Generate()
{
foreach (var idiom in dpi.Idioms)
{
var w = dpi.Size.Value.Width.ToString("0.#", CultureInfo.InvariantCulture);
var h = dpi.Size.Value.Height.ToString("0.#", CultureInfo.InvariantCulture);
var s = dpi.Scale.ToString("0", CultureInfo.InvariantCulture);

appIconImagesJson.Add(new JObject(
new JProperty("idiom", idiom),
new JProperty("size", $"{dpi.Size.Value.Width}x{dpi.Size.Value.Height}"),
new JProperty("scale", dpi.Scale.ToString("0") + "x"),
new JProperty("size", $"{w}x{h}"),
new JProperty("scale", $"{s}x"),
new JProperty("filename", AppIconName + dpi.FileSuffix + ".png")));
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/SingleProject/Resizetizer/src/Resizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ public ResizedImageInfo CopyFile(DpiPath dpi, string inputsFile, bool isAndroid
Logger.Log("Converting SVG to Android Drawable Vector: " + Info.Filename);

// Transform into an android vector drawable
var convertErr = Svg2VectorDrawable.Svg2Vector.Convert(Info.Filename, destination);
if (!string.IsNullOrEmpty(convertErr))
throw new Svg2AndroidDrawableConversionException(convertErr, Info.Filename);
Svg2VectorDrawable.Svg2Vector.Convert(Info.Filename, destination);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ System.Threading.Tasks.Task DoExecute()
}
catch (Exception ex)
{
Log.LogErrorFromException(ex);
Log.LogWarningFromException(ex, true);

throw;
}
Expand Down
4 changes: 2 additions & 2 deletions src/SingleProject/Resizetizer/src/Resizetizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.7.1" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="System.Drawing.Common" Version="4.7.0" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="System.ObjectModel" Version="4.3.0" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="Svg2VectorDrawable.Net" Version="0.1.0" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="Svg2VectorDrawable.Net" Version="0.3.0" GeneratePathProperty="true" PrivateAssets="all" />
</ItemGroup>

<Target Name="_CopyToNuspecDir" AfterTargets="Build">
<ItemGroup>
<_CopyItems Include="$(TargetDir)**\*.dll" />
<_CopyItems Include="$(TargetDir)**\*.dll" Exclude="$(TargetDir)System.*.dll" />
<_CopyItems Include="$(TargetDir)**\*.dylib" />
</ItemGroup>
<Copy SourceFiles="@(_CopyItems)" DestinationFolder="..\..\..\..\.nuspec\%(RecursiveDir)" ContinueOnError="true" Retries="0" />
Expand Down
10 changes: 0 additions & 10 deletions src/SingleProject/Resizetizer/src/SkiaSharpSvgTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@

namespace Microsoft.Maui.Resizetizer
{
public class Svg2AndroidDrawableConversionException : Exception
{
public Svg2AndroidDrawableConversionException(string message, string file) : base ("Failed to Convert SVG to Android Drawable: " + message + " in [" + file + "]")
{
Filename = file;
}

public string Filename { get; }
}

internal class SkiaSharpSvgTools : SkiaSharpTools, IDisposable
{
SKSvg svg;
Expand Down