[Mono.Android-Tests] Fix stat(1) arguments on Linux (#801)

macOS uses *BSD command-line tools which often take different parameters
than the Linux ones. This is the case with **stat**(1) which not only expects
different command line parameters but also has different meaning of various
format placeholders (in this case `%z` means "file size in bytes" on macOS
but "file time stamp timezone in human readable format").

This fixes **stat**(1) invocation on Linux.
This commit is contained in:
Marek Habersack 2017-08-31 16:40:12 +02:00 коммит произвёл Jonathan Pryor
Родитель 6b54d6dd26
Коммит 79989b7c3c
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -16,7 +16,8 @@
</ItemGroup>
<Target Name="_RecordApkSizes" AfterTargets="DeployUnitTestApks">
<Delete Files="$(MSBuildThisFileDirectory)..\..\..\TestResult-Mono.Android_Tests-values.csv" Condition=" '$(Configuration)' == 'Debug' " />
<Exec Command="stat -f &quot;stat: %z %N&quot; &quot;$(_MonoAndroidTestApkFile)&quot; > $(_MonoAndroidTestApkSizesInput)" />
<Exec Condition=" '$(HostOS)' == 'Darwin' " Command="stat -f &quot;stat: %z %N&quot; &quot;$(_MonoAndroidTestApkFile)&quot; > $(_MonoAndroidTestApkSizesInput)" />
<Exec Condition=" '$(HostOS)' == 'Linux' " Command="stat -c &quot;stat: %s %N&quot; &quot;$(_MonoAndroidTestApkFile)&quot; > $(_MonoAndroidTestApkSizesInput)" />
<Exec Command="unzip -l &quot;$(_MonoAndroidTestApkFile)&quot; >> $(_MonoAndroidTestApkSizesInput)" />
<ProcessPlotInput InputFilename="$(_MonoAndroidTestApkSizesInput)" ApplicationPackageName="$(_MonoAndroidTestPackage)" ResultsFilename="$(MSBuildThisFileDirectory)..\..\..\TestResult-Mono.Android_Tests.xml" DefinitionsFilename="$(MSBuildThisFileDirectory)apk-sizes-definitions-$(Configuration)$(_AotName).txt" AddResults="true" />
</Target>