public override SdkResultBase Resolve(SdkReference sdkReference, SdkResolverContextBase resolverContext, SdkResultFactoryBase factory) { if (sdkReference.Name.Equals("notfound")) { return(null); } if (resolverContext.State != null) { return(factory.IndicateSuccess((string)resolverContext.State, "1.0")); } resolverContext.State = Expected; return(factory.IndicateSuccess("resolverpath", "1.0")); }
public override Framework.SdkResult Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory) { resolverContext.Logger.LogMessage($"{nameof(resolverContext.ProjectFilePath)} = {resolverContext.ProjectFilePath}", MessageImportance.High); resolverContext.Logger.LogMessage($"{nameof(resolverContext.SolutionFilePath)} = {resolverContext.SolutionFilePath}", MessageImportance.High); resolverContext.Logger.LogMessage($"{nameof(resolverContext.MSBuildVersion)} = {resolverContext.MSBuildVersion}", MessageImportance.High); return(_mapping.ContainsKey(sdkReference.Name) ? factory.IndicateSuccess(_mapping[sdkReference.Name], null) : factory.IndicateFailure(new[] { $"Not in {nameof(_mapping)}" })); }
public override SdkResultBase Resolve(SdkReference sdk, SdkResolverContextBase resolverContext, SdkResultFactoryBase factory) { resolverContext.Logger.LogMessage("MockSdkResolver2 running", MessageImportance.Normal); if (sdk.Name.StartsWith("2")) { return(factory.IndicateSuccess("resolverpath2", "version2", new[] { "WARNING2" })); } return(factory.IndicateFailure(new[] { "ERROR2" }, new[] { "WARNING2" })); }