Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Publish" our tasks assembly into platform-specific folders inside our NuGet package. #46

Merged
merged 2 commits into from
Aug 16, 2016
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
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

<OutDir Condition="'$(OutDir)' == ''">$([System.IO.Path]::GetFullPath('$(RepositoryRootDirectory)bin\$(Configuration)'))\</OutDir>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$([System.IO.Path]::GetFullPath('$(RepositoryRootDirectory)bin\obj\$(MSBuildProjectName)'))\</BaseIntermediateOutputPath>
<PackagesLayoutDir>$(OutDir)\PackagesLayout\</PackagesLayoutDir>
<PackagesLayoutToolsDir>$(PackagesLayoutDir)tools\</PackagesLayoutToolsDir>
<PackagesLayoutToolsNet46Dir>$(PackagesLayoutToolsDir)net46\</PackagesLayoutToolsNet46Dir>
<PackagesLayoutToolsNetCoreAppDir>$(PackagesLayoutToolsDir)netcoreapp1.0\</PackagesLayoutToolsNetCoreAppDir>

<VersionPrefix Condition="'$(VersionPrefix)' == ''">1.0.0</VersionPrefix>
<VersionPrereleasePrefix Condition="'$(VersionPrereleasePrefix)' == ''">alpha</VersionPrereleasePrefix>
Expand Down
10 changes: 8 additions & 2 deletions build/Nuget/Microsoft.DotNet.Core.Nuget.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@
<NuSpec Include="Microsoft.DotNet.Core.Sdk.nuspec">
<NuPkgOutput>$(NuGetOutDir)%(FileName).$(Version).nupkg</NuPkgOutput>
<NuGetArguments>--version "$(Version)"</NuGetArguments>
<LayoutTargetName>LayoutSdkPackage</LayoutTargetName>
</NuSpec>

<!-- Make note, without actually knowing what's included in the NuSpec,
we just assume that everything in the output dir is, and treat them
as inputs so that we rerun packaging if they change.
Long term we'll want to use a packaging project, such as NuProj where
the NuSpec is auto-generated based on the inputs. -->
<PackageAssets Include="$(OutDir)\*.*" Exclude="*.log" />
<PackageAssets Include="$(OutDir)**\*.*" Exclude="*.log" />
</ItemGroup>

<Target Name="Build" Inputs="@(NuSpec);@(PackageAssets)" Outputs="@(NuSpec->'%(NuPkgOutput)')" DependsOnTargets="LogOutput">
<Target Name="Build"
DependsOnTargets="LogOutput;@(NuSpec->'%(LayoutTargetName)')"
Inputs="@(NuSpec);@(PackageAssets)"
Outputs="@(NuSpec->'%(NuPkgOutput)')">

<ReadLinesFromFile File="$(RepositoryRootDirectory)DotnetCLIVersion.txt">
<Output TaskParameter="Lines" ItemName="CLIVersion" />
Expand All @@ -46,4 +50,6 @@
<Message Importance="High" Text="%(NuSpec.Identity) -> %(NuSpec.NuPkgOutput)'" />
</Target>

<Import Project="Microsoft.DotNet.Core.Sdk.Nuget.targets" />

</Project>
98 changes: 98 additions & 0 deletions build/Nuget/Microsoft.DotNet.Core.Sdk.Nuget.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="LayoutSdkPackage">
<PropertyGroup>
<CoreSetupVersion>1.0.1-beta-000914</CoreSetupVersion>
<NuGetVersion>3.5.0-rc1-1697</NuGetVersion>
</PropertyGroup>

<ItemGroup>
<NuGetCopyLocalAssembly Include="NuGet.ProjectModel" />
<NuGetCopyLocalAssembly Include="NuGet.DependencyResolver.Core" />
<NuGetCopyLocalAssembly Include="NuGet.LibraryModel" />
<NuGetCopyLocalAssembly Include="NuGet.Frameworks" />
<NuGetCopyLocalAssembly Include="NuGet.Protocol.Core.v3" />
<NuGetCopyLocalAssembly Include="NuGet.Repositories" />
<NuGetCopyLocalAssembly Include="NuGet.RuntimeModel" />
<NuGetCopyLocalAssembly Include="NuGet.Common" />
<NuGetCopyLocalAssembly Include="NuGet.Packaging" />
<NuGetCopyLocalAssembly Include="NuGet.Protocol.Core.Types" />
<NuGetCopyLocalAssembly Include="NuGet.Packaging.Core.Types" />
<CopyLocalAssembly Include="@(NuGetCopyLocalAssembly)">
<Version>$(NuGetVersion)</Version>
<TFM>netstandard1.3</TFM>
<DestinationTFM>net46;netcoreapp1.0</DestinationTFM>
</CopyLocalAssembly>
<CopyLocalAssembly Include="NuGet.Versioning">
<Version>$(NuGetVersion)</Version>
<TFM>netstandard1.0</TFM>
<DestinationTFM>net46;netcoreapp1.0</DestinationTFM>
</CopyLocalAssembly>

<CopyLocalAssembly Include="Microsoft.Extensions.DependencyModel">
<Version>$(CoreSetupVersion)</Version>
<TFM>netstandard1.3</TFM>
<DestinationTFM>net46;netcoreapp1.0</DestinationTFM>
</CopyLocalAssembly>
<CopyLocalAssembly Include="Microsoft.DotNet.PlatformAbstractions">
<Version>$(CoreSetupVersion)</Version>
<TFM>netstandard1.3</TFM>
<DestinationTFM>net46;netcoreapp1.0</DestinationTFM>
</CopyLocalAssembly>

<CopyLocalAssembly Include="Newtonsoft.Json">
<Version>9.0.1</Version>
<TFM>netstandard1.0</TFM>
<DestinationTFM>net46;netcoreapp1.0</DestinationTFM>
</CopyLocalAssembly>

<CopyLocalAssembly Include="System.Runtime.Serialization.Primitives">
<Version>4.1.1</Version>
<TFM>netstandard1.3</TFM>
<DestinationTFM>netcoreapp1.0</DestinationTFM>
</CopyLocalAssembly>

<CopyLocalAssembly Include="System.Security.Cryptography.Algorithms">
<Version>4.2.0</Version>
<TFM>net46</TFM>
<DestinationTFM>net46</DestinationTFM>
</CopyLocalAssembly>
<CopyLocalAssembly Include="System.Security.Cryptography.Primitives">
<Version>4.0.0</Version>
<TFM>net46</TFM>
<DestinationTFM>net46</DestinationTFM>
</CopyLocalAssembly>

<CopyLocalAssembly>
<FullFilePath>$(NuGet_Packages)\%(CopyLocalAssembly.Identity)\%(CopyLocalAssembly.Version)\lib\%(CopyLocalAssembly.TFM)\%(CopyLocalAssembly.Identity).dll</FullFilePath>
</CopyLocalAssembly>

<!-- Add our tasks assembly -->
<CopyLocalAssembly Include="Microsoft.DotNet.Core.Build.Tasks">
<FullFilePath>$(OutDir)\Microsoft.DotNet.Core.Build.Tasks.dll</FullFilePath>
<DestinationTFM>net46;netcoreapp1.0</DestinationTFM>
</CopyLocalAssembly>

<Net46CopyLocalAssembly Include="@(CopyLocalAssembly)"
Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(DestinationTFM)', '(^|;)net46($|;)'))" />
<NetCoreAppCopyLocalAssembly Include="@(CopyLocalAssembly)"
Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(DestinationTFM)', '(^|;)netcoreapp1.0($|;)'))" />

<CopyLocalBuildFile Include="$(OutDir)build\**\*.*" />
<CopyLocalBuildFile>
<RelativePath>build\%(RecursiveDir)</RelativePath>
</CopyLocalBuildFile>
</ItemGroup>

<Copy SourceFiles="%(Net46CopyLocalAssembly.FullFilePath)"
DestinationFolder="$(PackagesLayoutToolsNet46Dir)" />

<Copy SourceFiles="%(NetCoreAppCopyLocalAssembly.FullFilePath)"
DestinationFolder="$(PackagesLayoutToolsNetCoreAppDir)" />

<Copy SourceFiles="@(CopyLocalBuildFile)"
DestinationFiles="$(PackagesLayoutDir)%(CopyLocalBuildFile.RelativePath)\%(CopyLocalBuildFile.Filename)%(CopyLocalBuildFile.Extension)" />
</Target>

</Project>
27 changes: 1 addition & 26 deletions build/Nuget/Microsoft.DotNet.Core.Sdk.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,6 @@
<projectUrl>http://dot.net</projectUrl>
</metadata>
<files>
<file src="Microsoft.DotNet.Core.Build.Tasks.dll" target="tools\netstandard1.3" />

<file src="Microsoft.Extensions.DependencyModel.dll" target="tools\netstandard1.3" />
<file src="Microsoft.DotNet.PlatformAbstractions.dll" target="tools\netstandard1.3" />

<file src="NuGet.ProjectModel.dll" target="tools\netstandard1.3" />
<file src="NuGet.DependencyResolver.Core.dll" target="tools\netstandard1.3" />
<file src="NuGet.LibraryModel.dll" target="tools\netstandard1.3" />
<file src="NuGet.Frameworks.dll" target="tools\netstandard1.3" />
<file src="NuGet.Protocol.Core.v3.dll" target="tools\netstandard1.3" />
<file src="NuGet.Repositories.dll" target="tools\netstandard1.3" />
<file src="NuGet.RuntimeModel.dll" target="tools\netstandard1.3" />
<file src="NuGet.Common.dll" target="tools\netstandard1.3" />
<file src="NuGet.Packaging.dll" target="tools\netstandard1.3" />
<file src="NuGet.Protocol.Core.Types.dll" target="tools\netstandard1.3" />
<file src="NuGet.Packaging.Core.Types.dll" target="tools\netstandard1.3" />
<file src="NuGet.Versioning.dll" target="tools\netstandard1.3" />

<file src="Newtonsoft.Json.dll" target="tools\netstandard1.3" />

<file src="System.Runtime.Serialization.Primitives.dll" target="tools\netstandard1.3" />

<file src="Microsoft.PackageDependencyResolution.targets" target="build\netstandard1.0" />
<file src="Microsoft.DotNet.Publish.targets" target="build\netstandard1.0" />
<file src="Microsoft.DotNet.Core.Sdk.props" target="build\netstandard1.0" />
<file src="Microsoft.DotNet.Core.Sdk.targets" target="build\netstandard1.0" />
<file src="PackagesLayout\**" />
</files>
</package>
6 changes: 3 additions & 3 deletions build/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@
</ItemGroup>

<ItemGroup>
<ProductAssets Include="$(OutDir)\*" />
<NetCoreAppProductAssets Include="$(PackagesLayoutToolsNetCoreAppDir)\*" />
</ItemGroup>

<Message Text="Running tests for %(SolutionFile.Filename) [$(Configuration)]" Importance="high" />

<!-- Copy all the product assemblies to the test directory, so the tests can load them. -->
<Copy SourceFiles="@(ProductAssets)"
<!-- Copy all the 'netcore1.0' product assemblies to the test directory, so the tests can load them. -->
<Copy SourceFiles="@(NetCoreAppProductAssets)"
DestinationFolder="$(TestsDirectory)"
/>

Expand Down
1 change: 1 addition & 0 deletions core-sdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuget", "Nuget", "{13EE1E3C
ProjectSection(SolutionItems) = preProject
build\Nuget\Microsoft.DotNet.Core.Nuget.proj = build\Nuget\Microsoft.DotNet.Core.Nuget.proj
build\Nuget\Microsoft.DotNet.Core.Sdk.nuspec = build\Nuget\Microsoft.DotNet.Core.Sdk.nuspec
build\Nuget\Microsoft.DotNet.Core.Sdk.Nuget.targets = build\Nuget\Microsoft.DotNet.Core.Sdk.Nuget.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Core.Build.Tasks.UnitTests", "src\Tasks\Microsoft.DotNet.Core.Build.Tasks.UnitTests\Microsoft.DotNet.Core.Build.Tasks.UnitTests.csproj", "{6A698C1D-F604-4295-B6FC-7FC726F9FE5F}"
Expand Down
4 changes: 2 additions & 2 deletions src/Dependencies/xUnit.net/xUnit.net.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\..\Tasks\Microsoft.DotNet.Core.Build.Tasks\Microsoft.DotNet.Core.Sdk.props" />
<Import Project="..\..\Tasks\Microsoft.DotNet.Core.Build.Tasks\build\netstandard1.0\Microsoft.DotNet.Core.Sdk.props" />
<PropertyGroup>
<ProjectGuid>{94F9B889-635A-48A7-A0CB-BAE5D6C9A91A}</ProjectGuid>
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand All @@ -22,7 +22,7 @@
</None>
</ItemGroup>
<Import Project="..\..\..\build\Targets\ProducesNoOutput.Imports.targets" />
<Import Project="..\..\Tasks\Microsoft.DotNet.Core.Build.Tasks\Microsoft.DotNet.Core.Sdk.targets" />
<Import Project="..\..\Tasks\Microsoft.DotNet.Core.Build.Tasks\build\netstandard1.0\Microsoft.DotNet.Core.Sdk.targets" />

<Target Name="AfterBuild">
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\Microsoft.DotNet.Core.Build.Tasks\Microsoft.DotNet.Core.Sdk.props" />
<Import Project="..\Microsoft.DotNet.Core.Build.Tasks\build\netstandard1.0\Microsoft.DotNet.Core.Sdk.props" />
<PropertyGroup>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<ProjectGuid>{6A698C1D-F604-4295-B6FC-7FC726F9FE5F}</ProjectGuid>
Expand Down Expand Up @@ -43,5 +43,5 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\Microsoft.DotNet.Core.Build.Tasks\Microsoft.DotNet.Core.Sdk.targets" />
<Import Project="..\Microsoft.DotNet.Core.Build.Tasks\build\netstandard1.0\Microsoft.DotNet.Core.Sdk.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="Microsoft.DotNet.Core.Sdk.props" />
<Import Project="build\netstandard1.0\Microsoft.DotNet.Core.Sdk.props" />
<PropertyGroup>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<ProjectGuid>{DF7D2697-B3B4-45C2-8297-27245F528A99}</ProjectGuid>
Expand All @@ -20,16 +20,16 @@
<Compile Include="RuntimeConfig.cs" />
<Compile Include="RuntimeConfigFramework.cs" />
<Compile Include="RuntimeOptions.cs" />
<None Include="Microsoft.DotNet.Core.Sdk.targets">
<None Include="build\netstandard1.0\Microsoft.DotNet.Core.Sdk.targets">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Microsoft.DotNet.Core.Sdk.props">
<None Include="build\netstandard1.0\Microsoft.DotNet.Core.Sdk.props">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Microsoft.DotNet.Publish.targets">
<None Include="build\netstandard1.0\Microsoft.DotNet.Publish.targets">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Microsoft.PackageDependencyResolution.targets">
<None Include="build\netstandard1.0\Microsoft.PackageDependencyResolution.targets">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="project.json" />
Expand All @@ -43,59 +43,5 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="Microsoft.DotNet.Core.Sdk.targets" />

<Target Name="AfterBuild">
<PropertyGroup>
<CoreSetupVersion>1.0.1-beta-000914</CoreSetupVersion>
<NuGetVersion>3.5.0-rc1-1697</NuGetVersion>
</PropertyGroup>
<ItemGroup>
<NuGetCopyLocalAssembly Include="NuGet.ProjectModel" />
<NuGetCopyLocalAssembly Include="NuGet.DependencyResolver.Core" />
<NuGetCopyLocalAssembly Include="NuGet.LibraryModel" />
<NuGetCopyLocalAssembly Include="NuGet.Frameworks" />
<NuGetCopyLocalAssembly Include="NuGet.Protocol.Core.v3" />
<NuGetCopyLocalAssembly Include="NuGet.Repositories" />
<NuGetCopyLocalAssembly Include="NuGet.RuntimeModel" />
<NuGetCopyLocalAssembly Include="NuGet.Common" />
<NuGetCopyLocalAssembly Include="NuGet.Packaging" />
<NuGetCopyLocalAssembly Include="NuGet.Protocol.Core.Types" />
<NuGetCopyLocalAssembly Include="NuGet.Packaging.Core.Types" />
<CopyLocalAssembly Include="@(NuGetCopyLocalAssembly)">
<Version>$(NuGetVersion)</Version>
<TFM>netstandard1.3</TFM>
</CopyLocalAssembly>
<CopyLocalAssembly Include="NuGet.Versioning">
<Version>$(NuGetVersion)</Version>
<TFM>netstandard1.0</TFM>
</CopyLocalAssembly>

<CopyLocalAssembly Include="Microsoft.Extensions.DependencyModel">
<Version>$(CoreSetupVersion)</Version>
<TFM>netstandard1.3</TFM>
</CopyLocalAssembly>
<CopyLocalAssembly Include="Microsoft.DotNet.PlatformAbstractions">
<Version>$(CoreSetupVersion)</Version>
<TFM>netstandard1.3</TFM>
</CopyLocalAssembly>

<CopyLocalAssembly Include="Newtonsoft.Json">
<Version>9.0.1</Version>
<TFM>netstandard1.0</TFM>
</CopyLocalAssembly>

<CopyLocalAssembly Include="System.Runtime.Serialization.Primitives">
<Version>4.1.1</Version>
<TFM>netstandard1.3</TFM>
</CopyLocalAssembly>

<CopyLocalAssembly>
<FullFilePath>$(NuGet_Packages)\%(CopyLocalAssembly.Identity)\%(CopyLocalAssembly.Version)\lib\%(CopyLocalAssembly.TFM)\%(CopyLocalAssembly.Identity).dll</FullFilePath>
</CopyLocalAssembly>
</ItemGroup>

<Copy SourceFiles="%(CopyLocalAssembly.FullFilePath)" DestinationFolder="$(OutDir)" />
</Target>

<Import Project="build\netstandard1.0\Microsoft.DotNet.Core.Sdk.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ Copyright (c) .NET Foundation. All rights reserved.
-->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MicrosoftDotNetCoreBuildTasksDirectory>$(MSBuildThisFileDirectory)../../tools/netstandard1.3/</MicrosoftDotNetCoreBuildTasksDirectory>
<MicrosoftDotNetCoreBuildTasksDirectoryRoot>$(MSBuildThisFileDirectory)../../tools/</MicrosoftDotNetCoreBuildTasksDirectoryRoot>
<MicrosoftDotNetCoreBuildTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp1.0</MicrosoftDotNetCoreBuildTasksTFM>
<MicrosoftDotNetCoreBuildTasksTFM Condition=" '$(MicrosoftDotNetCoreBuildTasksTFM)' == ''">net46</MicrosoftDotNetCoreBuildTasksTFM>
<MicrosoftDotNetCoreBuildTasksDirectory>$(MicrosoftDotNetCoreBuildTasksDirectoryRoot)$(MicrosoftDotNetCoreBuildTasksTFM)/</MicrosoftDotNetCoreBuildTasksDirectory>
<MicrosoftDotNetCoreBuildTasksAssembly>$(MicrosoftDotNetCoreBuildTasksDirectory)Microsoft.DotNet.Core.Build.Tasks.dll</MicrosoftDotNetCoreBuildTasksAssembly>
</PropertyGroup>

Expand Down