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");