From 5ac5c720cb1f8b7f73c8f0c2243f94d25a82af5d 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 966cd96f2..6ecfb6f0d 100644 --- a/src/Microsoft.Framework.Runtime/GlobalSettings.cs +++ b/src/Microsoft.Framework.Runtime/GlobalSettings.cs @@ -13,7 +13,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; } @@ -42,10 +42,11 @@ public static bool TryGetGlobalSettings(string path, out GlobalSettings globalSe string json = File.ReadAllText(globalJsonPath); var settings = JObject.Parse(json); - var sources = settings["sources"]; + // TODO: Remove sources + var projectSearchPaths = settings["projectSearchPaths"] ?? 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)); }