Fix Mac project, fix Android icon test

mac
Miepee 3 years ago
parent b8087c8ed2
commit ff3790f385

@ -2,9 +2,10 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0-macos</TargetFramework>
<RollForward>LatestMajor</RollForward>
<RuntimeIdentifiers>osx-x64;osx-arm64</RuntimeIdentifiers>
<SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
<RuntimeIdentifiers>osx-x64;osx-arm64</RuntimeIdentifiers>
</PropertyGroup>
@ -14,7 +15,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Eto.Platform.Mac64" Version="2.7.0" />
<PackageReference Include="Eto.Platform.macOS" Version="2.7.0" />
</ItemGroup>
</Project>

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!--TODO: UndertaleModLib needs to properly support .net standard! -->
<!--UndertaleModLib needs to properly support .net standard! -->
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>10</LangVersion>
@ -43,4 +43,4 @@
</Compile>
</ItemGroup>
</Project>
</Project>

@ -407,7 +407,8 @@ public abstract class RawMods : ModsBase
pStartInfo = new ProcessStartInfo
{
FileName = bin,
Arguments = args + "\"" + apktool + "\" b \"" + apkDir + "\" -o \"" + extractDirectory + "/build.apk" + "\"",
// Use aapt2 and nc are to ensure that aapt doesn't preprocess images before using then. Needed for tests.
Arguments = args + "\"" + apktool + "\" b \"" + apkDir + "\" -o \"" + extractDirectory + "/build.apk" + "\" --use-aapt2 -nc ",
CreateNoWindow = true
};
p = new Process { StartInfo = pStartInfo };

@ -11,6 +11,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

@ -1,5 +1,7 @@
using System.IO.Compression;
using GlennLib;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using UndertaleModLib;
using Xunit;
using Xunit.Abstractions;
@ -705,8 +707,7 @@ public class RawModsTests : IDisposable
CheckIconsWithPath(inputZip);
}
// TODO: see skip reason
[Theory(Skip = "Currently buggy, due to probably an apktool bug.")]
[Theory]
[InlineData("./GameWin.zip")]
[InlineData("./GameLin.zip")]
[InlineData("./GameMac.zip")]
@ -727,6 +728,7 @@ public class RawModsTests : IDisposable
var outputZip = testTempDir + Guid.NewGuid();
var newExtract = testTempDir + Guid.NewGuid() + "/";
var recoloredIcon = testTempDir + Guid.NewGuid();
// With default icons
void CheckIconsWithPath(string? path)
@ -754,7 +756,13 @@ public class RawModsTests : IDisposable
}
CheckIconsWithPath(null);
CheckIconsWithPath(inputZip);
var imagePath = RawMods.GetProperPathToBuiltinIcons(nameof(Resources.icon), null);
using (Image img = Image.Load(imagePath))
{
img.Mutate(c => c.Hue(180));
img.SaveAsPng(recoloredIcon);
}
CheckIconsWithPath(recoloredIcon);
}
#endregion

Loading…
Cancel
Save