Merge pull request #2331 from eerhardt/ConsumeNetCoreApp

Consume Microsoft.NETCore.App
This commit is contained in:
Eric Erhardt 2016-04-08 15:13:48 -05:00
commit eb793c5cf8
72 changed files with 507 additions and 234 deletions

8
.gitignore vendored
View file

@ -31,6 +31,10 @@ cmake/
# stage0 install directory
.dotnet_stage0
# `dotnet new` project.json.template files are generated by a pre-build step.
# ignore these files
/src/dotnet/commands/dotnet-new/**/project.json.template
### VisualStudio.gitignore from https://raw.githubusercontent.com/github/gitignore/master/VisualStudio.gitignore ###
## Ignore Visual Studio temporary files, build results, and
@ -115,10 +119,12 @@ _Chutzpah*
ipch/
*.aps
*.ncb
*.opensdf
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess

View file

@ -7,11 +7,11 @@
"dotnet-desktop-and-portable": "1.0.0-*"
},
"frameworks": {
"netstandardapp1.5": {
"netstandard1.5": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
}
},
"imports": [

View file

@ -6,7 +6,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
},
"Newtonsoft.Json": "8.0.3"
}

View file

@ -1,15 +1,19 @@
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Linq.Expressions": "4.0.11-rc2-24008",
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -6,7 +6,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
},
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
"Microsoft.DotNet.ProjectModel": "1.0.0-*",

View file

@ -8,7 +8,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
}
},
"imports": [

View file

@ -12,7 +12,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
}
}
}

View file

@ -7,7 +7,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
},
"DependencyContextValidator": "1.0.0-*"
},

View file

@ -6,7 +6,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
},
"DependencyContextValidator": "1.0.0-*"
},

View file

@ -12,7 +12,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
}
}
}

View file

@ -13,7 +13,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
}
}
}

View file

@ -12,7 +12,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
},
"System.Linq": "4.0.0"
}

View file

@ -11,7 +11,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
},
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*"
}

View file

@ -9,7 +9,7 @@
"portable-net45+win8"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008"
"NETStandard.Library": "1.5.0-rc2-24008"
}
}
},

View file

@ -116,7 +116,7 @@ else
init_distro_name
fi
__common_parameters="/p:Platform=$__build_arch /p:DotNetHostBinDir=$__dotnet_host_bin_dir /p:$__targets_param /p:DistroName=$__distro_name /p:HostVersion=$__host_ver /p:HostResolverVersion=$__fxr_ver /p:HostPolicyVersion=$__policy_ver /p:BuildNumberMajor=$__build_major /p:PreReleaseLabel=$__version_tag /verbosity:minimal"
__common_parameters="/p:Platform=$__build_arch /p:DotNetHostBinDir=$__dotnet_host_bin_dir /p:$__targets_param /p:DistroName=$__distro_name /p:HostVersion=$__host_ver /p:HostResolverVersion=$__fxr_ver /p:HostPolicyVersion=$__policy_ver /p:BuildNumberMajor=$__build_major /p:PreReleaseLabel=$__version_tag /p:CLIBuildVersion=$__build_major /verbosity:minimal"
$__corerun $__msbuild $__project_dir/projects/packages.builds $__common_parameters || exit 1

View file

@ -3,7 +3,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x64'" Include="Microsoft.NETCore.App.pkgproj" />
<Project Include="Microsoft.NETCore.App.pkgproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />

View file

@ -6,7 +6,7 @@
<Version>$(HostVersion)</Version>
<SkipPackageFileCheck>true</SkipPackageFileCheck>
<SkipValidatePackage>true</SkipValidatePackage>
<PackagePlatforms>x64;x86</PackagePlatforms>
<PackagePlatforms>x64;x86;</PackagePlatforms>
<OutputPath>$(PackagesOutputPath)</OutputPath>
<IncludeRuntimeJson>true</IncludeRuntimeJson>
</PropertyGroup>

View file

@ -6,7 +6,7 @@
<Version>$(HostPolicyVersion)</Version>
<SkipPackageFileCheck>true</SkipPackageFileCheck>
<SkipValidatePackage>true</SkipValidatePackage>
<PackagePlatforms>x64;x86</PackagePlatforms>
<PackagePlatforms>x64;x86;</PackagePlatforms>
<OutputPath>$(PackagesOutputPath)</OutputPath>
<IncludeRuntimeJson>true</IncludeRuntimeJson>
</PropertyGroup>

View file

@ -6,7 +6,7 @@
<Version>$(HostResolverVersion)</Version>
<SkipPackageFileCheck>true</SkipPackageFileCheck>
<SkipValidatePackage>true</SkipValidatePackage>
<PackagePlatforms>x64;x86</PackagePlatforms>
<PackagePlatforms>x64;x86;</PackagePlatforms>
<OutputPath>$(PackagesOutputPath)</OutputPath>
<IncludeRuntimeJson>true</IncludeRuntimeJson>
</PropertyGroup>

View file

@ -49,7 +49,9 @@ namespace Microsoft.DotNet.Cli.Build
return c.Success();
}
[Target(nameof(PrepareTargets.Init), nameof(PackagePkgProjects), nameof(CompileStage1), nameof(CompileStage2))]
// Moving PrepareTargets.RestorePackages after PackagePkgProjects because managed code depends on the
// Microsoft.NETCore.App package that is created during PackagePkgProjects.
[Target(nameof(PrepareTargets.Init), nameof(PackagePkgProjects), nameof(PrepareTargets.RestorePackages), nameof(CompileStage1), nameof(CompileStage2))]
public static BuildTargetResult Compile(BuildTargetContext c)
{
return c.Success();
@ -330,9 +332,26 @@ namespace Microsoft.DotNet.Cli.Build
public static void PublishSharedFramework(BuildTargetContext c, string outputDir, DotNetCli dotnetCli)
{
string SharedFrameworkSourceRoot = Path.Combine(Dirs.RepoRoot, "src", "sharedframework", "framework");
string SharedFrameworkTemplateSourceRoot = Path.Combine(Dirs.RepoRoot, "src", "sharedframework", "framework");
string SharedFrameworkNugetVersion = c.BuildContext.Get<string>("SharedFrameworkNugetVersion");
string sharedFrameworkRid;
if (PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows)
{
sharedFrameworkRid = $"win7-{PlatformServices.Default.Runtime.RuntimeArchitecture}";
}
else
{
sharedFrameworkRid = PlatformServices.Default.Runtime.GetRuntimeIdentifier();
}
string SharedFrameworkSourceRoot = GenerateSharedFrameworkProject(c, SharedFrameworkTemplateSourceRoot, sharedFrameworkRid);
dotnetCli.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes", "--fallbacksource", Dirs.Corehost)
.WorkingDirectory(SharedFrameworkSourceRoot)
.Execute()
.EnsureSuccessful();
// We publish to a sub folder of the PublishRoot so tools like heat and zip can generate folder structures easier.
string SharedFrameworkNameAndVersionRoot = Path.Combine(outputDir, "shared", SharedFrameworkName, SharedFrameworkNugetVersion);
c.BuildContext["SharedFrameworkPath"] = SharedFrameworkNameAndVersionRoot;
@ -343,19 +362,10 @@ namespace Microsoft.DotNet.Cli.Build
}
string publishFramework = "dnxcore50"; // Temporary, use "netcoreapp" when we update nuget.
string publishRuntime;
if (PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows)
{
publishRuntime = $"win7-{PlatformServices.Default.Runtime.RuntimeArchitecture}";
}
else
{
publishRuntime = PlatformServices.Default.Runtime.GetRuntimeIdentifier();
}
dotnetCli.Publish(
"--output", SharedFrameworkNameAndVersionRoot,
"-r", publishRuntime,
"-r", sharedFrameworkRid,
"-f", publishFramework,
SharedFrameworkSourceRoot).Execute().EnsureSuccessful();
@ -428,6 +438,30 @@ namespace Microsoft.DotNet.Cli.Build
File.WriteAllText(Path.Combine(SharedFrameworkNameAndVersionRoot, ".version"), content);
}
/// <summary>
/// Generates the real shared framework project that will get published.
/// </summary>
/// <param name="sharedFrameworkTemplatePath">The "sharedFramework" source template folder.</param>
private static string GenerateSharedFrameworkProject(BuildTargetContext c, string sharedFrameworkTemplatePath, string rid)
{
string sharedFrameworkProjectPath = Path.Combine(Dirs.Intermediate, "sharedFramework", "framework");
Utils.DeleteDirectory(sharedFrameworkProjectPath);
CopyRecursive(sharedFrameworkTemplatePath, sharedFrameworkProjectPath, true);
string templateFile = Path.Combine(sharedFrameworkProjectPath, "project.json.template");
JObject sharedFrameworkProject = JsonUtils.ReadProject(templateFile);
sharedFrameworkProject["dependencies"]["Microsoft.NETCore.App"] = c.BuildContext.Get<BuildVersion>("BuildVersion").NetCoreAppVersion;
((JObject)sharedFrameworkProject["runtimes"]).RemoveAll();
sharedFrameworkProject["runtimes"][rid] = new JObject();
string projectJsonPath = Path.Combine(sharedFrameworkProjectPath, "project.json");
JsonUtils.WriteProject(sharedFrameworkProject, projectJsonPath);
Rm(templateFile);
return sharedFrameworkProjectPath;
}
private static BuildTargetResult CompileCliSdk(BuildTargetContext c, DotNetCli dotnet, string outputDir)
{
var configuration = c.BuildContext.Get<string>("Configuration");

View file

@ -1,23 +1,24 @@
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using static Microsoft.DotNet.Cli.Build.FS;
using static Microsoft.DotNet.Cli.Build.Utils;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using System.Text.RegularExpressions;
namespace Microsoft.DotNet.Cli.Build
{
public class PrepareTargets
{
[Target(nameof(Init), nameof(RestorePackages))]
[Target(nameof(Init))]
public static BuildTargetResult Prepare(BuildTargetContext c) => c.Success();
[Target(nameof(CheckPrereqCmakePresent), nameof(CheckPlatformDependencies))]
@ -33,7 +34,7 @@ namespace Microsoft.DotNet.Cli.Build
public static BuildTargetResult CheckInstallerBuildPlatformDependencies(BuildTargetContext c) => c.Success();
// All major targets will depend on this in order to ensure variables are set up right if they are run independently
[Target(nameof(GenerateVersions), nameof(CheckPrereqs), nameof(LocateStage0), nameof(ExpectedBuildArtifacts))]
[Target(nameof(GenerateVersions), nameof(UpdateTemplateVersions), nameof(CheckPrereqs), nameof(LocateStage0), nameof(ExpectedBuildArtifacts))]
public static BuildTargetResult Init(BuildTargetContext c)
{
var runtimeInfo = PlatformServices.Default.Runtime;
@ -82,7 +83,7 @@ namespace Microsoft.DotNet.Cli.Build
};
c.BuildContext["BuildVersion"] = buildVersion;
c.BuildContext["CommitHash"] = commitHash;
c.BuildContext["SharedFrameworkNugetVersion"] = GetVersionFromProjectJson(Path.Combine(Dirs.RepoRoot, "src", "sharedframework", "framework", "project.json"));
c.BuildContext["SharedFrameworkNugetVersion"] = buildVersion.NetCoreAppVersion;
c.Info($"Building Version: {buildVersion.SimpleVersion} (NuGet Packages: {buildVersion.NuGetVersion})");
c.Info($"From Commit: {commitHash}");
@ -90,6 +91,27 @@ namespace Microsoft.DotNet.Cli.Build
return c.Success();
}
/// <summary>
/// Updates the Microsoft.NETCore.App version number in the `dotnet new` project.json.template files.
/// </summary>
[Target]
public static BuildTargetResult UpdateTemplateVersions(BuildTargetContext c)
{
IEnumerable<string> templateFiles = Directory.GetFiles(
Path.Combine(Dirs.RepoRoot, "src", "dotnet", "commands", "dotnet-new"),
"project.json.pretemplate",
SearchOption.AllDirectories);
foreach (string templateFile in templateFiles)
{
JObject projectRoot = JsonUtils.ReadProject(templateFile);
projectRoot["dependencies"]["Microsoft.NETCore.App"]["version"] = c.BuildContext.Get<BuildVersion>("BuildVersion").NetCoreAppVersion;
JsonUtils.WriteProject(projectRoot, Path.ChangeExtension(templateFile, "template"));
}
return c.Success();
}
[Target]
public static BuildTargetResult LocateStage0(BuildTargetContext c)
{
@ -206,8 +228,14 @@ namespace Microsoft.DotNet.Cli.Build
{
var dotnet = DotNetCli.Stage0;
dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes").WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "src")).Execute().EnsureSuccessful();
dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes").WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "tools")).Execute().EnsureSuccessful();
dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes", "--fallbacksource", Dirs.Corehost)
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "src"))
.Execute()
.EnsureSuccessful();
dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes")
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "tools"))
.Execute()
.EnsureSuccessful();
return c.Success();
}

View file

@ -70,7 +70,7 @@ namespace Microsoft.DotNet.Cli.Build
CleanNuGetTempCache();
var dotnet = DotNetCli.Stage2;
dotnet.Restore("--verbosity", "verbose", "--infer-runtimes")
dotnet.Restore("--verbosity", "verbose", "--infer-runtimes", "--fallbacksource", Dirs.Corehost)
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestPackages"))
.Execute()
.EnsureSuccessful();
@ -90,14 +90,26 @@ namespace Microsoft.DotNet.Cli.Build
dotnet.Restore(
"--verbosity", "verbose",
"--infer-runtimes",
"--fallbacksource", Dirs.TestPackages)
"--fallbacksource", Dirs.TestPackages,
"--fallbacksource", Dirs.Corehost)
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestProjects"))
.Execute().EnsureSuccessful();
.Execute()
.EnsureSuccessful();
// The 'ProjectWithTests' is a portable test app. Cannot call --infer-runtimes on it, since on win x64 machines,
// the x86 runtime is being inferred, and there are no x86 DotNetHost packages
dotnet.Restore(
"--verbosity", "verbose",
"--fallbacksource", Dirs.Corehost)
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectWithTests"))
.Execute()
.EnsureSuccessful();
// The 'ProjectModelServer' directory contains intentionally-unresolved dependencies, so don't check for success. Also, suppress the output
dotnet.Restore(
"--verbosity", "verbose",
"--infer-runtimes")
"--infer-runtimes",
"--fallbacksource", Dirs.Corehost)
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectModelServer", "DthTestProjects"))
.Execute();
@ -118,7 +130,8 @@ namespace Microsoft.DotNet.Cli.Build
dotnet.Restore("--verbosity", "verbose",
"--infer-runtimes",
"--fallbacksource", Dirs.TestPackages)
"--fallbacksource", Dirs.TestPackages,
"--fallbacksource", Dirs.Corehost)
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "DesktopTestProjects"))
.Execute().EnsureSuccessful();
@ -245,6 +258,14 @@ namespace Microsoft.DotNet.Cli.Build
.EnsureSuccessful();
}
// build ProjectWithTests, which is outside of TestProjects and targets netcoreapp
string projectWithTests = Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectWithTests");
c.Info($"Building: {projectWithTests}");
dotnet.Build("--framework", "netcoreapp1.0")
.WorkingDirectory(projectWithTests)
.Execute()
.EnsureSuccessful();
return c.Success();
}
@ -255,7 +276,9 @@ namespace Microsoft.DotNet.Cli.Build
CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "test"));
CleanNuGetTempCache();
DotNetCli.Stage2.Restore("--verbosity", "verbose", "--infer-runtimes", "--fallbacksource", Dirs.TestPackages)
DotNetCli.Stage2.Restore("--verbosity", "verbose",
"--fallbacksource", Dirs.TestPackages,
"--fallbacksource", Dirs.Corehost)
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "test"))
.Execute()
.EnsureSuccessful();

View file

@ -12,6 +12,7 @@
public string SimpleVersion => $"{Major}.{Minor}.{Patch}.{CommitCountString}";
public string VersionSuffix => $"{ReleaseSuffix}-{CommitCountString}";
public string NuGetVersion => $"{Major}.{Minor}.{Patch}-{VersionSuffix}";
public string NetCoreAppVersion => $"{Major}.{Minor}.{Patch}-rc2-3{CommitCountString}";
public string ProductionVersion => $"{Major}.{Minor}.{Patch}";
public string GenerateMsiVersion()

View file

@ -13,6 +13,7 @@ namespace Microsoft.DotNet.Cli.Build
"artifacts",
PlatformServices.Default.Runtime.GetRuntimeIdentifier());
public static readonly string Intermediate = Path.Combine(Output, "intermediate");
public static readonly string PackagesIntermediate = Path.Combine(Output, "packages/intermediate");
public static readonly string Packages = Path.Combine(Output, "packages");
public static readonly string Stage1 = Path.Combine(Output, "stage1");

View file

@ -0,0 +1,28 @@
using System;
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.Cli.Build
{
public static class JsonUtils
{
public static JObject ReadProject(string projectJsonPath)
{
using (TextReader projectFileReader = File.OpenText(projectJsonPath))
{
var projectJsonReader = new JsonTextReader(projectFileReader);
var serializer = new JsonSerializer();
return serializer.Deserialize<JObject>(projectJsonReader);
}
}
public static void WriteProject(JObject projectRoot, string projectJsonPath)
{
string projectJson = JsonConvert.SerializeObject(projectRoot, Formatting.Indented);
File.WriteAllText(projectJsonPath, projectJson + Environment.NewLine);
}
}
}

View file

@ -32,7 +32,7 @@ namespace Microsoft.DotNet.Scripts
coreFxLkgVersion = coreFxLkgVersion.Trim();
const string coreFxIdPattern = @"^(?i)((System\..*)|(NETStandard\.Library)|(Microsoft\.CSharp)|(Microsoft\.NETCore.*)|(Microsoft\.TargetingPack\.Private\.(CoreCLR|NETNative))|(Microsoft\.Win32\..*)|(Microsoft\.VisualBasic))$";
const string coreFxIdExclusionPattern = @"System.CommandLine";
const string coreFxIdExclusionPattern = @"System.CommandLine|Microsoft.NETCore.App";
List<DependencyInfo> dependencyInfos = c.GetDependencyInfos();
dependencyInfos.Add(new DependencyInfo()
@ -57,9 +57,7 @@ namespace Microsoft.DotNet.Scripts
{
List<DependencyInfo> dependencyInfos = c.GetDependencyInfos();
IEnumerable<string> projectJsonFiles = Enumerable.Union(
Directory.GetFiles(Dirs.RepoRoot, "project.json", SearchOption.AllDirectories),
Directory.GetFiles(Path.Combine(Dirs.RepoRoot, @"src\dotnet\commands\dotnet-new"), "project.json.template", SearchOption.AllDirectories));
IEnumerable<string> projectJsonFiles = Directory.GetFiles(Dirs.RepoRoot, "project.json", SearchOption.AllDirectories);
JObject projectRoot;
foreach (string projectJsonFile in projectJsonFiles)

View file

@ -17,7 +17,8 @@ namespace Microsoft.DotNet.Cli.Utils
IEnumerable<string> allowedExtensions,
string nugetPackagesRoot,
CommandResolutionStrategy commandResolutionStrategy,
string depsFilePath);
string depsFilePath,
string runtimeConfigPath);
}
}

View file

@ -17,7 +17,8 @@ namespace Microsoft.DotNet.Cli.Utils
IEnumerable<string> allowedExtensions,
string nugetPackagesRoot,
CommandResolutionStrategy commandResolutionStrategy,
string depsFilePath)
string depsFilePath,
string runtimeConfigPath)
{
var toolAssembly = toolLibrary?.RuntimeAssemblies
@ -35,7 +36,7 @@ namespace Microsoft.DotNet.Cli.Utils
return null;
}
var isPortable = IsPortableApp(commandPath);
var isPortable = IsPortableApp(commandPath, runtimeConfigPath);
return CreateCommandSpecWrappingWithCorehostIfDll(
commandPath,
@ -43,7 +44,8 @@ namespace Microsoft.DotNet.Cli.Utils
depsFilePath,
commandResolutionStrategy,
nugetPackagesRoot,
isPortable);
isPortable,
runtimeConfigPath);
}
private string GetCommandFilePath(string nugetPackagesRoot, LockFileTargetLibrary toolLibrary, LockFileItem runtimeAssembly)
@ -62,7 +64,8 @@ namespace Microsoft.DotNet.Cli.Utils
string depsFilePath,
CommandResolutionStrategy commandResolutionStrategy,
string nugetPackagesRoot,
bool isPortable)
bool isPortable,
string runtimeConfigPath)
{
var commandExtension = Path.GetExtension(commandPath);
@ -74,7 +77,8 @@ namespace Microsoft.DotNet.Cli.Utils
depsFilePath,
commandResolutionStrategy,
nugetPackagesRoot,
isPortable);
isPortable,
runtimeConfigPath);
}
return CreateCommandSpec(commandPath, commandArguments, commandResolutionStrategy);
@ -86,7 +90,8 @@ namespace Microsoft.DotNet.Cli.Utils
string depsFilePath,
CommandResolutionStrategy commandResolutionStrategy,
string nugetPackagesRoot,
bool isPortable)
bool isPortable,
string runtimeConfigPath)
{
var host = string.Empty;
var arguments = new List<string>();
@ -102,23 +107,46 @@ namespace Microsoft.DotNet.Cli.Utils
}
arguments.Add("exec");
if (runtimeConfigPath != null)
{
arguments.Add("--runtimeconfig");
arguments.Add(runtimeConfigPath);
}
if (depsFilePath != null)
{
arguments.Add("--depsfile");
arguments.Add(depsFilePath);
}
arguments.Add("--additionalprobingpath");
arguments.Add(nugetPackagesRoot);
arguments.Add(commandPath);
}
else
{
host = CoreHost.HostExePath;
arguments.Add(commandPath);
if (runtimeConfigPath != null)
{
arguments.Add("--runtimeconfig");
arguments.Add(runtimeConfigPath);
}
if (depsFilePath != null)
{
arguments.Add("--depsfile");
arguments.Add(depsFilePath);
}
arguments.Add("--additionalprobingpath");
arguments.Add(nugetPackagesRoot);
}
arguments.Add(commandPath);
if (depsFilePath != null)
{
arguments.Add("--depsfile");
arguments.Add(depsFilePath);
}
arguments.Add("--additionalprobingpath");
arguments.Add(nugetPackagesRoot);
arguments.AddRange(commandArguments);
return CreateCommandSpec(host, arguments, commandResolutionStrategy);
@ -134,14 +162,15 @@ namespace Microsoft.DotNet.Cli.Utils
return new CommandSpec(commandPath, escapedArgs, commandResolutionStrategy);
}
private bool IsPortableApp(string commandPath)
private bool IsPortableApp(string commandPath, string runtimeConfigPath)
{
var commandDir = Path.GetDirectoryName(commandPath);
var runtimeConfigPath = Directory.EnumerateFiles(commandDir)
.FirstOrDefault(x => x.EndsWith("runtimeconfig.json"));
if (runtimeConfigPath == null)
runtimeConfigPath = string.IsNullOrEmpty(runtimeConfigPath)
? Directory.EnumerateFiles(commandDir).FirstOrDefault(x => x.EndsWith("runtimeconfig.json"))
: runtimeConfigPath;
if (runtimeConfigPath == null || !File.Exists(runtimeConfigPath))
{
return false;
}

View file

@ -78,25 +78,11 @@ namespace Microsoft.DotNet.Cli.Utils
var depsFilePath =
projectContext.GetOutputPaths(configuration, buildBasePath, outputPath).RuntimeFiles.DepsJson;
var runtimeConfigPath =
projectContext.GetOutputPaths(configuration, buildBasePath, outputPath).RuntimeFiles.RuntimeConfigJson;
var toolLibrary = GetToolLibraryForContext(projectContext, commandName);
return ResolveFromDependencyLibrary(
toolLibrary,
depsFilePath,
commandName,
allowedExtensions,
commandArguments,
projectContext);
}
private CommandSpec ResolveFromDependencyLibrary(
LockFileTargetLibrary toolLibrary,
string depsFilePath,
string commandName,
IEnumerable<string> allowedExtensions,
IEnumerable<string> commandArguments,
ProjectContext projectContext)
{
return _packagedCommandSpecFactory.CreateCommandSpecFromLibrary(
toolLibrary,
commandName,
@ -104,7 +90,8 @@ namespace Microsoft.DotNet.Cli.Utils
allowedExtensions,
projectContext.PackagesDirectory,
s_commandResolutionStrategy,
depsFilePath);
depsFilePath,
runtimeConfigPath);
}
private LockFileTargetLibrary GetToolLibraryForContext(
@ -132,17 +119,11 @@ namespace Microsoft.DotNet.Cli.Utils
return null;
}
var projectContext = ProjectContext.Create(
return ProjectContext.Create(
projectRootPath,
framework,
PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers());
if (projectContext.RuntimeIdentifier == null)
{
return null;
}
return projectContext;
}
private IEnumerable<string> GetAllowedCommandExtensionsFromEnvironment(IEnvironmentProvider environment)

View file

@ -123,7 +123,8 @@ namespace Microsoft.DotNet.Cli.Utils
_allowedCommandExtensions,
projectContext.PackagesDirectory,
s_commandResolutionStrategy,
depsFilePath);
depsFilePath,
null);
}
private LockFile GetToolLockFile(

View file

@ -6,7 +6,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
},
"Microsoft.CodeAnalysis.CSharp": "1.3.0-beta1-20160405-05",
"Microsoft.Net.Compilers.netcore": "1.3.0-beta1-20160405-05",

View file

@ -248,6 +248,7 @@ int fx_muxer_t::parse_args_and_execute(const pal::string_t& own_dir, int argoff,
if (exec_mode)
{
known_opts.push_back(_X("--depsfile"));
known_opts.push_back(_X("--runtimeconfig"));
}
// Parse the known muxer arguments if any.
@ -304,15 +305,28 @@ int fx_muxer_t::parse_args_and_execute(const pal::string_t& own_dir, int argoff,
pal::string_t opts_deps_file = _X("--depsfile");
pal::string_t opts_probe_path = _X("--additionalprobingpath");
pal::string_t opts_runtime_config = _X("--runtimeconfig");
pal::string_t deps_file = get_last_known_arg(opts, opts_deps_file, _X(""));
pal::string_t runtime_config = get_last_known_arg(opts, opts_runtime_config, _X(""));
std::vector<pal::string_t> probe_paths = opts.count(opts_probe_path) ? opts[opts_probe_path] : std::vector<pal::string_t>();
trace::verbose(_X("Current argv is %s"), app_candidate.c_str());
pal::string_t app_or_deps = deps_file.empty() ? app_candidate : deps_file;
pal::string_t no_json = app_candidate;
pal::string_t dev_config_file;
auto config_file = get_runtime_config_from_file(no_json, &dev_config_file);
pal::string_t config_file, dev_config_file;
if(runtime_config.empty())
{
trace::verbose(_X("Finding runtimeconfig.json from [%s]"), app_candidate.c_str());
get_runtime_config_paths_from_app(app_candidate, &config_file, &dev_config_file);
}
else
{
trace::verbose(_X("Finding runtimeconfig.json from [%s]"), runtime_config.c_str());
get_runtime_config_paths_from_arg(runtime_config, &config_file, &dev_config_file);
}
runtime_config_t config(config_file, dev_config_file);
for (const auto& path : config.get_probe_paths())
{

View file

@ -246,9 +246,11 @@ SHARED_API int corehost_main(const int argc, const pal::char_t* argv[])
}
else
{
pal::string_t dev_config_file;
auto config_path = get_runtime_config_from_file(args.managed_application, &dev_config_file);
runtime_config_t config(config_path, dev_config_file);
pal::string_t config_file, dev_config_file;
get_runtime_config_paths_from_app(args.managed_application, &config_file, &dev_config_file);
runtime_config_t config(config_file, dev_config_file);
if (!config.is_valid())
{
trace::error(_X("Invalid runtimeconfig.json [%s] [%s]"), config.get_path().c_str(), config.get_dev_path().c_str());

View file

@ -6,20 +6,42 @@
#include "trace.h"
#include "libhost.h"
pal::string_t get_runtime_config_from_file(const pal::string_t& file, pal::string_t* dev_cfg)
void get_runtime_config_paths_from_app(const pal::string_t& app, pal::string_t* cfg, pal::string_t* dev_cfg)
{
auto name = get_filename_without_ext(file);
auto name = get_filename_without_ext(app);
auto json_name = name + _X(".runtimeconfig.json");
auto dev_json_name = name + _X(".runtimeconfig.dev.json");
auto json_path = get_directory(file);
auto json_path = get_directory(app);
auto dev_json_path = json_path;
append_path(&json_path, json_name.c_str());
append_path(&dev_json_path, dev_json_name.c_str());
trace::verbose(_X("Runtime config is cfg=%s dev=%s"), json_path.c_str(), dev_json_path.c_str());
dev_cfg->assign(dev_json_path);
return json_path;
cfg -> assign(json_path);
}
void get_runtime_config_paths_from_arg(const pal::string_t& arg, pal::string_t* cfg, pal::string_t* dev_cfg)
{
auto name = get_filename_without_ext(arg);
auto json_name = name + _X(".json");
auto dev_json_name = name + _X(".dev.json");
auto json_path = get_directory(arg);
auto dev_json_path = json_path;
append_path(&json_path, json_name.c_str());
append_path(&dev_json_path, dev_json_name.c_str());
trace::verbose(_X("Runtime config is cfg=%s dev=%s"), json_path.c_str(), dev_json_path.c_str());
dev_cfg->assign(dev_json_path);
cfg -> assign(json_path);
}
host_mode_t detect_operating_mode(const int argc, const pal::char_t* argv[], pal::string_t* p_own_dir)

View file

@ -80,7 +80,9 @@ public:
}
};
pal::string_t get_runtime_config_from_file(const pal::string_t& file, pal::string_t* dev_config_file);
void get_runtime_config_paths_from_app(const pal::string_t& file, pal::string_t* config_file, pal::string_t* dev_config_file);
void get_runtime_config_paths_from_arg(const pal::string_t& file, pal::string_t* config_file, pal::string_t* dev_config_file);
host_mode_t detect_operating_mode(const int argc, const pal::char_t* argv[], pal::string_t* own_dir = nullptr);
void try_patch_roll_forward_in_dir(const pal::string_t& cur_dir, const fx_ver_t& start_ver, pal::string_t* max_str);

View file

@ -11,7 +11,7 @@
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
}
},
"frameworks": {

View file

@ -6,7 +6,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "$(NetCoreAppVersion)"
}
},
"frameworks": {

View file

@ -11,7 +11,7 @@
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160316",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "$(NetCoreAppVersion)"
}
},
"tools": {

View file

@ -41,7 +41,7 @@
"Microsoft.NETCore.TestHost": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24008"
"version": "1.0.0-rc2-*"
},
"System.Diagnostics.TraceSource": "4.0.0-rc2-24008",
"System.Diagnostics.TextWriterTraceListener": "4.0.0-rc2-24008",

View file

@ -1,26 +0,0 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008"
},
"runtimes": {
"win7-x64": {},
"win7-x86": {},
"osx.10.10-x64": {},
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"centos.7-x64": {},
"rhel.7.2-x64": {},
"debian.8.2-x64": {}
},
"frameworks": {
"dnxcore50": {
"imports": [
"portable-net45+win8"
]
}
}
}

View file

@ -0,0 +1,19 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": "$(NetCoreAppVersion)"
},
"runtimes": {
"$(RID)": {}
},
"frameworks": {
"dnxcore50": {
"imports": [
"portable-net45+win8"
]
}
}
}

View file

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Xunit;
@ -18,7 +19,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
{
public class ArgumentForwardingTests : TestBase
{
private static readonly string s_reflectorExeName = "ArgumentsReflector" + Constants.ExeSuffix;
private static readonly string s_reflectorDllName = "ArgumentsReflector.dll";
private static readonly string s_reflectorCmdName = "reflector_cmd";
private string ReflectorPath { get; set; }
@ -38,7 +39,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
private void FindAndEnsureReflectorPresent()
{
ReflectorPath = Path.Combine(AppContext.BaseDirectory, s_reflectorExeName);
ReflectorPath = Path.Combine(AppContext.BaseDirectory, s_reflectorDllName);
ReflectorCmdPath = Path.Combine(AppContext.BaseDirectory, s_reflectorCmdName);
File.Exists(ReflectorPath).Should().BeTrue();
}
@ -182,7 +183,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
/// <returns></returns>
private string[] EscapeAndEvaluateArgumentString(string[] rawEvaluatedArgument)
{
var commandResult = Command.Create(ReflectorPath, rawEvaluatedArgument)
var commandResult = Command.Create("dotnet", new[] { ReflectorPath }.Concat(rawEvaluatedArgument))
.CaptureStdErr()
.CaptureStdOut()
.Execute();
@ -262,8 +263,8 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
{
StartInfo = new ProcessStartInfo
{
FileName = ReflectorPath,
Arguments = testUserArgument,
FileName = Env.GetCommandPath("dotnet", ".exe", ""),
Arguments = $"{ReflectorPath} {testUserArgument}",
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true

View file

@ -4,7 +4,10 @@
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.ProjectModel": {
"target": "project"
@ -16,11 +19,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]
@ -28,6 +32,6 @@
},
"testRunner": "xunit",
"scripts": {
"precompile": "dotnet publish ../ArgumentsReflector/project.json --framework netstandardapp1.5 --runtime %compile:RuntimeIdentifier% --output %compile:RuntimeOutputDir%"
"precompile": "dotnet publish ../ArgumentsReflector/project.json --framework netcoreapp1.0 --runtime %compile:RuntimeIdentifier% --output %compile:RuntimeOutputDir%"
}
}

View file

@ -4,11 +4,17 @@
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
},
"frameworks": {
"netstandardapp1.5": {
"imports": "dnxcore50"
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50"
]
}
},
"content": [

View file

@ -4,7 +4,10 @@
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.ProjectModel": {
"target": "project"
@ -17,11 +20,12 @@
},
"xunit": "2.1.0",
"xunit.netcore.extensions": "1.0.0-prerelease-00206",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
@ -10,11 +13,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -4,7 +4,11 @@
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Diagnostics.TraceSource": "4.0.0-rc2-24008",
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"NuGet.Versioning": "3.5.0-beta-1130",
"NuGet.Packaging": "3.5.0-beta-1130",
@ -21,11 +25,12 @@
},
"moq.netcore": "4.4.0-beta8",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
@ -13,11 +16,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -4,7 +4,10 @@
"keyFile": "../../tools/test_key.snk"
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.ProjectModel": {
"target": "project"
@ -13,11 +16,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -15,7 +15,8 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public override CommandResult Execute(string args="")
{
args = $"restore {args} --infer-runtimes";
args = $"restore {args}";
return base.Execute(args);
}
}

View file

@ -5,13 +5,16 @@
"keyFile": "../../tools/Key.snk"
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"System.Collections.Immutable": "1.2.0-rc2-24008",
"System.Net.NetworkInformation": "4.1.0-rc2-24008",
"FluentAssertions": "4.0.0",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22",
"dotnet-test-xunit": "1.0.0-dev-140469-38",
"Microsoft.DotNet.TestFramework": "1.0.0-*",
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
@ -22,8 +25,9 @@
}
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -5,7 +5,11 @@
"keyFile": "../../tools/Key.snk"
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Diagnostics.TraceSource": "4.0.0-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
},
@ -15,11 +19,12 @@
"FluentAssertions": "4.0.0",
"moq.netcore": "4.4.0-beta8",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"Microsoft.DotNet.ProjectModel": {
"target": "project"
},
@ -12,11 +15,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"Microsoft.Extensions.Testing.Abstractions": {
"target": "project"
},
@ -16,12 +19,13 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22",
"dotnet-test-xunit": "1.0.0-dev-140469-38",
"FluentAssertions": "4.2.2"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"netstandard1.3",
"portable-net45+win8"

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"Microsoft.Extensions.Testing.Abstractions": {
"target": "project"
},
@ -11,13 +14,14 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22",
"dotnet-test-xunit": "1.0.0-dev-140469-38",
"FluentAssertions": "4.2.2",
"moq.netcore": "4.4.0-beta8"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"netstandard1.3",
"portable-net45+win8"

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
@ -11,11 +14,12 @@
},
"Newtonsoft.Json": "7.0.1",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net451+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
},
@ -9,11 +12,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net451+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
@ -10,11 +13,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net451+win8"
]

View file

@ -4,6 +4,10 @@
"keyFile": "../../tools/Key.snk"
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"Microsoft.DotNet.Cli.Utils": {
"target": "project"
},
@ -21,13 +25,14 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22",
"dotnet-test-xunit": "1.0.0-dev-140469-38",
"moq.netcore": "4.4.0-beta8",
"FluentAssertions": "4.2.2"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net451+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"System.IO.Compression.ZipFile": "4.0.1-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
@ -11,11 +14,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net451+win8"
]

View file

@ -1,6 +1,9 @@
{
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"dotnet": {
"target": "project"
},
@ -15,12 +18,13 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22",
"dotnet-test-xunit": "1.0.0-dev-140469-38",
"System.Net.NameResolution": "4.0.0-rc2-24008"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.TestFramework": "1.0.0-*",
"Microsoft.DotNet.Tools.Tests.Utilities": {
@ -12,11 +15,12 @@
},
"xunit": "2.1.0",
"xunit.netcore.extensions": "1.0.0-prerelease-00206",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
@ -11,11 +14,12 @@
},
"xunit": "2.1.0",
"xunit.netcore.extensions": "1.0.0-prerelease-00206",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
@ -10,11 +13,12 @@
"target": "project"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -4,6 +4,7 @@
using System;
using System.IO;
using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.TestFramework;
using Microsoft.Extensions.PlatformAbstractions;
using Xunit;
using Microsoft.DotNet.Tools.Test.Utilities;
@ -18,8 +19,9 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
public GivenThatWeWantToRunTestsInTheConsole()
{
var testAssetManager = new TestAssetsManager(Path.Combine(RepoRoot, "TestAssets"));
var testInstance =
TestAssetsManager.CreateTestInstance("ProjectWithTests", identifier: "ConsoleTests").WithLockFiles();
testAssetManager.CreateTestInstance("ProjectWithTests", identifier: "ConsoleTests").WithLockFiles();
_projectFilePath = Path.Combine(testInstance.TestRoot, "project.json");
var contexts = ProjectContext.CreateContextForEachFramework(
@ -27,8 +29,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
null,
PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers());
var runtime = contexts.FirstOrDefault(c => !string.IsNullOrEmpty(c.RuntimeIdentifier))?.RuntimeIdentifier;
_defaultOutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", DefaultFramework, runtime);
_defaultOutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "netcoreapp1.0");
}
//ISSUE https://github.com/dotnet/cli/issues/1935
@ -55,7 +56,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
{
var testCommand = new DotnetTestCommand();
var result = testCommand.Execute(
$"{_projectFilePath} -o {Path.Combine(AppContext.BaseDirectory, "output")} -f netstandardapp1.5");
$"{_projectFilePath} -o {Path.Combine(AppContext.BaseDirectory, "output")} -f netcoreapp1.0");
result.Should().Pass();
}

View file

@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities;
using System.IO;
using FluentAssertions;
@ -18,15 +19,16 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
public GivenThatWeWantToUseDotnetTestE2EInDesignTime()
{
var testInstance = TestAssetsManager.CreateTestInstance("ProjectWithTests").WithLockFiles();
var testAssetManager = new TestAssetsManager(Path.Combine(RepoRoot, "TestAssets"));
var testInstance = testAssetManager.CreateTestInstance("ProjectWithTests").WithLockFiles();
_projectFilePath = Path.Combine(testInstance.TestRoot, "project.json");
var contexts = ProjectContext.CreateContextForEachFramework(
_projectFilePath,
null,
PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers());
var runtime = contexts.FirstOrDefault(c => !string.IsNullOrEmpty(c.RuntimeIdentifier))?.RuntimeIdentifier;
_outputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", DefaultFramework, runtime);
_outputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "netcoreapp1.0");
var buildCommand = new BuildCommand(_projectFilePath);
var result = buildCommand.Execute();

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"Newtonsoft.Json": "7.0.1",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
@ -16,11 +19,12 @@
"System.Net.Sockets": "4.1.0-rc2-24008",
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]

View file

@ -16,7 +16,6 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
private static readonly string ProjectJsonPath = Path.Combine(
AppContext.BaseDirectory,
"TestAssets",
"TestProjects",
"ProjectWithTests",
"project.json");

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"Newtonsoft.Json": "7.0.1",
"dotnet": {
"target": "project"
@ -11,20 +14,21 @@
"exclude": "Compile"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22",
"dotnet-test-xunit": "1.0.0-dev-140469-38",
"moq.netcore": "4.4.0-beta8",
"FluentAssertions": "4.2.2"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]
}
},
"content": [
"../../TestAssets/TestProjects/ProjectWithTests/project.json"
"../../TestAssets/ProjectWithTests/project.json"
],
"testRunner": "xunit"
}

View file

@ -79,7 +79,7 @@ namespace Microsoft.DotNet.Tests
var projectOutputPath = $"AppWithDirectDependencyDesktopAndPortable\\bin\\Debug\\net451\\{rid}\\dotnet-desktop-and-portable.exe";
return new[]
{
new object[] { ".NETStandardApp,Version=v1.5", "CoreFX", "lib\\netstandard1.5\\dotnet-desktop-and-portable.dll" },
new object[] { ".NETStandard,Version=v1.5", "CoreFX", "lib\\netstandard1.5\\dotnet-desktop-and-portable.dll" },
new object[] { ".NETFramework,Version=v4.5.1", "NetFX", projectOutputPath }
};
}

View file

@ -1,7 +1,10 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-24008",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-*"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
"Microsoft.DotNet.Tools.Tests.Utilities": {
"target": "project"
@ -14,11 +17,12 @@
"type": "build"
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-128011-22"
"dotnet-test-xunit": "1.0.0-dev-140469-38"
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [
"netstandardapp1.5",
"dnxcore50",
"portable-net45+win8"
]