Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BuildToolsVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.27-prerelease-01310-03
1.0.27-prerelease-01316-07
4 changes: 2 additions & 2 deletions Packaging.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<PackageVersion Condition="'$(PackageVersion)' == ''">4.4.0</PackageVersion>
<SkipValidatePackageTargetFramework>true</SkipValidatePackageTargetFramework>
<SkipGenerationCheck>true</SkipGenerationCheck>
<!-- disable layout creation in favor of binplacing -->
<ShouldCreateLayout>false</ShouldCreateLayout>
<!-- support check is broken until we reenable package harvesting -->
<SkipSupportCheck>true</SkipSupportCheck>
</PropertyGroup>

<Import Condition="Exists('pkg/baseline/baseline.props') AND '$(MSBuildProjectExtension)' == '.pkgproj'" Project="pkg/baseline/baseline.props" />
Expand Down
40 changes: 40 additions & 0 deletions buildvertical.targets
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,32 @@
</ItemGroup>
</Target>

<Target Name="ExpandAllBuildConfigurationsForPkgProj"
BeforeTargets="ExpandProjectReferences"
Condition="'$(MSBuildProjectExtension)' == '.pkgproj'">
<MSBuild Targets="GetPackageConfigurations"
Projects="@(_NonPkgProjProjectReference)">
<Output TaskParameter="TargetOutputs"
ItemName="_NonPkgProjProjectReferenceBuildConfigurations" />
</MSBuild>

<ItemGroup>
<!-- assign configuration as a seperate step to prevent batching during the transform which can reorder the list.
order or projects matters here since this applies to traversal projects which build projects serially. -->
<_NonPkgProjProjectReferenceBuildConfigurations>
<AdditionalProperties>Configuration=%(Identity);%(_NonPkgProjProjectReferenceBuildConfigurations.AdditionalProperties)</AdditionalProperties>
</_NonPkgProjProjectReferenceBuildConfigurations>

<!-- transform back to project -->
<_NonPkgProjProjectReferenceWitnConfiguration Include="@(_NonPkgProjProjectReferenceBuildConfigurations->'%(OriginalItemSpec)')" />
</ItemGroup>

<ItemGroup>
<_NonPkgProjProjectReference Remove="@(_NonPkgProjProjectReference)" />
<_NonPkgProjProjectReference Include="@(_NonPkgProjProjectReferenceWitnConfiguration)" />
</ItemGroup>
</Target>

<!-- Runs during traversal to select which projects and configurations of those projects to build
Batches over the projects because we need to treat BuildConfigurations as a Property
as well as copy the Project based on results of FindBestConfigurations. -->
Expand Down Expand Up @@ -81,6 +107,20 @@
</PropertyGroup>
</Target>

<!-- Runs in a leaf project (eg: csproj) to determine configurations to package -->
<Target Name="GetPackageConfigurations"
Returns="$(PackageConfigurations)">
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enables an optionally independent property for the configurations that go in the package. I'm open to other knobs here. Perhaps a better semantic would be ExcludePackageConfigurations, where PackageConfigurations = BuildConfigurations - ExcludePackageConfigurations.

<ItemGroup Condition="'$(PackageConfigurations)' == ''">
<_buildConfigurations Include="$(BuildConfigurations)" />
<_excludeBuildConfigurations Include="@(_buildConfigurations)" Condition="'$(IsReferenceAssembly)' == 'true' AND ('%(Identity)' == 'netfx' OR $([System.String]::new('%(Identity)').StartsWith('net4')))"/>
<_packageConfigurations Include="@(_buildConfigurations)" Exclude="@(_excludeBuildConfigurations)" />
</ItemGroup>

<PropertyGroup Condition="'$(PackageConfigurations)' == ''">
<PackageConfigurations>@(_packageConfigurations)</PackageConfigurations>
</PropertyGroup>
</Target>

<!-- Runs in a leaf project (csproj) to determine best configuration for ProjectReferences -->
<Target Name="AnnotateProjectReference"
BeforeTargets="AssignProjectConfiguration"
Expand Down
9 changes: 6 additions & 3 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@
<BlockReflectionAttribute>true</BlockReflectionAttribute>
</PropertyGroup>

<!-- Import packaging props -->
<Import Project="$(MSBuildThisFileDirectory)Packaging.props"/>

<!-- list of nuget package sources passed to dnu -->
<ItemGroup Condition="'$(ExcludeInternetFeeds)' != 'true'">
<!-- Example to consume local CoreCLR package:
Expand Down Expand Up @@ -152,12 +149,18 @@
<BuildConfiguration Condition="'$(BuildConfiguration)' == ''">$(TargetGroup)-$(OSGroup)-$(ConfigurationGroup)-$(ArchGroup)</BuildConfiguration>
<BuildConfigurationImportFile>$(ToolsDir)/configuration/configuration.props</BuildConfigurationImportFile>

<!-- if PKGPROJ doesn't set BuildConfigurations, make sure it only builds for TargetGroup=package or BuildAllConfigurations -->
<BuildConfigurations Condition="'$(MSBuildProjectExtension)' == '.pkgproj' AND '$(BuildConfigurations)' == ''">package</BuildConfigurations>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to have a TargetGroup and a BuildConfigurations value so that packages wouldn't just get the running BuildConfiguration, which contains an OSGroup, which would set PackageTargetRuntime: even for identity packages.


<!-- Need to try and keep the same logic as the native builds as we need this for packaging -->
<NativeBinDir>$(BinDir)$(OSGroup).$(ArchGroup).$(ConfigurationGroup)/native</NativeBinDir>
</PropertyGroup>

<Import Project="$(BuildConfigurationImportFile)" Condition="Exists('$(BuildConfigurationImportFile)')" />

<!-- Import packaging props -->
<Import Project="$(MSBuildThisFileDirectory)Packaging.props"/>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reordering can be removed once I put PackageTargetRuntimeSuffix in buildtools


<!-- set properties for each vertical -->
<PropertyGroup>
<BuildingNETCoreAppVertical Condition="'$(BuildingNETCoreAppVertical)' == '' AND ('$(_bc_TargetGroup)'=='netcoreapp' OR '$(BuildAllConfigurations)' == 'true')">true</BuildingNETCoreAppVertical>
Expand Down
4 changes: 2 additions & 2 deletions pkg/Microsoft.Private.CoreFx.UAP/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
uap-Windows_NT;
uapaot-Windows_NT;
uap;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per above, I use the OSGroup agnostic configurations because OSGroup implies a PackageTargetRuntime.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if we do this, won't we try to build this package in non-Windows builds as well? I believe that would fail since most uap configurations are Windows only.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if someone tried to Build UAP targetgroup there...

uapaot;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,24 @@

<Target Name="UpdateFromLocalBuild">
<ItemGroup>
<AllPackages Include="$(PackageOutputPath)\*.nupkg" />
<AllPackages Include="$(PackageOutputPath)\*.nupkg" Exclude="$(PackageOutputPath)\*Microsoft.Private.*.nupkg" />
<FrameworkLayout Include="$(NETCoreAppPackageRefPath)">
<TargetFramework>netcoreapp2.0</TargetFramework>
</FrameworkLayout>
<FrameworkLayout Include="$(UAPPackageRefPath)">
<TargetFramework>uap10.1</TargetFramework>
</FrameworkLayout>
<FrameworkLayout Include="$(PackagesDir)$(NETStandardPackageId)\$(NETStandardPackageVersion)\build\netstandard2.0\ref">
<TargetFramework>netstandard2.0</TargetFramework>
</FrameworkLayout>
<FrameworkLayout Include="$(PackagesDir)$(NETStandardPackageId)\$(NETStandardPackageVersion)\build\net461\ref">
<TargetFramework>net461</TargetFramework>
</FrameworkLayout>
</ItemGroup>

<UpdatePackageIndex PackageIndexFile="$(PackageIndexFile)"
Packages="@(AllPackages)" />
Packages="@(AllPackages)"
InboxFrameworkLayoutFolders="@(FrameworkLayout)" />
</Target>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
Expand Down
Loading