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

Add configurations for additional targeting packs #15520

Merged
merged 1 commit into from
Jan 26, 2017
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
3 changes: 0 additions & 3 deletions external/dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
</PropertyGroup>
<PropertyGroup>
<IntermediateOutputPath>$(IntermediateOutputPath)$(ArchGroup)/</IntermediateOutputPath>
<ProjectJsonTemplate>$(MSBuildThisProjectDirectory)project.json.template</ProjectJsonTemplate>
<ProjectJson Condition="Exists('$(ProjectJsonTemplate)')">$(IntermediateOutputPath)project.json</ProjectJson>
<ProjectLockJson Condition="Exists('$(ProjectJsonTemplate)')">$(IntermediateOutputPath)project.lock.json</ProjectLockJson>
<NugetRuntimeIdentifier>$(RuntimeOS)-$(ArchGroup)</NugetRuntimeIdentifier>
</PropertyGroup>
</Project>
8 changes: 7 additions & 1 deletion external/dir.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectJsonTemplate Condition="'$(ProjectJsonTemplate)' == ''">$(MSBuildThisProjectDirectory)project.json.template</ProjectJsonTemplate>
<ProjectJson Condition="Exists('$(ProjectJsonTemplate)')">$(IntermediateOutputPath)project.json</ProjectJson>
<ProjectLockJson Condition="Exists('$(ProjectJsonTemplate)')">$(IntermediateOutputPath)project.lock.json</ProjectLockJson>
</PropertyGroup>

<Import Project="..\dir.targets" />

<PropertyGroup>
Expand All @@ -16,7 +22,7 @@
<!-- Update project.json template -->
<WriteLinesToFile
File="$(ProjectJson)"
Lines="$([System.IO.File]::ReadAllText('project.json.template').Replace('{RID}', $(NuGetRuntimeIdentifier)).Replace('{TFM}', $(NuGetTargetMoniker)))"
Lines="$([System.IO.File]::ReadAllText('$(ProjectJsonTemplate)').Replace('{RID}', $(NuGetRuntimeIdentifier)).Replace('{TFM}', $(NuGetTargetMoniker)).Replace('{PackageId}', $(TargetingPackNugetPackageId)))"
Overwrite="true"
/>
<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions external/netfx/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<PropertyGroup>
<!-- Include netcoreapp since we need to generate facades between desktop and netcoreapp -->
<BuildConfigurations>
net45;
net451;
Copy link
Member

Choose a reason for hiding this comment

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

do we really need to have net45x in general?

Copy link
Member Author

Choose a reason for hiding this comment

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

We did before. Some facades were being built against this for the API versions that target netstandard1.1 or lower.

net46;
net461;
net462;
net463;
netcoreapp;
</BuildConfigurations>
</PropertyGroup>
Expand Down
11 changes: 10 additions & 1 deletion external/netfx/netfx.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == 'netcoreapp'">.NETFramework,Version=v4.6.1</NuGetTargetMoniker>
<NugetRuntimeIdentifier>None</NugetRuntimeIdentifier>
<OutputPath>$(RefRootPath)/$(TargetGroup)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetGroup)' == 'net463'">
<!-- Missing 4.6.3 targeting pack, use 462 for now -->
<TargetingPackNugetPackageId>Microsoft.TargetingPack.NETFramework.v4.6.2</TargetingPackNugetPackageId>
Copy link
Member

Choose a reason for hiding this comment

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

I see you are now making use of TargetingPackNugetPackageId I was planning to clean that out, but I guess I will leave it alone now.

Copy link
Member Author

Choose a reason for hiding this comment

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

You can clean it out if you want to and just move it to these projects.

</PropertyGroup>
<PropertyGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<!-- For NETCoreApp we need the net461 targeting pack to generate facades -->
<NuGetTargetMoniker>.NETFramework,Version=v4.6.1</NuGetTargetMoniker>
<TargetingPackNugetPackageId>Microsoft.TargetingPack.NETFramework.v4.6.1</TargetingPackNugetPackageId>
<OutputPath>$(NetFxRefPath)</OutputPath>
</PropertyGroup>
<!-- Filter the targeting pack to just these assemblies which we need netcoreapp shims for -->
Expand Down
9 changes: 0 additions & 9 deletions external/netfx/project.json

This file was deleted.

9 changes: 9 additions & 0 deletions external/netfx/project.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"frameworks": {
"{TFM}": {
"dependencies": {
"{PackageId}": "1.0.1"
}
}
}
}
8 changes: 8 additions & 0 deletions external/netstandard/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netstandard1.0;
netstandard1.1;
netstandard1.2;
netstandard1.3;
netstandard1.4;
netstandard1.5;
netstandard1.6;
netstandard2.0;
netstandard;
</BuildConfigurations>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion external/netstandard/netstandard.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<PropertyGroup>
<NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
<NugetRuntimeIdentifier>None</NugetRuntimeIdentifier>
<OutputPath>$(NetStandardRefPath)</OutputPath>
<OutputPath>$(RefRootPath)/$(TargetGroup)</OutputPath>
<ProjectJsonTemplate Condition="$(NuGetTargetMoniker.Contains('Version=v1.'))">$(MSBuildProjectDirectory)\netstandard1.x\project.json.template</ProjectJsonTemplate>
</PropertyGroup>

<Target Name="AddNETStandardRefs" AfterTargets="ResolveReferences"
Expand Down
10 changes: 10 additions & 0 deletions external/netstandard/netstandard1.x/project.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"frameworks": {
"{TFM}": {
"dependencies": {
"NETStandard.Library": "2.0.0-beta-24919-01",
"System.Diagnostics.Contracts": "4.3.0"
Copy link
Member

Choose a reason for hiding this comment

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

What is the reason for the different template for 1.x? The only difference appears to be this System.Diagnostics.Contracts package. Are you working around some issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is where we pull in additional NETStandard1.x packages that are needed by our libraries that aren't part of the NETStandard.Library package. So far all I've needed is this guy, we might need more.

Copy link
Member

Choose a reason for hiding this comment

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

We can probably get away with sharing the same template and just having a poor mans version of your conflict resolution in the project.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like it because that means a vertical build will download packages from NuGet. I separated it so that we wouldn't download anything we didn't build in another repo for a vertical build.

}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"frameworks": {
"netstandard2.0": {
"{TFM}": {
"dependencies": {
"NETStandard.Library": "2.0.0-beta-24919-01"
}
Expand Down
9 changes: 9 additions & 0 deletions external/portable/Configurations.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
portable_net45+win8+sl5;
portable_net40+sl4+win8+wp8;
</BuildConfigurations>
</PropertyGroup>
</Project>
11 changes: 11 additions & 0 deletions external/portable/portable.depproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
<NugetRuntimeIdentifier>None</NugetRuntimeIdentifier>
<OutputPath>$(RefRootPath)/$(TargetGroup)</OutputPath>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="FilterTargetingPackResolvedNugetPackages" />
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need the empty filter target?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I don't want any filtering. Without this I was only getting mscorlib. Perhaps there's a better way to do this if we update the filtering target but I didn't see a good hook, and I didn't want to list out every assembly. We might want to do the same for the desktop targeting packs, then move your shim list into shims.proj. /cc @tarekgh

Copy link
Member

Choose a reason for hiding this comment

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

I see yeah we should probably remove this filtering completely and switch to the other package filtering that @tarekgh created.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good suggestion. I forgot about that.

</Project>
9 changes: 9 additions & 0 deletions external/portable/project.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"frameworks": {
"{TFM}": {
"dependencies": {
"{PackageId}": "1.0.0"
}
}
}
}