Skip building prebuilt tarball if directory exists but is empty

This commit is contained in:
Davis Goodin 2021-10-22 14:17:35 -05:00
parent 17feead1af
commit 563bb4b721

View file

@ -134,8 +134,21 @@
<Target Name="CreatePrebuiltsTarball" <Target Name="CreatePrebuiltsTarball"
AfterTargets="Build" AfterTargets="Build"
Condition="Exists('$(ResultingPrebuiltPackagesDir)')"> DependsOnTargets="
CheckIfPrebuiltsExistToPack;
CreatePrebuiltsTarballIfPrebuiltsExist"/>
<Target Name="CheckIfPrebuiltsExistToPack">
<!-- Directory existence doesn't mean there are files inside. Use a pattern to find files. -->
<ItemGroup>
<PrebuiltFile Include="$(ResultingPrebuiltPackagesDir)**" />
</ItemGroup>
<Message Text="Found @(PrebuiltFile->Count()) files in prebuilt packages dir." Importance="High" />
</Target>
<Target Name="CreatePrebuiltsTarballIfPrebuiltsExist"
Condition="'@(PrebuiltFile->Count())' != '0'">
<PropertyGroup> <PropertyGroup>
<TarballFileVersion>$(PrivateSourceBuiltPrebuiltsPackageVersionPrefix)$([MSBuild]::Add($(PrivateSourceBuiltPrebuiltsPackageVersionSuffix), 1))</TarballFileVersion> <TarballFileVersion>$(PrivateSourceBuiltPrebuiltsPackageVersionPrefix)$([MSBuild]::Add($(PrivateSourceBuiltPrebuiltsPackageVersionSuffix), 1))</TarballFileVersion>
<TarballFilePath>$(OutputPath)$(SourceBuiltPrebuiltsTarballName).$(TarballFileVersion).tar.gz</TarballFilePath> <TarballFilePath>$(OutputPath)$(SourceBuiltPrebuiltsTarballName).$(TarballFileVersion).tar.gz</TarballFilePath>