Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
NuGet packager now builds CLR 2 and 4 targeting assemblies and packag…
Browse files Browse the repository at this point in the history
…es them together for automatic selection by NuGet.

Fixes #55
  • Loading branch information
AArnott committed Jan 29, 2012
1 parent 3b698d3 commit d9176f0
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions nuget/nuget.proj
Expand Up @@ -3,7 +3,39 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " />
<Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/>

<Target Name="Layout" DependsOnTargets="BuildUnifiedProduct;ReSignDelaySignedAssemblies">
<Target Name="BuildIntermediates">
<ItemGroup>
<ProductTargets Include="BuildUnifiedProduct;ReSignDelaySignedAssemblies" />
</ItemGroup>

<!-- We build the entire unified, signed product targeting both CLRs, since NuGet supports packages that contain both,
and by building against CLR 4, several assembly references fall away from dotnetopenauth.dll, which makes some folks happy. -->
<MSBuild
Projects="$(ProjectRoot)src\DotNetOpenAuth\DotNetOpenAuth.proj"
Targets="@(ProductTargets)"
Properties="TargetFrameworkVersion=v3.5"
BuildInParallel="$(BuildInParallel)">
<Output TaskParameter="TargetOutputs" ItemName="ResignedAssembliesOutputs35"/>
</MSBuild>
<MSBuild
Projects="$(ProjectRoot)src\DotNetOpenAuth\DotNetOpenAuth.proj"
Targets="@(ProductTargets)"
Properties="TargetFrameworkVersion=v4.0"
BuildInParallel="$(BuildInParallel)">
<Output TaskParameter="TargetOutputs" ItemName="ResignedAssembliesOutputs40"/>
</MSBuild>

<ItemGroup>
<ResignedAssembliesOutputs Include="@(ResignedAssembliesOutputs35)" Condition=" '%(MSBuildSourceTargetName)' == 'Sign' ">
<TargetFramework>v3.5</TargetFramework>
</ResignedAssembliesOutputs>
<ResignedAssembliesOutputs Include="@(ResignedAssembliesOutputs40)" Condition=" '%(MSBuildSourceTargetName)' == 'Sign' ">
<TargetFramework>v4.0</TargetFramework>
</ResignedAssembliesOutputs>
</ItemGroup>
</Target>

<Target Name="Layout" DependsOnTargets="BuildIntermediates">
<PropertyGroup>
<NuGetLayoutPath>$(DropsRoot)NuGet\$(BuildVersion)\</NuGetLayoutPath>
</PropertyGroup>
Expand All @@ -14,12 +46,9 @@

<!-- IMPORTANT: These must appear as separate ItemGroups or else batching screws it up. -->
<ItemGroup>
<NuGetSource Include="%(ResignedAssembliesOutputs.Identity)" Condition=" '%(FileName)%(Extension)' == 'DotNetOpenAuth.dll' "/>
<NuGetSource>
<TargetPath>$(NuGetLayoutPath)lib\net40-full\%(FileName)%(Extension)</TargetPath>
</NuGetSource>
<NuGetSource Condition=" '$(ClrVersion)' == '2' " Include="@(NuGetSource)">
<TargetPath>$(NuGetLayoutPath)lib\full\%(FileName)%(Extension)</TargetPath>
<NuGetSource Include="%(ResignedAssembliesOutputs.Identity)" Condition=" '%(FileName)%(Extension)' == 'DotNetOpenAuth.dll' ">
<TargetPath Condition=" '%(TargetFramework)' == 'v4.0' ">$(NuGetLayoutPath)lib\net40-full\%(FileName)%(Extension)</TargetPath>
<TargetPath Condition=" '%(TargetFramework)' == 'v3.5' ">$(NuGetLayoutPath)lib\net35-full\%(FileName)%(Extension)</TargetPath>
</NuGetSource>
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit d9176f0

Please sign in to comment.