From bbdd8373cfda9564e96cf80d41d3bae39cc3ad27 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 25 Jul 2022 13:32:45 -0700 Subject: [PATCH] [iOS] Enable Diagnostics.Tracing tests (#72545) This change modifies System.Diagnostics.Tracing tests to enable the diagnostics runtime component feature. Additionally, the AppleAppBuilder task was modified to read the `AotDataFile` path that is produced when aot'ing assemblies. Previously, we would assume they were located in the publish directory. Co-authored-by: Ankit Jain --- .../tests/BasicEventSourceTest/ActivityTracking.cs | 4 --- .../BasicEventSourceTest/TestsManifestNegative.cs | 1 - .../tests/BasicEventSourceTest/TestsTraits.cs | 2 -- .../tests/BasicEventSourceTest/TestsUserErrors.cs | 1 - .../tests/BasicEventSourceTest/TestsWrite.cs | 2 -- .../TestsWriteEventToListener.cs | 8 ----- .../tests/System.Diagnostics.Tracing.Tests.csproj | 3 ++ src/libraries/tests.proj | 16 ++++++++-- src/mono/msbuild/apple/build/AppleApp.targets | 2 ++ src/tasks/AotCompilerTask/MonoAOTCompiler.cs | 36 ++++++++++++---------- src/tasks/AppleAppBuilder/AppleAppBuilder.cs | 20 ++++++++---- src/tasks/AppleAppBuilder/Xcode.cs | 10 ++++-- 12 files changed, 60 insertions(+), 45 deletions(-) diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/ActivityTracking.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/ActivityTracking.cs index 409efbe..1330901 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/ActivityTracking.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/ActivityTracking.cs @@ -14,7 +14,6 @@ namespace BasicEventSourceTests public class ActivityTracking { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/56073", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void StartStopCreatesActivity() { using ActivityEventListener l = new ActivityEventListener(); @@ -28,7 +27,6 @@ namespace BasicEventSourceTests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/56073", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task ActivityFlowsAsync() { using ActivityEventListener l = new ActivityEventListener(); @@ -77,7 +75,6 @@ namespace BasicEventSourceTests // the future we might decide it wasn't even desirable to begin with. // Compare with SetCurrentActivityIdAfterEventDoesNotFlowAsync below. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/56073", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SetCurrentActivityIdBeforeEventFlowsAsync() { using ActivityEventListener l = new ActivityEventListener(); @@ -103,7 +100,6 @@ namespace BasicEventSourceTests // the future we might decide it wasn't even desirable to begin with. // Compare with SetCurrentActivityIdBeforeEventFlowsAsync above. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/56073", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SetCurrentActivityIdAfterEventDoesNotFlowAsync() { using ActivityEventListener l = new ActivityEventListener(); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs index 5638ab8..c38afbb 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs @@ -59,7 +59,6 @@ namespace BasicEventSourceTests /// [Fact] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "https://github.com/dotnet/runtime/issues/21421")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_GenerateManifest_InvalidEventSources() { TestUtilities.CheckNoEventSourcesRunning("Start"); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs index 03369ed..2b1a208 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs @@ -29,7 +29,6 @@ namespace BasicEventSourceTests /// Tests EventSource Traits. /// [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_EventSource_Traits_Contract() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -46,7 +45,6 @@ namespace BasicEventSourceTests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_EventSource_Traits_Dynamic() { TestUtilities.CheckNoEventSourcesRunning("Start"); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs index 0b2f2c2..eee0aea 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs @@ -64,7 +64,6 @@ namespace BasicEventSourceTests /// Test the /// [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/runtime/issues/26197 - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_BadEventSource_MismatchedIds() { TestUtilities.CheckNoEventSourcesRunning("Start"); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs index a2c4dff..c8abf5f 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs @@ -37,7 +37,6 @@ namespace BasicEventSourceTests /// [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/21564", TargetFrameworkMonikers.NetFramework)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_Write_T_EventListener() { using (var listener = new EventListenerListener()) @@ -52,7 +51,6 @@ namespace BasicEventSourceTests /// [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/21564", TargetFrameworkMonikers.NetFramework)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_Write_T_EventListener_UseEvents() { Test_Write_T(new EventListenerListener(true)); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs index 97470a2..fd5ff41 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs @@ -19,7 +19,6 @@ namespace BasicEventSourceTests { [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/21569", TargetFrameworkMonikers.NetFramework)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public unsafe void Test_WriteEvent_ArgsBasicTypes() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -214,7 +213,6 @@ namespace BasicEventSourceTests [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/21569", TargetFrameworkMonikers.NetFramework)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_WriteEvent_ArgsCornerCases() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -248,7 +246,6 @@ namespace BasicEventSourceTests static partial void Test_WriteEvent_ArgsCornerCases_TestEtw(EventSourceTest log); [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_WriteEvent_InvalidCalls() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -271,7 +268,6 @@ namespace BasicEventSourceTests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_WriteEvent_ToChannel_Coverage() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -286,7 +282,6 @@ namespace BasicEventSourceTests [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/21569", TargetFrameworkMonikers.NetFramework)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_WriteEvent_ZeroKwds() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -323,7 +318,6 @@ namespace BasicEventSourceTests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_EventSourceCreatedEvents_BeforeListener() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -387,7 +381,6 @@ namespace BasicEventSourceTests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_EventSourceCreatedEvents_AfterListener() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -452,7 +445,6 @@ namespace BasicEventSourceTests [Theory] [InlineData(true)] [InlineData(false)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Test_EventListenerThrows_ExceptionIsNotRethrownToCaller(bool setThrowOnEventWriteErrorsFlag) { TestUtilities.CheckNoEventSourcesRunning("Start"); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj b/src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj index c8f85a3..a23a07e 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj +++ b/src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj @@ -5,6 +5,9 @@ true true + + diagnostics_tracing + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 3b94988..b259bb9 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -278,6 +278,19 @@ + + + + + + + + @@ -311,7 +324,6 @@ - @@ -377,7 +389,7 @@ - + diff --git a/src/mono/msbuild/apple/build/AppleApp.targets b/src/mono/msbuild/apple/build/AppleApp.targets index 89ec14f..6f0ecca 100644 --- a/src/mono/msbuild/apple/build/AppleApp.targets +++ b/src/mono/msbuild/apple/build/AppleApp.targets @@ -142,6 +142,8 @@ BuildAppBundle="$(GenerateXcodeProject)" Optimized="$(Optimized)" DevTeamProvisioning="$(DevTeamProvisioning)" + RuntimeComponents="$(RuntimeComponents)" + DiagnosticPorts="$(DiagnosticPorts)" OutputDirectory="$(AppleAppBundleDir)" AppDir="$(AppleAppDir)"> diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs index ad2a831..ea18150 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs @@ -243,6 +243,7 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task public string[]? FileWrites { get; private set; } private static readonly Encoding s_utf8Encoding = new UTF8Encoding(false); + private const string s_originalFullPathMetadataName = "__OriginalFullPath"; private List _fileWrites = new(); @@ -484,8 +485,9 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task if (!ProcessAndValidateArguments()) return false; - _assembliesToCompile = EnsureAndGetAssembliesInTheSameDir(Assemblies); - _assembliesToCompile = FilterAssemblies(_assembliesToCompile); + IEnumerable managedAssemblies = FilterOutUnmanagedAssemblies(Assemblies); + managedAssemblies = EnsureAllAssembliesInTheSameDir(managedAssemblies); + _assembliesToCompile = managedAssemblies.Where(f => !ShouldSkipForAOT(f)).ToList(); if (!string.IsNullOrEmpty(AotModulesTablePath) && !GenerateAotModulesTable(_assembliesToCompile, Profilers, AotModulesTablePath)) return false; @@ -582,39 +584,40 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task (File.GetLastWriteTimeUtc(inFile) > File.GetLastWriteTimeUtc(outFile)); } - private IList FilterAssemblies(IEnumerable assemblies) + private IEnumerable FilterOutUnmanagedAssemblies(IEnumerable assemblies) { List filteredAssemblies = new(); foreach (var asmItem in assemblies) { - if (ShouldSkip(asmItem)) + if (ShouldSkipForAOT(asmItem)) { if (parsedAotMode == MonoAotMode.LLVMOnly) throw new LogAsErrorException($"Building in AOTMode=LLVMonly is not compatible with excluding any assemblies for AOT. Excluded assembly: {asmItem.ItemSpec}"); Log.LogMessage(MessageImportance.Low, $"Skipping {asmItem.ItemSpec} because it has %(AOT_InternalForceToInterpret)=true"); - continue; } - - string assemblyPath = asmItem.GetMetadata("FullPath"); - using var assemblyFile = File.OpenRead(assemblyPath); - using PEReader reader = new(assemblyFile, PEStreamOptions.Default); - if (!reader.HasMetadata) + else { - Log.LogWarning($"Skipping unmanaged {assemblyPath} for AOT"); - continue; + string assemblyPath = asmItem.GetMetadata("FullPath"); + using var assemblyFile = File.OpenRead(assemblyPath); + using PEReader reader = new(assemblyFile, PEStreamOptions.Default); + if (!reader.HasMetadata) + { + Log.LogMessage(MessageImportance.Low, $"Skipping unmanaged {assemblyPath} for AOT"); + continue; + } } filteredAssemblies.Add(asmItem); } return filteredAssemblies; - - static bool ShouldSkip(ITaskItem asmItem) - => bool.TryParse(asmItem.GetMetadata("AOT_InternalForceToInterpret"), out bool skip) && skip; } - private IList EnsureAndGetAssembliesInTheSameDir(IList assemblies) + private static bool ShouldSkipForAOT(ITaskItem asmItem) + => bool.TryParse(asmItem.GetMetadata("AOT_InternalForceToInterpret"), out bool skip) && skip; + + private IEnumerable EnsureAllAssembliesInTheSameDir(IEnumerable assemblies) { string firstAsmDir = Path.GetDirectoryName(assemblies.First().GetMetadata("FullPath")) ?? string.Empty; bool allInSameDir = assemblies.All(asm => Path.GetDirectoryName(asm.GetMetadata("FullPath")) == firstAsmDir); @@ -640,6 +643,7 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task ITaskItem newAsm = new TaskItem(newPath); asmItem.CopyMetadataTo(newAsm); + asmItem.SetMetadata(s_originalFullPathMetadataName, asmPath); newAssemblies.Add(newAsm); } diff --git a/src/tasks/AppleAppBuilder/AppleAppBuilder.cs b/src/tasks/AppleAppBuilder/AppleAppBuilder.cs index 769979f..193e047 100644 --- a/src/tasks/AppleAppBuilder/AppleAppBuilder.cs +++ b/src/tasks/AppleAppBuilder/AppleAppBuilder.cs @@ -196,18 +196,26 @@ public class AppleAppBuilderTask : Task } Directory.CreateDirectory(binDir); - var assemblerFiles = new List(); - var assemblerFilesToLink = new List(); + List assemblerFiles = new List(); + List assemblerDataFiles = new List(); + List assemblerFilesToLink = new List(); foreach (ITaskItem file in Assemblies) { // use AOT files if available - var obj = file.GetMetadata("AssemblerFile"); - var llvmObj = file.GetMetadata("LlvmObjectFile"); + string obj = file.GetMetadata("AssemblerFile"); + string llvmObj = file.GetMetadata("LlvmObjectFile"); + string dataFile = file.GetMetadata("AotDataFile"); + if (!string.IsNullOrEmpty(obj)) { assemblerFiles.Add(obj); } + if (!string.IsNullOrEmpty(dataFile)) + { + assemblerDataFiles.Add(dataFile); + } + if (!string.IsNullOrEmpty(llvmObj)) { assemblerFilesToLink.Add(llvmObj); @@ -243,7 +251,7 @@ public class AppleAppBuilderTask : Task if (GenerateXcodeProject) { - XcodeProjectPath = generator.GenerateXCode(ProjectName, MainLibraryFileName, assemblerFiles, assemblerFilesToLink, + XcodeProjectPath = generator.GenerateXCode(ProjectName, MainLibraryFileName, assemblerFiles, assemblerDataFiles, assemblerFilesToLink, AppDir, binDir, MonoRuntimeHeaders, !isDevice, UseConsoleUITemplate, ForceAOT, ForceInterpreter, InvariantGlobalization, Optimized, EnableRuntimeLogging, EnableAppSandbox, DiagnosticPorts, RuntimeComponents, NativeMainSource); if (BuildAppBundle) @@ -261,7 +269,7 @@ public class AppleAppBuilderTask : Task } else if (GenerateCMakeProject) { - generator.GenerateCMake(ProjectName, MainLibraryFileName, assemblerFiles, assemblerFilesToLink, + generator.GenerateCMake(ProjectName, MainLibraryFileName, assemblerFiles, assemblerDataFiles, assemblerFilesToLink, AppDir, binDir, MonoRuntimeHeaders, !isDevice, UseConsoleUITemplate, ForceAOT, ForceInterpreter, InvariantGlobalization, Optimized, EnableRuntimeLogging, EnableAppSandbox, DiagnosticPorts, RuntimeComponents, NativeMainSource); } diff --git a/src/tasks/AppleAppBuilder/Xcode.cs b/src/tasks/AppleAppBuilder/Xcode.cs index 7649bd4..129b128 100644 --- a/src/tasks/AppleAppBuilder/Xcode.cs +++ b/src/tasks/AppleAppBuilder/Xcode.cs @@ -134,6 +134,7 @@ internal sealed class Xcode string projectName, string entryPointLib, IEnumerable asmFiles, + IEnumerable asmDataFiles, IEnumerable asmLinkFiles, string workspace, string binDir, @@ -150,7 +151,7 @@ internal sealed class Xcode string? runtimeComponents=null, string? nativeMainSource = null) { - var cmakeDirectoryPath = GenerateCMake(projectName, entryPointLib, asmFiles, asmLinkFiles, workspace, binDir, monoInclude, preferDylibs, useConsoleUiTemplate, forceAOT, forceInterpreter, invariantGlobalization, optimized, enableRuntimeLogging, enableAppSandbox, diagnosticPorts, runtimeComponents, nativeMainSource); + var cmakeDirectoryPath = GenerateCMake(projectName, entryPointLib, asmFiles, asmDataFiles, asmLinkFiles, workspace, binDir, monoInclude, preferDylibs, useConsoleUiTemplate, forceAOT, forceInterpreter, invariantGlobalization, optimized, enableRuntimeLogging, enableAppSandbox, diagnosticPorts, runtimeComponents, nativeMainSource); CreateXcodeProject(projectName, cmakeDirectoryPath); return Path.Combine(binDir, projectName, projectName + ".xcodeproj"); } @@ -191,6 +192,7 @@ internal sealed class Xcode string projectName, string entryPointLib, IEnumerable asmFiles, + IEnumerable asmDataFiles, IEnumerable asmLinkFiles, string workspace, string binDir, @@ -216,7 +218,6 @@ internal sealed class Xcode string[] resources = Directory.GetFileSystemEntries(workspace, "", SearchOption.TopDirectoryOnly) .Where(f => !excludes.Any(e => f.EndsWith(e, StringComparison.InvariantCultureIgnoreCase))) - .Concat(Directory.GetFiles(binDir, "*.aotdata")) .ToArray(); if (string.IsNullOrEmpty(nativeMainSource)) @@ -257,9 +258,12 @@ internal sealed class Xcode entitlements.Add (KeyValuePair.Create ("com.apple.security.network.client", "")); } + string appResources = string.Join(Environment.NewLine, asmDataFiles.Select(r => " " + r)); + appResources += string.Join(Environment.NewLine, resources.Where(r => !r.EndsWith("-llvm.o")).Select(r => " " + Path.GetRelativePath(binDir, r))); + string cmakeLists = Utils.GetEmbeddedResource("CMakeLists.txt.template") .Replace("%ProjectName%", projectName) - .Replace("%AppResources%", string.Join(Environment.NewLine, resources.Where(r => !r.EndsWith("-llvm.o")).Select(r => " " + Path.GetRelativePath(binDir, r)))) + .Replace("%AppResources%", appResources) .Replace("%MainSource%", nativeMainSource) .Replace("%MonoInclude%", monoInclude) .Replace("%HardenedRuntime%", hardenedRuntime ? "TRUE" : "FALSE"); -- 2.7.4