Skip to content

Commit 88f723b

Browse files
authored
[build] Update UpdateApkSizeReference scripts (#7168)
Add `build-tools/scripts/UpdateApkSizeReference.sh`, a *nix shell script which updates the `*.apkdesc` files within `src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base`. Update `build-tools/scripts/UpdateApkSizeReference.ps1` to use the correct test names, since the Unit tests were moved to a new class.
1 parent 8d22eed commit 88f723b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Documentation/project-docs/ApkSizeRegressionChecks.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ are named like this:
4141
The new reference files can be obtained from the test results
4242
archive - artifact of the given CI build (preferred method).
4343
Or they can be obtained from local build using
44-
the `build-tools/scripts/UpdateApkSizeReference.ps1` script.
44+
the `build-tools/scripts/UpdateApkSizeReference.ps1` script
45+
or the `build-tools/scripts/UpdateApkSizeReference.sh` script
46+
if you are on MacOS or *nix.
4547

4648
The thresholds for these checks are set
4749
in `src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs`

build-tools/scripts/UpdateApkSizeReference.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ if (-not (Test-Path bin/Release)) {
88
Write-Output "Building xabuild"
99
msbuild /p:Configuration=Release /restore .\tools\xabuild\xabuild.csproj
1010
Write-Output "Building legacy BuildReleaseArm64 tests"
11-
msbuild /p:Configuration=Release Xamarin.Android.sln /t:RunNunitTests /p:TEST="Xamarin.Android.Build.Tests.BuildTest.BuildReleaseArm64"
11+
msbuild /p:Configuration=Release Xamarin.Android.sln /t:RunNunitTests /p:TEST="Xamarin.Android.Build.Tests.BuildTest2.BuildReleaseArm64"
1212
Write-Output "Building DotNet BuildReleaseArm64 tests"
13-
bin\Release\dotnet\dotnet test -p:Configuration=Release --filter BuildTest.BuildReleaseArm64 .\bin\TestRelease\net6.0\Xamarin.Android.Build.Tests.dll
13+
bin\Release\dotnet\dotnet test -p:Configuration=Release --filter=Name~BuildReleaseArm64 .\bin\TestRelease\net6.0\Xamarin.Android.Build.Tests.dll
1414
Write-Output "Updating reference files"
1515
Copy-Item -Verbose bin\TestRelease\BuildReleaseArm64*.apkdesc -Destination src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Resources\Base\
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
./build-tools/scripts/nunit3-console bin/TestRelease/net472/Xamarin.Android.Build.Tests.dll --test=Xamarin.Android.Build.Tests.BuildTest2.BuildReleaseArm64
3+
./dotnet-local.sh test bin/TestRelease/net6.0/Xamarin.Android.Build.Tests.dll --filter=Name~BuildReleaseArm64
4+
cp bin/TestRelease/BuildReleaseArm64*.apkdesc src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/

0 commit comments

Comments
 (0)