Correct "Exists" logic on monodoc debug files

The previous commit's attempts to copy the pdb/mdb files for monodoc
had a problem where they would be evaluated too early (probably before
the files existed) and in the wrong directory. To address this, the
files are instead specified as a MonoDocCopyItemOptional, a new target
_GetMonodocItems is created and the ItemGroups for
_MonoDocCopyItems/_MonoDocInstalledItems are evaluated in this target
with correct Exists logic for the Optional files. Additional
DependsOnTargets attributes were distributed through the file to
ensure this new target is evaluated at the correct time.
This commit is contained in:
Andi McClure 2017-03-16 19:16:53 -04:00
Родитель 48b6c59af3
Коммит 6e9a6612e1
1 изменённых файлов: 23 добавлений и 13 удалений

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

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<MonoDocCopyItem Include="monodoc.dll" />
<MonoDocCopyItem Include="monodoc.pdb" Condition="Exists ('monodoc.pdb')" />
<MonoDocCopyItem Include="monodoc.dll.mdb" Condition="Exists ('monodoc.dll.mdb')" />
<MonoDocCopyItemOptional Include="monodoc.pdb" />
<MonoDocCopyItemOptional Include="monodoc.dll.mdb" />
<MonoDocCopyItem Include="monodoc.dll.config" />
</ItemGroup>
<ItemGroup>
@ -26,13 +26,6 @@
<_MonoProfileDir>$(MonoSourceFullPath)\mcs\class\lib\monodroid</_MonoProfileDir>
<_MonoOutputDir>$(MonoSourceFullPath)\mcs\class\lib\net_4_x</_MonoOutputDir>
</PropertyGroup>
<ItemGroup>
<_MonoDocCopyItems Include="@(MonoDocCopyItem->'$(_MonoOutputDir)\%(Identity)')" />
</ItemGroup>
<ItemGroup>
<_MonoDocInstalledItems Include="@(MonoDocCopyItem->'$(_MandroidDir)\%(Identity)')" />
<_MonoDocInstalledItems Include="$(_MandroidDir)\mdoc.exe" />
</ItemGroup>
<PropertyGroup>
<ForceBuildDependsOn>
_BuildLlvm;
@ -148,7 +141,7 @@
/>
</Target>
<Target Name="_ConfigureRuntimes"
DependsOnTargets="_BuildLlvm"
DependsOnTargets="_BuildLlvm;_Autogen"
Inputs="$(MonoSourceFullPath)\configure"
Outputs="$(IntermediateOutputPath)\%(_MonoRuntime.Identity)\Makefile">
<MakeDir Directories="$(IntermediateOutputPath)\%(_MonoRuntime.Identity)" />
@ -232,7 +225,7 @@
</ItemGroup>
</Target>
<Target Name="_BuildRuntimes"
DependsOnTargets="_GetRuntimesOutputItems"
DependsOnTargets="_GetRuntimesOutputItems;_ConfigureRuntimes"
Inputs="@(_RuntimeBuildStamp)"
Outputs="@(_RuntimeSource);@(_ProfilerSource);@(_MonoPosixHelperSource);@(_BclProfileItems);@(_MonoBtlsSource)">
<Exec
@ -334,9 +327,26 @@
DestinationFiles="$(_MandroidDir)\cil-strip.exe"
/>
</Target>
<Target Name="_GetMonodocItems" DependsOnTargets="_BuildRuntimes">
<ItemGroup>
<_MonoDocCopyItems Include="@(MonoDocCopyItem->'$(_MonoOutputDir)\%(Identity)')" />
<_MonoDocCopyItems
Condition=" Exists ('$(_MonoOutputDir)\%(Identity)') "
Include="@(MonoDocCopyItemOptional->'$(_MonoOutputDir)\%(Identity)')"
/>
<_MonoDocInstalledItems Include="@(MonoDocCopyItem->'$(_MandroidDir)\%(Identity)')" />
<_MonoDocInstalledItems
Condition=" Exists ('$(_MonoOutputDir)\%(Identity)') "
Include="@(MonoDocCopyItemOptional->'$(_MandroidDir)\%(Identity)')"
/>
<_MonoDocInstalledItems Include="$(_MandroidDir)\mdoc.exe" />
</ItemGroup>
</Target>
<Target Name="_InstallMonoDoc"
Inputs="@(_MonoDocCopyItems);$(_MonoOutputDir)\mdoc.exe"
Outputs="@(_MonoDocInstalledItems)">
Outputs="@(_MonoDocInstalledItems)"
DependsOnTargets="_GetMonodocItems">
<MakeDir Directories="$(_MandroidDir)" />
<Copy
SourceFiles="@(_MonoDocCopyItems)"
@ -488,7 +498,7 @@
/>
</Target>
<Target Name="GetMonoBundleItems"
DependsOnTargets="_GetRuntimesOutputItems;_PrepareLlvmItems">
DependsOnTargets="_GetRuntimesOutputItems;_GetMonodocItems;_PrepareLlvmItems">
<ItemGroup>
<BundleItem Include="@(_BclInstalledItem)" />
<BundleItem Include="@(_MonoDocInstalledItems)" />