From d35d168973941f12ebab55c48586905c8101dbec Mon Sep 17 00:00:00 2001 From: anpete Date: Mon, 17 Feb 2014 22:28:22 -0800 Subject: [PATCH] Enable warningsAsErrors compiler option in project gen --- build/_k-generate-projects.shade | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build/_k-generate-projects.shade b/build/_k-generate-projects.shade index a25be3ef43..cc41f193a1 100644 --- a/build/_k-generate-projects.shade +++ b/build/_k-generate-projects.shade @@ -261,9 +261,13 @@ functions .ToList(); var sharedDefines = Get>(compilationOptions, "define") ?? new object[0]; + object unsafeValue = Get(compilationOptions, "allowUnsafe"); bool sharedAllowUnsafeCode = unsafeValue == null ? false : (bool)unsafeValue; + object warningsValue = Get(compilationOptions, "warningsAsErrors"); + bool sharedWarningsAsErrors = warningsValue == null ? false : (bool)warningsValue; + // HACK: Assume the packages folder is 2 up from the projectDir string packagesDir = Path.GetFullPath(Path.Combine(projectDir, "..", "..", "packages")); @@ -295,11 +299,15 @@ functions var specificCompilationOptions = GetObject(props, "compilationOptions") ?? compilationOptions ?? new Dictionary(); var specificDefines = Get>(specificCompilationOptions, "define") ?? new object[0]; + object specificUnsafeValue = Get(specificCompilationOptions, "allowUnsafe"); bool allowUnsafeCode = unsafeValue == null ? sharedAllowUnsafeCode : (bool)specificUnsafeValue; + string extraProperties = (allowUnsafeCode ? Environment.NewLine + "true" : ""); - string extraProperties = (allowUnsafeCode ? "\ntrue" : ""); - + object specificWarningsValue = Get(specificCompilationOptions, "warningsAsErrors"); + bool warningsAsErrors = specificWarningsValue == null ? sharedWarningsAsErrors : (bool)specificWarningsValue; + extraProperties += (warningsAsErrors ? Environment.NewLine + "true" : ""); + if (isWebSample) { var config = Path.Combine(projectDir, "web.config");