Merge pull request #4024 from dotnet/piotrpMSFT/redistProj

src/redist/project.json
This commit is contained in:
Piotr Puszkiewicz 2016-08-09 18:19:12 -04:00 committed by GitHub
commit 6b04136c31
19 changed files with 166 additions and 123 deletions

View file

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

View file

@ -8,7 +8,7 @@
"Microsoft.Extensions.DependencyModel": {
"target": "project"
},
"NuGet.ProjectModel": "3.5.0-rc1-1653"
"NuGet.ProjectModel": "3.5.0-rc1-1697"
},
"frameworks": {
"net451": {

View file

@ -1,11 +0,0 @@
using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
}
}
}

View file

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

View file

@ -4,7 +4,6 @@ using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.DotNet.Cli.Utils;
using NugetProgram = NuGet.CommandLine.XPlat.Program;
namespace Microsoft.DotNet.Tools.Restore
{
@ -20,18 +19,11 @@ namespace Microsoft.DotNet.Tools.Restore
}
prefixArgs.Add("restore");
var result = Run(Enumerable.Concat(
var result = new NuGetForwardingApp(Enumerable.Concat(
prefixArgs,
args).ToArray());
args).ToArray()).Execute();
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,39 @@
// 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 GetNuGetExePath()
{
return Path.Combine(
AppContext.BaseDirectory,
s_nugetExeName);
}
}
}

View file

@ -17,35 +17,7 @@ namespace Microsoft.DotNet.Tools.Restore
{
DebugHelper.HandleDebugSwitch(ref args);
var app = new CommandLineApplication(false)
{
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);
return NuGet3.Restore(args);
}
}
}

View file

@ -25,19 +25,7 @@
]
}
},
"publishOptions": {
"include": [
"15.0/**",
"*.props",
"*.targets"
]
},
"dependencies": {
"NuGet.Commands": {
"version": "3.5.0-rc1-1697",
"exclude": "compile"
},
"NuGet.CommandLine.XPlat": "3.5.0-rc1-1697",
"Newtonsoft.Json": "9.0.1",
"System.Text.Encoding.CodePages": "4.0.1",
"System.Diagnostics.FileVersionInfo": "4.0.0",
@ -71,17 +59,9 @@
"exclude": "compile"
},
"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",
"Microsoft.Build": "0.1.0-preview-00029-160805",
"Microsoft.Build.Framework": "0.1.0-preview-00029-160805",
"Microsoft.DotNet.Core.Build.Tasks": {
"target": "project"

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

@ -0,0 +1,33 @@
{
"version": "1.0.0-featmsbuild-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"tool_csc": "1.0.0-featmsbuild-*",
"dotnet": "1.0.0-featmsbuild-*",
"tool_nuget": "1.0.0-featmsbuild-*",
"tool_msbuild": "1.0.0-featmsbuild-*",
"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"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dnxcore50",
"netstandardapp1.5",
"portable-net45+win8",
"portable-net45+wp80+win8+wpa81+dnxcore50"
]
}
}
}

View file

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

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"
]
}
}
}

View file

@ -0,0 +1,17 @@
{
"version": "1.0.0-featmsbuild-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"NuGet.CommandLine.XPlat": "3.5.0-rc1-1697"
},
"frameworks": {
"netcoreapp1.0": {
}
}
}