From c97648e684f45761f4775c31c02a98ba1b2f1aa4 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Wed, 25 May 2016 09:11:54 -0500 Subject: [PATCH] Add support to update-dependencies to not update the dependencies in a folder. Folders can opt-in to not getting their dependencies updated by placing a '.noautoupdate' file in the folder of their project.json. --- .../PortableAppWithIntentionalManagedDowngrade/.noautoupdate | 0 scripts/update-dependencies/UpdateFilesTargets.cs | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 TestAssets/TestProjects/PortableTests/PortableAppWithIntentionalManagedDowngrade/.noautoupdate diff --git a/TestAssets/TestProjects/PortableTests/PortableAppWithIntentionalManagedDowngrade/.noautoupdate b/TestAssets/TestProjects/PortableTests/PortableAppWithIntentionalManagedDowngrade/.noautoupdate new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/update-dependencies/UpdateFilesTargets.cs b/scripts/update-dependencies/UpdateFilesTargets.cs index c4a7eefc0..625fd329c 100644 --- a/scripts/update-dependencies/UpdateFilesTargets.cs +++ b/scripts/update-dependencies/UpdateFilesTargets.cs @@ -85,9 +85,12 @@ namespace Microsoft.DotNet.Scripts { List dependencyInfos = c.GetDependencyInfos(); + const string noUpdateFileName = ".noautoupdate"; + IEnumerable projectJsonFiles = Enumerable.Union( Directory.GetFiles(Dirs.RepoRoot, "project.json", SearchOption.AllDirectories), - Directory.GetFiles(Path.Combine(Dirs.RepoRoot, @"src\dotnet\commands\dotnet-new"), "project.json.pretemplate", SearchOption.AllDirectories)); + Directory.GetFiles(Path.Combine(Dirs.RepoRoot, @"src\dotnet\commands\dotnet-new"), "project.json.pretemplate", SearchOption.AllDirectories)) + .Where(p => !File.Exists(Path.Combine(Path.GetDirectoryName(p), noUpdateFileName))); JObject projectRoot; foreach (string projectJsonFile in projectJsonFiles)