From 77454d884a67be5c11df6bc08e05632d8d5a83ae Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 6 Feb 2017 18:42:52 -0800 Subject: [PATCH] Do not assume content of the SAMPLES_PROJECT_GLOB variable - samples folder may exist _only_ to enable use of a modified SAMPLES_PROJECT_GLOB Other alternatives to the `Directory.Exists("samples")` approach: - change default glob to something like `sam*ples/*/*.csproj` - that wouldn't require the samples folder but may in the future match something unintended - update PathResolver.shade in Sake to avoid `Directory.GetFiles(path, ...)` when path doesn't exist - could copy PathResolver.shade into KoreBuild to avoid updating Sake - but, this option can still hide real errors very easily --- build/shade/_k-standard-goals.shade | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/shade/_k-standard-goals.shade b/build/shade/_k-standard-goals.shade index b3e1ae5..be47738 100644 --- a/build/shade/_k-standard-goals.shade +++ b/build/shade/_k-standard-goals.shade @@ -154,13 +154,15 @@ default SAMPLES_PROJECT_GLOB = "samples/*/*.csproj" projectGlobs.AddRange(srcProjects); } + if (!BuildSrcOnly && Directory.Exists("test")) { - projectGlobs.AddRange(Files.Include(TEST_PROJECT_GLOB).ToList()); + projectGlobs.AddRange(Files.Include(TEST_PROJECT_GLOB).ToList()); } - if (!BuildSrcOnly && Directory.Exists("samples") && Directory.EnumerateFiles("samples", "*.csproj", SearchOption.AllDirectories).Any()) + + if (!BuildSrcOnly && Directory.Exists("samples")) { - projectGlobs.AddRange(Files.Include(SAMPLES_PROJECT_GLOB).ToList()); + projectGlobs.AddRange(Files.Include(SAMPLES_PROJECT_GLOB).ToList()); } if (projectGlobs.Any())