PS: Skip Android builds if toolchain unavailable rather than aborting
This commit is contained in:
@@ -46,6 +46,7 @@ $mscorlib = (gci "$UnityPath\Mono*\lib\mono\unityaot\mscorlib.dll")[0].FullName
|
|||||||
# https://docs.unity3d.com/2019.1/Documentation/Manual/android-sdksetup.html
|
# https://docs.unity3d.com/2019.1/Documentation/Manual/android-sdksetup.html
|
||||||
$AndroidPlayer = $UnityPath + '\PlaybackEngines\AndroidPlayer'
|
$AndroidPlayer = $UnityPath + '\PlaybackEngines\AndroidPlayer'
|
||||||
$AndroidNDK = $AndroidPlayer + '\NDK'
|
$AndroidNDK = $AndroidPlayer + '\NDK'
|
||||||
|
$AndroidBuildEnabled = $True
|
||||||
|
|
||||||
$ErrorActionPreference = "Continue"
|
$ErrorActionPreference = "Continue"
|
||||||
|
|
||||||
@@ -61,8 +62,8 @@ if (!$UnityPath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(Test-Path -Path $AndroidNDK -PathType container)) {
|
if (!(Test-Path -Path $AndroidNDK -PathType container)) {
|
||||||
Write-Error "Could not find Android NDK at '$AndroidNDK' - aborting"
|
echo "Could not find Android NDK at '$AndroidNDK'"
|
||||||
Exit
|
$AndroidBuildEnabled = $False
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$il2cpp) {
|
if (!$il2cpp) {
|
||||||
@@ -76,16 +77,21 @@ if (!$mscorlib) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(Test-Path -Path $AndroidPlayer -PathType container)) {
|
if (!(Test-Path -Path $AndroidPlayer -PathType container)) {
|
||||||
Write-Error "Could not find Unity Android build support - aborting"
|
echo "Could not find Unity Android build support at '$AndroidPlayer'"
|
||||||
Exit
|
$AndroidBuildEnabled = $False
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Using C# compiler at '$CSC'"
|
echo "Using C# compiler at '$CSC'"
|
||||||
echo "Using Unity installation at '$UnityPath'"
|
echo "Using Unity installation at '$UnityPath'"
|
||||||
echo "Using IL2CPP toolchain at '$il2cpp'"
|
echo "Using IL2CPP toolchain at '$il2cpp'"
|
||||||
echo "Using Unity mscorlib assembly at '$mscorlib'"
|
echo "Using Unity mscorlib assembly at '$mscorlib'"
|
||||||
echo "Using Android player at '$AndroidPlayer'"
|
|
||||||
echo "Using Android NDK at '$AndroidNDK'"
|
if ($AndroidBuildEnabled) {
|
||||||
|
echo "Using Android player at '$AndroidPlayer'"
|
||||||
|
echo "Using Android NDK at '$AndroidNDK'"
|
||||||
|
} else {
|
||||||
|
echo "Android build is disabled due to missing components"
|
||||||
|
}
|
||||||
|
|
||||||
# Workspace paths
|
# Workspace paths
|
||||||
$src = "$PSScriptRoot/TestSources"
|
$src = "$PSScriptRoot/TestSources"
|
||||||
@@ -153,6 +159,7 @@ gci $asm -filter $assemblies | % {
|
|||||||
rm -Force -Recurse $bin/$name/Data
|
rm -Force -Recurse $bin/$name/Data
|
||||||
|
|
||||||
# ARMv7
|
# ARMv7
|
||||||
|
if ($AndroidBuildEnabled) {
|
||||||
$name = "$($_.BaseName)-ARMv7"
|
$name = "$($_.BaseName)-ARMv7"
|
||||||
echo "Running il2cpp for test assembly $name (Android/ARMv7)..."
|
echo "Running il2cpp for test assembly $name (Android/ARMv7)..."
|
||||||
md $bin/$name 2>&1 >$null
|
md $bin/$name 2>&1 >$null
|
||||||
@@ -170,8 +177,10 @@ gci $asm -filter $assemblies | % {
|
|||||||
}
|
}
|
||||||
mv -Force $bin/$name/Data/metadata/global-metadata.dat $bin/$name
|
mv -Force $bin/$name/Data/metadata/global-metadata.dat $bin/$name
|
||||||
rm -Force -Recurse $bin/$name/Data
|
rm -Force -Recurse $bin/$name/Data
|
||||||
|
}
|
||||||
|
|
||||||
# ARMv8 / A64
|
# ARMv8 / A64
|
||||||
|
if ($AndroidBuildEnabled) {
|
||||||
$name = "$($_.BaseName)-ARM64"
|
$name = "$($_.BaseName)-ARM64"
|
||||||
echo "Running il2cpp for test assembly $name (Android/ARM64)..."
|
echo "Running il2cpp for test assembly $name (Android/ARM64)..."
|
||||||
md $bin/$name 2>&1 >$null
|
md $bin/$name 2>&1 >$null
|
||||||
@@ -189,6 +198,7 @@ gci $asm -filter $assemblies | % {
|
|||||||
}
|
}
|
||||||
mv -Force $bin/$name/Data/metadata/global-metadata.dat $bin/$name
|
mv -Force $bin/$name/Data/metadata/global-metadata.dat $bin/$name
|
||||||
rm -Force -Recurse $bin/$name/Data
|
rm -Force -Recurse $bin/$name/Data
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate test stubs
|
# Generate test stubs
|
||||||
|
|||||||
Reference in New Issue
Block a user