Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Enable partial package build during source build (#40061)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericstj authored Aug 7, 2019
1 parent 3cdd1f4 commit bf89454
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
13 changes: 13 additions & 0 deletions eng/Packaging.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@
<SkipGenerationCheck>true</SkipGenerationCheck>
<SkipIndexCheck>true</SkipIndexCheck>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<!-- Don't build referenced projects -->
<BuildPackageLibraryReferences>false</BuildPackageLibraryReferences>
<!-- Omit any files that were not built -->
<AllowPartialPackages>true</AllowPartialPackages>
<!-- Don't permit harvesting since this requires pre-builts -->
<HarvestStablePackage>false</HarvestStablePackage>
<!-- Validation will fail in case we were relying on harvested assets or assets not built to satisfy stated support -->
<SkipValidatePackage>true</SkipValidatePackage>
<!-- Include All BuildConfigurations in package, so that whatever we're building for source build is included -->
<PackageConfigurations>$(BuildConfigurations)</PackageConfigurations>
</PropertyGroup>

<Import Condition="Exists('../pkg/baseline/baseline.props') AND '$(MSBuildProjectExtension)' == '.pkgproj'" Project="../pkg/baseline/baseline.props" />

Expand Down
6 changes: 5 additions & 1 deletion eng/Packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
</ItemGroup>
</Target>

<Target Name="ValidateExcludeCompileDesktop" AfterTargets="GetPackageDependencies" Inputs="%(Dependency.Identity);%(Dependency.TargetFramework)" Outputs="unused">
<Target Name="ValidateExcludeCompileDesktop"
AfterTargets="GetPackageDependencies"
Inputs="%(Dependency.Identity);%(Dependency.TargetFramework)"
Outputs="unused"
Condition="'$(SkipValidatePackage)' != 'true'">
<PropertyGroup>
<_excludeCompile Condition="@(Dependency->WithMetadataValue('Exclude', 'Compile')->Count()) == @(Dependency->Count())">true</_excludeCompile>
</PropertyGroup>
Expand Down
10 changes: 7 additions & 3 deletions src/packages.builds
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />

<ItemGroup>
<Project Include="$(MSBuildThisFileDirectory)..\pkg\*\*.builds" Condition="'$(SkipManagedPackageBuild)' != 'true'">
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<AdditionalBuildConfigurations>$(AdditionalBuildConfigurations);package-$(ConfigurationGroup)</AdditionalBuildConfigurations>
</PropertyGroup>

<ItemGroup Condition="'$(SkipManagedPackageBuild)' != 'true'">
<Project Include="$(MSBuildThisFileDirectory)..\pkg\*\*.builds" >
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="*\pkg\**\*.pkgproj" Condition="'$(SkipManagedPackageBuild)' != 'true' AND '$(BuildAllConfigurations)' == 'true'">
<Project Include="*\pkg\**\*.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true' OR '$(DotNetBuildFromSource)' == 'true'">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/src.builds
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<Project DefaultTargets="Build">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />

<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<AdditionalBuildConfigurations>$(AdditionalBuildConfigurations);netstandard-$(ConfigurationGroup)</AdditionalBuildConfigurations>
</PropertyGroup>

<ItemGroup Condition="'$(DirectoryToBuild)' == ''">
<Project Include="$(MSBuildThisFileDirectory)*\src\*.csproj" Exclude="@(ProjectExclusions)" />
<Project Include="$(MSBuildThisFileDirectory)*\src\*.ilproj" Exclude="@(ProjectExclusions)" />
Expand Down

0 comments on commit bf89454

Please sign in to comment.