File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed
Xamarin.Android.BuildTools.PrepTasks Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 6
6
<UsingTask AssemblyFile =" $(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\Xamarin.Android.Tools.BootstrapTasks.dll" TaskName =" Xamarin.Android.Tools.BootstrapTasks.RunInstrumentationTests" />
7
7
<UsingTask AssemblyFile =" $(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\Xamarin.Android.Tools.BootstrapTasks.dll" TaskName =" Xamarin.Android.Tools.BootstrapTasks.StartAndroidEmulator" />
8
8
<UsingTask AssemblyFile =" $(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\Xamarin.Android.Tools.BootstrapTasks.dll" TaskName =" Xamarin.Android.Tools.BootstrapTasks.KillProcess" />
9
+ <UsingTask AssemblyFile =" $(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName =" Xamarin.Android.BuildTools.PrepTasks.Sleep" />
9
10
10
11
<PropertyGroup >
11
12
<_TestImageName >XamarinAndroidUnitTestRunner</_TestImageName >
41
42
<Output TaskParameter =" AdbTarget" PropertyName =" _EmuTarget" />
42
43
<Output TaskParameter =" EmulatorProcessId" PropertyName =" _EmuPid" />
43
44
</StartAndroidEmulator >
44
- <Exec
45
+ <Sleep
45
46
Condition =" '$(_ValidAdbTarget)' != 'True' "
46
- Command = " sleep 10 "
47
+ Milliseconds = " 10000 "
47
48
/>
48
49
<Xamarin .Android.Tools.BootstrapTasks.Adb
50
+ EnvironmentVariables =" ADB_TRACE=all"
49
51
Condition =" '$(_ValidAdbTarget)' != 'True' "
50
52
Arguments =" $(_AdbTarget) wait-for-device"
51
53
ToolExe =" $(AdbToolExe)"
52
54
ToolPath =" $(AdbToolPath)"
53
55
/>
56
+ <Sleep
57
+ Condition =" '$(_ValidAdbTarget)' != 'True' "
58
+ Milliseconds =" 1000"
59
+ />
54
60
<Xamarin .Android.Tools.BootstrapTasks.Adb
61
+ EnvironmentVariables =" ADB_TRACE=all"
55
62
Condition =" '$(_ValidAdbTarget)' != 'True' "
56
63
Arguments =" $(_EmuTarget) shell 'counter=0; while [ $counter -lt 60 ] && [ " `getprop sys.boot_completed`" != " 1" ]; do echo Waiting for device to fully boot; sleep 1; let " counter++" ; done'"
57
64
ToolExe =" $(AdbToolExe)"
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Threading ;
3
+
4
+ using Microsoft . Build . Framework ;
5
+ using Microsoft . Build . Utilities ;
6
+
7
+ namespace Xamarin . Android . BuildTools . PrepTasks
8
+ {
9
+ public class Sleep : Task
10
+ {
11
+ public int Milliseconds { get ; set ; }
12
+
13
+ public override bool Execute ( )
14
+ {
15
+ Log . LogMessage ( MessageImportance . Normal , $ "Going to sleep for { Milliseconds } ms") ;
16
+ Thread . Sleep ( Milliseconds ) ;
17
+
18
+ return true ;
19
+ }
20
+ }
21
+ }
Original file line number Diff line number Diff line change 49
49
<Compile Include =" Xamarin.Android.BuildTools.PrepTasks\ReplaceFileContents.cs" />
50
50
<Compile Include =" Xamarin.Android.BuildTools.PrepTasks\PrepareInstall.cs" />
51
51
<Compile Include =" Xamarin.Android.BuildTools.PrepTasks\AcceptAndroidSdkLicenses.cs" />
52
+ <Compile Include =" Xamarin.Android.BuildTools.PrepTasks\Sleep.cs" />
52
53
</ItemGroup >
53
54
<Import Project =" $(MSBuildBinPath)\Microsoft.CSharp.targets" />
54
55
<Import Project =" xa-prep-tasks.targets" />
You can’t perform that action at this time.
0 commit comments