if [ "$?" != "0" ]; then
exit 1;
fi
+elif [ "$1" = "Android" ]; then
+ if [ -z "${ANDROID_OPENSSL_AAR}" ]; then
+ echo "The ANDROID_OPENSSL_AAR variable must be set!"
+ exit 1;
+ fi
+ if [ -d "${ANDROID_OPENSSL_AAR}" ]; then
+ exit 0;
+ fi
+ OPENSSL_VER=1.1.1g-alpha-1
+ curl https://maven.google.com/com/android/ndk/thirdparty/openssl/${OPENSSL_VER}/openssl-${OPENSSL_VER}.aar -L --output /tmp/openssl.zip
+ unzip /tmp/openssl.zip -d "${ANDROID_OPENSSL_AAR}" && rm -rf /tmp/openssl.zip
else
- echo "Must pass \"Linux\", \"tvOS\", \"iOS\" or \"OSX\" as first argument."
+ echo "Must pass \"Linux\", \"Android\", \"tvOS\", \"iOS\" or \"OSX\" as first argument."
exit 1
fi
${{ if ne(parameters.isOfficialBuild, true) }}:
value: ''
+ - ${{ if eq(parameters.osGroup, 'Android') }}:
+ - name: ANDROID_OPENSSL_AAR
+ value: /tmp/openssl-android
+
- ${{ each variable in parameters.variables }}:
- ${{ variable }}
- ${{ if eq(parameters.isOfficialBuild, true) }}:
- template: /eng/pipelines/common/restore-internal-tools.yml
- - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
+ - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'Android') }}:
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO
displayName: Install Build Dependencies
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter)
displayName: Build product
- - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:
+ - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'Android') }}:
- script: |
du -sh $(Build.SourcesDirectory)/*
df -h
${{ if eq(parameters.jobParameters.pool, '') }}:
pool:
# Public Linux Build Pool
- ${{ if and(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Browser'), eq(variables['System.TeamProject'], 'public')) }}:
+ ${{ if and(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Browser', 'Android'), eq(variables['System.TeamProject'], 'public')) }}:
name: NetCorePublic-Pool
queue: BuildPool.Ubuntu.1604.Amd64.Open
# Official Build Linux Pool
- ${{ if and(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Browser'), ne(variables['System.TeamProject'], 'public')) }}:
+ ${{ if and(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Browser', 'Android'), ne(variables['System.TeamProject'], 'public')) }}:
name: NetCoreInternal-Pool
queue: BuildPool.Ubuntu.1604.Amd64
- OSX.1014.Amd64.Open
- OSX.1015.Amd64.Open
+ # Android
+ - ${{ if in(parameters.platform, 'Android_x86', 'Android_x64') }}:
+ - Ubuntu.1804.Amd64.Android.Open
+
# iOS x64/x86
- ${{ if in(parameters.platform, 'iOS_x64', 'iOS_x86') }}:
- OSX.1015.Amd64.Open
buildConfig: Release
runtimeFlavor: mono
platforms:
- - Android_x64
- Android_arm
- tvOS_arm64
- iOS_arm
buildConfig: Release
runtimeFlavor: mono
platforms:
+ - Android_x64
- iOS_x64
variables:
# map dependencies variables to local variables
-#!/usr/bin/env bash
+#!/usr/bin/env bash
EXECUTION_DIR=$(dirname $0)
-TEST_NAME=$1
-TARGET_ARCH=$2
-APK=$EXECUTION_DIR/bin/$TEST_NAME.apk
+cd $EXECUTION_DIR
# it doesn't support parallel execution yet, so, here is a hand-made semaphore:
LOCKDIR=/tmp/androidtests.lock
XHARNESS_OUT="$EXECUTION_DIR/xharness-output"
-dotnet xharness android test --instrumentation="net.dot.MonoRunner" \
- --package-name="net.dot.$TEST_NAME" \
- --app=$APK --output-directory=$XHARNESS_OUT -v
+if [ ! -z "$XHARNESS_CLI_PATH" ]; then
+ # When running in CI, we only have the .NET runtime available
+ # We need to call the XHarness CLI DLL directly via dotnet exec
+ HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH"
+else
+ HARNESS_RUNNER="dotnet xharness"
+fi
+
+# RunCommands defined in tests.mobile.targets
+[[RunCommands]]
_exitCode=$?
-echo "Xharness artifacts: $XHARNESS_OUT"
+echo "XHarness artifacts: $XHARNESS_OUT"
exit $_exitCode
<JSEngineArgs Condition="'$(JSEngine)' == 'V8'">$(JSEngineArgs) --engine-arg=--stack-trace-limit=1000</JSEngineArgs>
</PropertyGroup>
- <ItemGroup>
- <RunScriptCommands Include="TARGET_ARCH=$(TargetArchitecture)" />
- </ItemGroup>
-
<PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<!-- We need to set this in order to get extensibility on xunit category traits and other arguments we pass down to xunit via MSBuild properties -->
<RunScriptCommand>$HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run WasmTestRunner.dll $(AssemblyName).dll</RunScriptCommand>
</PropertyGroup>
+ <PropertyGroup Condition="'$(TargetOS)' == 'Android'">
+ <RunScriptCommand>$HARNESS_RUNNER android test --instrumentation="net.dot.MonoRunner" --package-name="net.dot.$(AssemblyName)" --app=$EXECUTION_DIR/bin/$(TestProjectName).apk --output-directory=$XHARNESS_OUT -v --</RunScriptCommand>
+ </PropertyGroup>
<ItemGroup>
<RunScriptCommands Include="TEST_NAME=$(TestProjectName)" />
<RunScriptCommands Include="TARGET_ARCH=$(TargetArchitecture)" />
<Output TaskParameter="ApkPackageId" PropertyName="ApkPackageId" />
<Output TaskParameter="ApkBundlePath" PropertyName="ApkBundlePath" />
</AndroidAppBuilderTask>
+
<Message Importance="High" Text="PackageId: $(ApkPackageId)"/>
<Message Importance="High" Text="Instrumentation: net.dot.MonoRunner"/>
<Message Importance="High" Text="Apk: $(ApkBundlePath)"/>
+
+ <Copy SourceFiles="$(ApkBundlePath)"
+ DestinationFolder="$(TestArchiveTestsDir)"
+ SkipUnchangedFiles="true"
+ Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'" />
</Target>
<!-- Generate a self-contained app bundle for iOS with tests. -->
<HelixType Condition="'$(TestPackages)' == 'true'">test/functional/packaging/</HelixType>
</PropertyGroup>
- <PropertyGroup Condition="'$(TargetOS)' == 'Browser' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'">
+ <PropertyGroup Condition="'$(TargetOS)' == 'Browser' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'">
<IncludeXHarnessCli>true</IncludeXHarnessCli>
</PropertyGroup>
</XHarnessAppBundleToTest>
</ItemGroup>
+ <ItemGroup Condition="'$(TargetOS)' == 'Android'">
+ <!-- We have to define this temp item list because of a bug in MSBuild that would prevent access %(Filename) right away -->
+ <_apks Include="$(TestArchiveTestsRoot)**/*.apk" />
+ <XHarnessApkToTest Include="@(_apks)">
+ <Targets Condition="'$(TargetArchitecture)' == 'arm'">armeabi-v7a</Targets>
+ <Targets Condition="'$(TargetArchitecture)' == 'arm64'">arm64-v8a</Targets>
+ <Targets Condition="'$(TargetArchitecture)' == 'x64'">x86_64</Targets>
+ <Targets Condition="'$(TargetArchitecture)' == 'x86'">x86</Targets>
+ <AndroidPackageName>net.dot.%(Filename)</AndroidPackageName>
+ <AndroidInstrumentationName>net.dot.MonoRunner</AndroidInstrumentationName>
+ </XHarnessApkToTest>
+ </ItemGroup>
+
<PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<!-- Version number to revision number mapping from http://omahaproxy.appspot.com/ -->
<!-- 84.0.4147.105 is 768962 for example -->
<SeleniumUrl>https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chromedriver_linux64.zip</SeleniumUrl>
</PropertyGroup>
- <ItemGroup Condition="'$(TargetOS)' != 'iOS' and '$(TargetOS)' != 'tvOS'">
+ <ItemGroup Condition="'$(TargetOS)' != 'Android' and '$(TargetOS)' != 'iOS' and '$(TargetOS)' != 'tvOS'">
<HelixCorrelationPayload Include="$(HelixCorrelationPayload)"
Condition="'$(IncludeHelixCorrelationPayload)' == 'true' and '$(TargetOS)' != 'Browser'" />
<HelixCorrelationPayload Include="chromium" Uri="$(ChromiumUrl)" Condition="'$(TargetOS)' == 'Browser'" />
</ItemGroup>
<Message Condition="'$(Scenario)' != ''" Importance="High" Text="Done building Helix work items for scenario $(Scenario). Work item count: @(_WorkItem->Count())" />
- <Message Condition="'$(Scenario)' == '' and ('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS')" Importance="High" Text="Done building Helix work items. Work item count: @(XHarnessAppBundleToTest->Count())" />
- <Message Condition="'$(Scenario)' == '' and '$(TargetOS)' != 'iOS' and '$(TargetOS)' != 'tvOS'" Importance="High" Text="Done building Helix work items. Work item count: @(_WorkItem->Count())" />
+ <Message Condition="'$(Scenario)' == '' and ('$(TargetOS)' == 'Android' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS')" Importance="High" Text="Done building Helix work items. Work item count: @(XHarnessAppBundleToTest->Count())" />
+ <Message Condition="'$(Scenario)' == '' and '$(TargetOS)' != 'Android' and '$(TargetOS)' != 'iOS' and '$(TargetOS)' != 'tvOS'" Importance="High" Text="Done building Helix work items. Work item count: @(_WorkItem->Count())" />
</Target>
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Transactions.Local\tests\System.Transactions.Local.Tests.csproj" />
</ItemGroup>
+ <ItemGroup Condition="'$(TargetOS)' == 'Android' and '$(RunDisabledAndroidTests)' != 'true'">
+ <!-- Tests time out intermittently -->
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Hosting\tests\UnitTests\Microsoft.Extensions.Hosting.Unit.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Tasks.Parallel\tests\System.Threading.Tasks.Parallel.Tests.csproj" />
+
+ <!-- Tests crash -->
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization\tests\Invariant\Invariant.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.FileSystem.Watcher\tests\System.IO.FileSystem.Watcher.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Ports\tests\System.IO.Ports.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection\tests\System.Reflection.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Thread\tests\System.Threading.Thread.Tests.csproj" />
+
+ <!-- OOM killed intermittently -->
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.FileSystem\tests\System.IO.FileSystem.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Numerics\tests\System.Runtime.Numerics.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Serialization.Formatters\tests\System.Runtime.Serialization.Formatters.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Security.Cryptography.Algorithms\tests\System.Security.Cryptography.Algorithms.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Tasks\tests\System.Threading.Tasks.Tests.csproj" />
+
+ <!-- Actual test failures -->
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Console\tests\Microsoft.Extensions.Logging.Console.Tests\Microsoft.Extensions.Logging.Console.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.VisualBasic.Core\tests\Microsoft.VisualBasic.Core.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Collections.Immutable\tests\System.Collections.Immutable.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Collections.NonGeneric\tests\System.Collections.NonGeneric.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Console\tests\System.Console.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Diagnostics.Debug\tests\System.Diagnostics.Debug.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Diagnostics.DiagnosticSource\tests\TestWithConfigSwitches\System.Diagnostics.DiagnosticSource.Switches.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization.Calendars\tests\CalendarTestWithConfigSwitch\System.Globalization.CalendarsWithConfigSwitch.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization\tests\System.Globalization.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Compression\tests\System.IO.Compression.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.IsolatedStorage\tests\System.IO.IsolatedStorage.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Pipes\tests\System.IO.Pipes.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.NetworkInformation\tests\FunctionalTests\System.Net.NetworkInformation.Functional.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Primitives\tests\FunctionalTests\System.Net.Primitives.Functional.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Security\tests\FunctionalTests\System.Net.Security.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Sockets\tests\FunctionalTests\System.Net.Sockets.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Extensions\tests\System.Runtime.Extensions.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices.RuntimeInformation\tests\System.Runtime.InteropServices.RuntimeInformation.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader\tests\DefaultContext\System.Runtime.Loader.DefaultContext.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Security.Cryptography.X509Certificates\tests\System.Security.Cryptography.X509Certificates.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Encoding\tests\System.Text.Encoding.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\System.Text.RegularExpressions.Tests.csproj" />
+ </ItemGroup>
+
<ItemGroup Condition="('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS') and '$(RunDisablediOSTests)' != 'true'">
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.FileProviders.Composite\tests\Microsoft.Extensions.FileProviders.Composite.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.HostFactoryResolver\tests\Microsoft.Extensions.HostFactoryResolver.Tests.csproj" />