src/redist/project.json

This commit is contained in:
Piotr Puszkiewicz 2016-08-09 13:22:22 -07:00
parent 912a47f672
commit 3a55a4182f
22 changed files with 235 additions and 100 deletions

View file

@ -3,8 +3,16 @@
<Import Project="compile/Microsoft.DotNet.Cli.LzmaArchive.targets" /> <Import Project="compile/Microsoft.DotNet.Cli.LzmaArchive.targets" />
<Import Project="crossgen/Microsoft.DotNet.Cli.Crossgen.targets" /> <Import Project="crossgen/Microsoft.DotNet.Cli.Crossgen.targets" />
<PropertyGroup>
<BinaryToCorehostifyRelDir>runtimes/any/native</BinaryToCorehostifyRelDir>
<CoreSDKDir>$(RepoRoot)/resources/core-sdk</CoreSDKDir>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" /> <PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" />
<FilesToMove Include="$(BinaryToCorehostifyRelDir)/csc.exe;$(BinaryToCorehostifyRelDir)/MSBuild.exe;" />
<BundledTools Include="csc;MSBuild;NuGet.CommandLine.XPlat;dotnet" />
<CoreSDKContent Include="$(CoreSDKDir)/**/*" />
</ItemGroup> </ItemGroup>
<Target Name="Compile" DependsOnTargets="Prepare; <Target Name="Compile" DependsOnTargets="Prepare;
@ -58,7 +66,6 @@
<StageDirectory>%(Stage.StageDirectory)</StageDirectory> <StageDirectory>%(Stage.StageDirectory)</StageDirectory>
<StageSymbolsDirectory>%(Stage.StageSymbolsDirectory)</StageSymbolsDirectory> <StageSymbolsDirectory>%(Stage.StageSymbolsDirectory)</StageSymbolsDirectory>
<SdkOutputDirectory>$(StageDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory> <SdkOutputDirectory>$(StageDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory>
<BinaryToCorehostifyRelDir>runtimes/any/native</BinaryToCorehostifyRelDir>
<BinaryToCorehostifyOutDir>$(SdkOutputDirectory)/$(BinaryToCorehostifyRelDir)</BinaryToCorehostifyOutDir> <BinaryToCorehostifyOutDir>$(SdkOutputDirectory)/$(BinaryToCorehostifyRelDir)</BinaryToCorehostifyOutDir>
<MSBuildTargetsDirectory>$(SdkOutputDirectory)/runtimes/any/native</MSBuildTargetsDirectory> <MSBuildTargetsDirectory>$(SdkOutputDirectory)/runtimes/any/native</MSBuildTargetsDirectory>
@ -76,6 +83,7 @@
<BinariesToRemove Remove="*" /> <BinariesToRemove Remove="*" />
<BinariesToRemove Include="csc" /> <BinariesToRemove Include="csc" />
<BinariesToRemove Include="vbc" /> <BinariesToRemove Include="vbc" />
<BinariesToRemove Include="MSBuild" />
</ItemGroup> </ItemGroup>
<Delete Files="@(BinObj)" /> <Delete Files="@(BinObj)" />
@ -85,7 +93,7 @@
<!-- CopySharedFramework --> <!-- CopySharedFramework -->
<Copy SourceFiles="@(SharedFramework)" <Copy SourceFiles="@(SharedFramework)"
DestinationFiles="@(SharedFramework->'$(StageDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" /> DestinationFiles="@(SharedFramework->'$(StageDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
<!-- Publish DotNet --> <!-- Publish DotNet -->
<DotNetPublish ToolPath="%(Stage.DotnetDir)" <DotNetPublish ToolPath="%(Stage.DotnetDir)"
@ -93,7 +101,7 @@
Output="$(SdkOutputDirectory)" Output="$(SdkOutputDirectory)"
Configuration="$(Configuration)" Configuration="$(Configuration)"
VersionSuffix="$(CommitCount)" VersionSuffix="$(CommitCount)"
ProjectPath="$(SrcDirectory)/dotnet" /> ProjectPath="$(SrcDirectory)/redist" />
<!-- Corehostify Binaries --> <!-- Corehostify Binaries -->
<ItemGroup Condition=" '$(OSName)' != 'win' "> <ItemGroup Condition=" '$(OSName)' != 'win' ">
@ -121,36 +129,26 @@
File="%(SdkOutputChModTargets.FullPath)" File="%(SdkOutputChModTargets.FullPath)"
Mode="%(SdkOutputChModTargets.Mode)" /> Mode="%(SdkOutputChModTargets.Mode)" />
<DotNetPublish ToolPath="%(Stage.DotnetDir)" <RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/redist.deps.json"
Output="$(SdkOutputDirectory)" SectionName="runtimeTargets"
Framework="netcoreapp1.0" AssetPath="$(BinaryToCorehostifyRelDir)/%(BinariesToRemove.Identity).exe" />
ProjectPath="$(SrcDirectory)/compilers" />
<Copy SourceFiles="$(BinaryToCorehostifyOutDir)/csc.exe" <Copy SourceFiles="$(SdkOutputDirectory)/%(FilesToMove.Identity)"
DestinationFiles="$(SdkOutputDirectory)/csc.dll" /> DestinationFiles="$(SdkOutputDirectory)/%(FilesToMove.Filename).dll" />
<Move SourceFiles="$(BinaryToCorehostifyOutDir)/csc.exe" <Copy SourceFiles="$(SdkOutputDirectory)/redist.deps.json"
DestinationFiles="$(SdkOutputDirectory)/csc.exe" /> DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json" />
<Copy SourceFiles="$(SdkOutputDirectory)/compilers.deps.json" <Copy SourceFiles="$(SdkOutputDirectory)/redist.runtimeconfig.json"
DestinationFiles="$(SdkOutputDirectory)/csc.deps.json" /> DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).runtimeconfig.json" />
<Copy SourceFiles="$(SdkOutputDirectory)/compilers.runtimeconfig.json"
DestinationFiles="$(SdkOutputDirectory)/csc.runtimeconfig.json" />
<ChangeEntryPointLibraryName <ChangeEntryPointLibraryName
DepsFile="$(SdkOutputDirectory)/csc.deps.json" DepsFile="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json"
NewName="csc.deps.json" /> NewName="%(BundledTools.Identity).deps.json" />
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/csc.deps.json" <!-- cleanup project output we don't need -->
SectionName="runtimeTargets" <Delete Files="$(SdkOutputDirectory)/redist%(PublishOutputExtensions.Identity)" />
AssetPath="$(BinaryToCorehostifyRelDir)/%(BinariesToRemove.Identity).exe" /> <Delete Files="$(SdkOutputDirectory)/tool_msbuild%(PublishOutputExtensions.Identity)" />
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/dotnet.deps.json"
SectionName="runtimeTargets"
AssetPath="$(BinaryToCorehostifyRelDir)/%(BinariesToRemove.Identity).exe" />
<!-- cleanup compilers project output we don't need -->
<Delete Files="$(SdkOutputDirectory)/compilers%(PublishOutputExtensions.Identity)" />
<!-- Copy Host to SDK Directory --> <!-- Copy Host to SDK Directory -->
<Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(DotnetHostBaseName)" <Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(DotnetHostBaseName)"
@ -162,6 +160,10 @@
<Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(HostPolicyBaseName)" <Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(HostPolicyBaseName)"
DestinationFiles="$(SdkOutputDirectory)/$(HostPolicyBaseName)" /> DestinationFiles="$(SdkOutputDirectory)/$(HostPolicyBaseName)" />
<!-- copy core sdk -->
<Copy SourceFiles="@(CoreSDKContent)"
DestinationFolder="$(SdkOutputDirectory)/%(RecursiveDir)" />
<!-- Crossgen the Shared Framework --> <!-- Crossgen the Shared Framework -->
<ItemGroup> <ItemGroup>
<SdkFiles Remove="*" /> <SdkFiles Remove="*" />
@ -208,12 +210,8 @@
</ItemGroup> </ItemGroup>
<Copy SourceFiles="@(MSBuildTargetsToCopy)" <Copy SourceFiles="@(MSBuildTargetsToCopy)"
DestinationFiles="@(MSBuildTargetsToCopy->'$(SdkOutputDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" /> DestinationFiles="@(MSBuildTargetsToCopy->'$(SdkOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
<!-- Temporary workaround for MSBuild placing their .props files in the old 14.1 directory -->
<Move SourceFiles="$(SdkOutputDirectory)/14.1/Microsoft.Common.props"
DestinationFolder="$(SdkOutputDirectory)/15.0" />
<ItemGroup> <ItemGroup>
<FilesToClean Include="$(StageDirectory)/sdk/**/vbc.exe" /> <FilesToClean Include="$(StageDirectory)/sdk/**/vbc.exe" />
</ItemGroup> </ItemGroup>

View file

@ -0,0 +1,17 @@
<!--
***********************************************************************************************
Microsoft.NETCore.ImportBefore.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NETCoreProps Condition="'$(NETCoreProps)'==''">$(MSBuildExtensionsPath)\Microsoft.DotNet.Core.Sdk.props</NETCoreProps>
</PropertyGroup>
<Import Condition="Exists('$(NETCoreProps)')" Project="$(NETCoreProps)" />
</Project>

View file

@ -0,0 +1,17 @@
<!--
***********************************************************************************************
Microsoft.NuGet.ImportBefore.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NuGetProps Condition="'$(NuGetProps)'==''">$(MSBuildExtensionsPath)\Microsoft.NuGet.props</NuGetProps>
</PropertyGroup>
<Import Condition="Exists('$(NuGetProps)')" Project="$(NuGetProps)" />
</Project>

View file

@ -0,0 +1,17 @@
<!--
***********************************************************************************************
Microsoft.NETCore.ImportAfter.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NETCoreTargets Condition="'$(NETCoreTargets)'==''">$(MSBuildExtensionsPath)\Microsoft.DotNet.Core.Sdk.targets</NETCoreTargets>
</PropertyGroup>
<Import Condition="Exists('$(NETCoreTargets)')" Project="$(NETCoreTargets)" />
</Project>

View file

@ -0,0 +1,17 @@
<!--
***********************************************************************************************
Microsoft.NuGet.ImportAfter.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NuGetTargets Condition="'$(NuGetTargets)'==''">$(MSBuildExtensionsPath)\Microsoft.NuGet.targets</NuGetTargets>
</PropertyGroup>
<Import Condition="Exists('$(NuGetTargets)')" Project="$(NuGetTargets)" />
</Project>

View file

@ -1,5 +1,5 @@
{ {
"version": "1.0.0-*", "version": "1.0.0-featmsbuild-*",
"buildOptions": { "buildOptions": {
"emitEntryPoint": true "emitEntryPoint": true
}, },

View file

@ -21,8 +21,6 @@ namespace Microsoft.DotNet.Cli
_forwardingApp = new ForwardingApp( _forwardingApp = new ForwardingApp(
GetMSBuildExePath(), GetMSBuildExePath(),
argsToForward, argsToForward,
depsFile: GetDepsFile(),
runtimeConfig: GetRuntimeConfig(),
environmentVariables: GetEnvironmentVariables()); environmentVariables: GetEnvironmentVariables());
} }
@ -56,19 +54,18 @@ namespace Microsoft.DotNet.Cli
private static string GetRuntimeConfig() private static string GetRuntimeConfig()
{ {
return Path.Combine(AppContext.BaseDirectory, "dotnet.runtimeconfig.json"); return Path.Combine(AppContext.BaseDirectory, "msbuild.runtimeconfig.json");
} }
private static string GetDepsFile() private static string GetDepsFile()
{ {
return Path.Combine(AppContext.BaseDirectory, "dotnet.deps.json"); return Path.Combine(AppContext.BaseDirectory, "msbuild.deps.json");
} }
private static string GetMSBuildExePath() private static string GetMSBuildExePath()
{ {
return Path.Combine( return Path.Combine(
AppContext.BaseDirectory, AppContext.BaseDirectory,
"runtimes", "any", "native",
s_msbuildExeName); s_msbuildExeName);
} }

View file

@ -4,7 +4,6 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using NugetProgram = NuGet.CommandLine.XPlat.Program;
namespace Microsoft.DotNet.Tools.Restore namespace Microsoft.DotNet.Tools.Restore
{ {
@ -20,18 +19,11 @@ namespace Microsoft.DotNet.Tools.Restore
} }
prefixArgs.Add("restore"); prefixArgs.Add("restore");
var result = Run(Enumerable.Concat( var result = new NuGetForwardingApp(Enumerable.Concat(
prefixArgs, prefixArgs,
args).ToArray()); args).ToArray()).Execute();
return result; return result;
} }
private static int Run(string[] nugetArgs)
{
var nugetAsm = typeof(NugetProgram).GetTypeInfo().Assembly;
var mainMethod = nugetAsm.EntryPoint;
return (int)mainMethod.Invoke(null, new object[] { nugetArgs });
}
} }
} }

View file

@ -0,0 +1,44 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.InternalAbstractions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Restore
{
public class NuGetForwardingApp
{
private const string s_nugetExeName = "NuGet.CommandLine.XPlat.dll";
private readonly ForwardingApp _forwardingApp;
public NuGetForwardingApp(string[] argsToForward)
{
_forwardingApp = new ForwardingApp(
GetNuGetExePath(),
argsToForward);
}
public int Execute()
{
return _forwardingApp.Execute();
}
private static string GetHostPath()
{
return new Muxer().MuxerPath;
}
private static string GetNuGetExePath()
{
return Path.Combine(
AppContext.BaseDirectory,
s_nugetExeName);
}
}
}

View file

@ -17,35 +17,7 @@ namespace Microsoft.DotNet.Tools.Restore
{ {
DebugHelper.HandleDebugSwitch(ref args); DebugHelper.HandleDebugSwitch(ref args);
var app = new CommandLineApplication(false) return NuGet3.Restore(args);
{
Name = "dotnet restore",
FullName = ".NET project dependency restorer",
Description = "Restores dependencies listed in project.json"
};
app.OnExecute(() =>
{
try
{
return NuGet3.Restore(args);
}
catch (InvalidOperationException e)
{
Console.WriteLine(e.Message);
return -1;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return -2;
}
});
return app.Execute(args);
} }
} }
} }

View file

@ -25,19 +25,7 @@
] ]
} }
}, },
"publishOptions": {
"include": [
"15.0/**",
"*.props",
"*.targets"
]
},
"dependencies": { "dependencies": {
"NuGet.Commands": {
"version": "3.5.0-rc1-1697",
"exclude": "compile"
},
"NuGet.CommandLine.XPlat": "3.5.0-rc1-1697",
"Newtonsoft.Json": "9.0.1", "Newtonsoft.Json": "9.0.1",
"System.Text.Encoding.CodePages": "4.0.1", "System.Text.Encoding.CodePages": "4.0.1",
"System.Diagnostics.FileVersionInfo": "4.0.0", "System.Diagnostics.FileVersionInfo": "4.0.0",
@ -71,17 +59,9 @@
"exclude": "compile" "exclude": "compile"
}, },
"MSBuild": "0.1.0-preview-00029-160805",
"Microsoft.Build.Framework": "0.1.0-preview-00029-160805", "Microsoft.Build": "0.1.0-preview-00029-160805",
"Microsoft.Build.Tasks.Core": "0.1.0-preview-00029-160805", "Microsoft.Build.Framework": "0.1.0-preview-00029-160805",
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00029-160805",
"Microsoft.Build.Targets": "0.1.0-preview-00029-160805",
"Microsoft.Build": "0.1.0-preview-00029-160805",
"Microsoft.Net.Compilers.netcore": "1.3.0",
"Microsoft.Net.Compilers.Targets.NetCore": "0.1.5-dev",
"Microsoft.Cci": "4.0.0-rc3-24128-00",
"Microsoft.Composition": "1.0.30",
"Microsoft.NuGet.Build.Tasks": "1.0.0-alpha-000002",
"Microsoft.DotNet.Core.Build.Tasks": { "Microsoft.DotNet.Core.Build.Tasks": {
"target": "project" "target": "project"

27
src/nuget/project.json Normal file
View file

@ -0,0 +1,27 @@
{
"version": "1.0.0-featmsbuild-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"NuGet.Commands": {
"version": "3.5.0-rc1-1697",
"exclude": "compile"
},
"NuGet.CommandLine.XPlat": "3.5.0-rc1-1697"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dnxcore50",
"netstandardapp1.5",
"portable-net45+win8",
"portable-net45+wp80+win8+wpa81+dnxcore50"
]
}
}
}

26
src/redist/project.json Normal file
View file

@ -0,0 +1,26 @@
{
"version": "1.0.0-featmsbuild-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"csc": "1.0.0-featmsbuild-*",
"dotnet": "1.0.0-featmsbuild-*",
"nuget": "1.0.0-featmsbuild-*",
"tool_msbuild": "1.0.0-featmsbuild-*"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dnxcore50",
"netstandardapp1.5",
"portable-net45+win8",
"portable-net45+wp80+win8+wpa81+dnxcore50"
]
}
}
}

View file

@ -0,0 +1,31 @@
{
"version": "1.0.0-featmsbuild-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"MSBuild": "0.1.0-preview-00029-160805",
"Microsoft.Build.Framework": "0.1.0-preview-00029-160805",
"Microsoft.Build.Tasks.Core": "0.1.0-preview-00029-160805",
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00029-160805",
"Microsoft.Build.Targets": "0.1.0-preview-00029-160805",
"Microsoft.Build": "0.1.0-preview-00029-160805",
"Microsoft.Net.Compilers.netcore": "1.3.0",
"Microsoft.Net.Compilers.Targets.NetCore": "0.1.5-dev",
"Microsoft.Cci": "4.0.0-rc3-24128-00",
"Microsoft.Composition": "1.0.30",
"Microsoft.NuGet.Build.Tasks": "1.0.0-alpha-000002"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dnxcore50",
"portable-net45+win8"
]
}
}
}