From 4645885ed5c6047ea5429d6c6bd0c920b11af679 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sat, 10 Jan 2015 04:44:40 -0800 Subject: [PATCH] Rename sources to projectSearchPaths in global.json - Allow sources to stay for now while projects transition #925 --- src/Microsoft.Framework.Runtime/GlobalSettings.cs | 7 ++++--- src/Microsoft.Framework.Runtime/ProjectResolver.cs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.Framework.Runtime/GlobalSettings.cs b/src/Microsoft.Framework.Runtime/GlobalSettings.cs index abfa3ab30..4f87a7b9e 100644 --- a/src/Microsoft.Framework.Runtime/GlobalSettings.cs +++ b/src/Microsoft.Framework.Runtime/GlobalSettings.cs @@ -14,7 +14,7 @@ public class GlobalSettings { public const string GlobalFileName = "global.json"; - public IList SourcePaths { get; private set; } + public IList ProjectSearchPaths { get; private set; } public IDictionary PackageHashes { get; private set; } public string PackagesPath { get; private set; } public string FilePath { get; private set; } @@ -53,10 +53,11 @@ public static bool TryGetGlobalSettings(string path, out GlobalSettings globalSe throw FileFormatException.Create(ex, globalJsonPath); } - var sources = settings["sources"]; + // TODO: Remove sources + var projectSearchPaths = settings["projects"] ?? settings["sources"]; var dependencies = settings["dependencies"] as JObject; - globalSettings.SourcePaths = sources == null ? new string[] { } : sources.ToObject(); + globalSettings.ProjectSearchPaths = projectSearchPaths == null ? new string[] { } : projectSearchPaths.ToObject(); globalSettings.PackagesPath = settings.Value("packages"); globalSettings.PackageHashes = new Dictionary(); globalSettings.FilePath = globalJsonPath; diff --git a/src/Microsoft.Framework.Runtime/ProjectResolver.cs b/src/Microsoft.Framework.Runtime/ProjectResolver.cs index adb7617aa..856b9894c 100644 --- a/src/Microsoft.Framework.Runtime/ProjectResolver.cs +++ b/src/Microsoft.Framework.Runtime/ProjectResolver.cs @@ -54,7 +54,7 @@ private IEnumerable ResolveSearchPaths(string projectPath, string rootPa if (GlobalSettings.TryGetGlobalSettings(rootPath, out global)) { - foreach (var sourcePath in global.SourcePaths) + foreach (var sourcePath in global.ProjectSearchPaths) { paths.Add(Path.Combine(rootPath, sourcePath)); }