|
101 | 101 | <Error Condition="'$(TestRunExitCode)' != '0'" Text="$(TestRunErrorMessage)" /> |
102 | 102 | </Target> |
103 | 103 |
|
104 | | - <!-- Generate a self-contained app bundle for Android with tests. |
105 | | - This target is executed once build is done for a test lib (after CopyFilesToOutputDirectory target) --> |
106 | | - <UsingTask TaskName="AndroidAppBuilderTask" |
107 | | - AssemblyFile="$(AndroidAppBuilderDir)AndroidAppBuilder.dll" /> |
108 | | - <Target Condition="'$(TargetOS)' == 'Android'" Name="BundleTestAndroidApp" AfterTargets="CopyFilesToOutputDirectory"> |
109 | | - <PropertyGroup> |
110 | | - <BundleDir>$(OutDir)\Bundle</BundleDir> |
111 | | - <AndroidAbi Condition="'$(TargetArchitecture)'=='arm64'">arm64-v8a</AndroidAbi> |
112 | | - <AndroidAbi Condition="'$(TargetArchitecture)'=='arm'">armeabi</AndroidAbi> |
113 | | - <AndroidAbi Condition="'$(TargetArchitecture)'=='x64'">x86_64</AndroidAbi> |
114 | | - <AndroidAbi Condition="'$(AndroidAbi)'==''">$(TargetArchitecture)</AndroidAbi> |
115 | | - </PropertyGroup> |
116 | | - <!-- TEMP: We need to copy additional stuff into $(OutDir)\Bundle |
117 | | - 1) The whole BCL |
118 | | - 2) Test Runner (with xharness client-side lib) |
119 | | - --> |
120 | | - <ItemGroup> |
121 | | - <TestBinaries Include="$(OutDir)\*.*"/> |
122 | | - <AndroidTestRunnerBinaries Include="$(AndroidTestRunnerDir)*.*" /> |
123 | | - <BclBinaries Include="$(RuntimePackLibDir)\*.*" |
124 | | - Exclude="$(RuntimePackLibDir)\System.Runtime.WindowsRuntime.dll" /> |
125 | | - <BclBinaries Include="$(RuntimePackNativeDir)\*.*" Exclude="$(RuntimePackNativeDir)\libmono.dylib" /> |
126 | | - |
127 | | - <!-- remove PDBs and DBGs to save some space until we integrate ILLink --> |
128 | | - <BclBinaries Remove="$(RuntimePackLibDir)\*.pdb" /> |
129 | | - <BclBinaries Remove="$(RuntimePackLibDir)\*.dbg" /> |
130 | | - </ItemGroup> |
131 | | - |
132 | | - <Error Condition="'@(AndroidTestRunnerBinaries)' == ''" Text="Could not find AndroidTestRunner in $(AndroidTestRunnerDir)" /> |
133 | | - <Error Condition="!Exists('$(RuntimePackRidDir)')" Text="RuntimePackRidDir=$(RuntimePackRidDir) doesn't exist" /> |
134 | | - <RemoveDir Directories="$(BundleDir)" /> |
135 | | - <Copy SourceFiles="@(TestBinaries)" DestinationFolder="$(BundleDir)" SkipUnchangedFiles="true"/> |
136 | | - <Copy SourceFiles="@(AndroidTestRunnerBinaries)" DestinationFolder="$(BundleDir)\%(RecursiveDir)" SkipUnchangedFiles="true"/> |
137 | | - <Copy SourceFiles="@(BclBinaries)" DestinationFolder="$(BundleDir)\%(RecursiveDir)" SkipUnchangedFiles="true"/> |
138 | | - |
139 | | - <!-- TEMP: consume OpenSSL binaries from external sources via env. variables --> |
140 | | - <Copy Condition="'$(AndroidOpenSslCryptoLib)' != ''" |
141 | | - SourceFiles="$(AndroidOpenSslCryptoLib)" |
142 | | - DestinationFolder="$(BundleDir)" SkipUnchangedFiles="true"/> |
143 | | - <Copy Condition="'$(AndroidOpenSslLib)' != ''" |
144 | | - SourceFiles="$(AndroidOpenSslLib)" |
145 | | - DestinationFolder="$(BundleDir)" SkipUnchangedFiles="true"/> |
146 | | - |
147 | | - <WriteLinesToFile File="$(BundleDir)\xunit-excludes.txt" Lines="$(_withoutCategories.Replace(';', '%0dcategory='))" /> |
148 | | - |
149 | | - <AndroidAppBuilderTask |
150 | | - Abi="$(AndroidAbi)" |
151 | | - ProjectName="$(AssemblyName)" |
152 | | - MonoRuntimeHeaders="$(RuntimePackNativeDir)\include\mono-2.0" |
153 | | - MainLibraryFileName="AndroidTestRunner.dll" |
154 | | - OutputDir="$(BundleDir)" |
155 | | - SourceDir="$(BundleDir)"> |
156 | | - <Output TaskParameter="ApkPackageId" PropertyName="ApkPackageId" /> |
157 | | - <Output TaskParameter="ApkBundlePath" PropertyName="ApkBundlePath" /> |
158 | | - </AndroidAppBuilderTask> |
159 | | - <Message Importance="High" Text="PackageId: $(ApkPackageId)"/> |
160 | | - <Message Importance="High" Text="Instrumentation: net.dot.MonoRunner"/> |
161 | | - <Message Importance="High" Text="Apk: $(ApkBundlePath)"/> |
162 | | - </Target> |
163 | | - |
164 | | - <!-- Generate a self-contained app bundle for iOS with tests. |
165 | | - This target is executed once build is done for a test lib (after CopyFilesToOutputDirectory target) --> |
166 | | - <UsingTask TaskName="AppleAppBuilderTask" |
167 | | - AssemblyFile="$(AppleAppBuilderDir)AppleAppBuilder.dll" /> |
168 | | - <Target Condition="'$(TargetOS)' == 'iOS'" Name="BundleTestAppleApp" AfterTargets="CopyFilesToOutputDirectory"> |
169 | | - <PropertyGroup> |
170 | | - <BundleDir>$(OutDir)\Bundle</BundleDir> |
171 | | - </PropertyGroup> |
172 | | - <!-- We need to copy additional stuff into $(OutDir)\Bundle |
173 | | - 1) The whole BCL |
174 | | - 2) Test Runner (with xharness client-side lib) |
175 | | - --> |
176 | | - <ItemGroup> |
177 | | - <TestBinaries Include="$(OutDir)*.*"/> |
178 | | - <AppleTestRunnerBinaries Include="$(AppleTestRunnerDir)*.*" /> |
179 | | - <BclBinaries Include="$(RuntimePackLibDir)*.*" Exclude="$(RuntimePackLibDir)\System.Runtime.WindowsRuntime.dll" /> |
180 | | - <BclBinaries Include="$(RuntimePackNativeDir)*.*" Exclude="$(RuntimePackNativeDir)\libmono.dylib" /> <!-- we use static libmono.a --> |
181 | | - |
182 | | - <!-- remove PDBs to save some space until we integrate ILLink --> |
183 | | - <BclBinaries Remove="$(RuntimePackLibDir)\*.pdb" /> |
184 | | - </ItemGroup> |
185 | | - <Error Condition="'@(AppleTestRunnerBinaries)' == ''" Text="Could not find AppleTestRunner in $(AppleTestRunnerDir) doesn't exist" /> |
186 | | - <Error Condition="!Exists('$(RuntimePackRidDir)')" Text="RuntimePackRidDir=$(RuntimePackRidDir) doesn't exist" /> |
187 | | - <RemoveDir Directories="$(BundleDir)" /> |
188 | | - <Copy SourceFiles="@(TestBinaries)" DestinationFolder="$(BundleDir)" SkipUnchangedFiles="true"/> |
189 | | - <Copy SourceFiles="@(AppleTestRunnerBinaries)" DestinationFolder="$(BundleDir)\%(RecursiveDir)" SkipUnchangedFiles="true"/> |
190 | | - <Copy SourceFiles="@(BclBinaries)" DestinationFolder="$(BundleDir)\%(RecursiveDir)" SkipUnchangedFiles="true"/> |
191 | | - |
192 | | - <WriteLinesToFile File="$(BundleDir)\xunit-excludes.txt" Lines="$(_withoutCategories.Replace(';', '%0dcategory='))" /> |
193 | | - <!-- Run App bundler, it should AOT libs (if needed), link all native bits, compile simple UI (written in ObjC) |
194 | | - and produce an app bundle (with xcode project) --> |
195 | | - <AppleAppBuilderTask |
196 | | - Arch="$(TargetArchitecture)" |
197 | | - ProjectName="$(AssemblyName)" |
198 | | - MonoRuntimeHeaders="$(RuntimePackNativeDir)\include\mono-2.0" |
199 | | - CrossCompiler="$(RuntimePackNativeDir)\cross\mono-aot-cross" |
200 | | - MainLibraryFileName="AppleTestRunner.dll" |
201 | | - UseConsoleUITemplate="True" |
202 | | - GenerateXcodeProject="True" |
203 | | - BuildAppBundle="True" |
204 | | - Optimized="True" |
205 | | - UseLlvm="$(MonoEnableLLVM)" |
206 | | - LlvmPath="$(RuntimePackNativeDir)\cross" |
207 | | - DevTeamProvisioning="$(DevTeamProvisioning)" |
208 | | - OutputDirectory="$(BundleDir)" |
209 | | - AppDir="$(BundleDir)"> |
210 | | - <Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" /> |
211 | | - <Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" /> |
212 | | - </AppleAppBuilderTask> |
213 | | - <Message Importance="High" Text="Xcode: $(XcodeProjectPath)"/> |
214 | | - <Message Importance="High" Text="App: $(AppBundlePath)"/> |
215 | | - <Error Condition="$(TargetArchitecture.StartsWith('arm')) and '$(DevTeamProvisioning)' == ''" |
216 | | - Text="'DevTeamProvisioning' shouldn't be empty for arm64" /> |
217 | | - <!-- This app is now can be consumed by xharness CLI to deploy on a device or simulator --> |
218 | | - </Target> |
219 | | - |
| 104 | + <Import Project="$(MSBuildThisFileDirectory)tests.mobile.targets" Condition="'$(TargetsMobile)' == 'true'" /> |
220 | 105 | <Import Project="$(MSBuildThisFileDirectory)xunit\xunit.targets" Condition="'$(TestFramework)' == 'xunit'" /> |
221 | 106 |
|
222 | 107 | <!-- Main test targets --> |
|
0 commit comments