File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 22using System . Collections . Generic ;
33using System . Diagnostics ;
44using System . IO ;
5+ using System . Runtime . InteropServices ;
56using Microsoft . Build . Framework ;
67using Microsoft . Build . Utilities ;
78
@@ -101,14 +102,19 @@ void ValidateApiCompat (string contractPath) {
101102 string content ;
102103 using ( var genApiProcess = new Process ( ) ) {
103104
104- genApiProcess . StartInfo . FileName = "mono" ;
105+ if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ) {
106+ genApiProcess . StartInfo . FileName = apiCompat ;
107+ genApiProcess . StartInfo . Arguments = $ "{ contractPath } -i { TargetImplementationPath } ";
108+ } else {
109+ genApiProcess . StartInfo . FileName = $ "mono";
110+ genApiProcess . StartInfo . Arguments = $ "{ apiCompat } { contractPath } -i { TargetImplementationPath } ";
111+ }
112+
105113 genApiProcess . StartInfo . UseShellExecute = false ;
106114 genApiProcess . StartInfo . CreateNoWindow = true ;
107115 genApiProcess . StartInfo . RedirectStandardOutput = true ;
108116
109117 // Get api definition for previous Api
110- var argument = $ "{ apiCompat } { contractPath } -i { TargetImplementationPath } ";
111- genApiProcess . StartInfo . Arguments = argument ;
112118 genApiProcess . Start ( ) ;
113119 content = genApiProcess . StandardOutput . ReadToEnd ( ) ;
114120 genApiProcess . WaitForExit ( ) ;
Original file line number Diff line number Diff line change 373373 <ReferenceOutputAssembly >False</ReferenceOutputAssembly >
374374 </ProjectReference >
375375 </ItemGroup >
376- <Target Name =" AfterBuild" >
376+ <ItemGroup >
377+ <ApiCompatibilityReferenceFiles Include =" ../../external/xamarin-android-api-compatibility/reference/*.dll" />
378+ </ItemGroup >
379+ <Target Name =" AfterBuild" Inputs =" $(TargetPath);@(ApiCompatibilityFiles)" Outputs =" $(IntermediateOutputPath)/CheckApiCompatibility.stamp" >
377380 <CheckApiCompatibility
378381 ApiCompatPath =" ../../packages/Microsoft.DotNet.ApiCompat.5.0.0-beta.19554.1/tools/net472/"
379382 ApiLevel =" $(AndroidFrameworkVersion)"
380383 LastStableApiLevel =" $(AndroidLatestStableFrameworkVersion)"
381384 ApiCompatContractPath = " ../../external/xamarin-android-api-compatibility/"
382385 TargetImplementationPath =" $(OutputPath)"
383386 />
387+ <Touch Files =" $(IntermediateOutputPath)/CheckApiCompatibility.stamp" AlwaysCreate =" True" />
388+ <ItemGroup >
389+ <FileWrites Include =" $(IntermediateOutputPath)/CheckApiCompatibility.stamp" />
390+ </ItemGroup >
384391 </Target >
385392</Project >
You can’t perform that action at this time.
0 commit comments