Refactor CommandResolver into individual CommandResolver Implementation

classes.

Write Unit Tests covering Composite DefaultCommandResolver and
ScriptCommandResolver.

baseline

Baseline2
This commit is contained in:
Bryan 2016-02-24 16:05:55 -08:00 committed by Bryan Thornbury
parent 1fccdbd6ec
commit 42cc39252e
37 changed files with 2361 additions and 206 deletions

View file

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.ProjectModel.Graph;
using Microsoft.Extensions.PlatformAbstractions;
using NuGet.Frameworks;
using NuGet.Packaging;
namespace Microsoft.DotNet.Cli.Utils
{
public class AppBaseCommandResolver : AbstractPathBasedCommandResolver
{
public AppBaseCommandResolver(IEnvironmentProvider environment,
IPlatformCommandSpecFactory commandSpecFactory) : base(environment, commandSpecFactory) { }
internal override string ResolveCommandPath(CommandResolverArguments commandResolverArguments)
{
return _environment.GetCommandPathFromRootPath(
PlatformServices.Default.Application.ApplicationBasePath,
commandResolverArguments.CommandName);
}
internal override CommandResolutionStrategy GetCommandResolutionStrategy()
{
return CommandResolutionStrategy.BaseDirectory;
}
}
}