Esempio n. 1
0
        protected override void GenerateProject(BuildPartition buildPartition, ArtifactsPaths artifactsPaths, ILogger logger)
        {
            BenchmarkCase benchmark   = buildPartition.RepresentativeBenchmarkCase;
            var           projectFile = GetProjectFilePath(benchmark.Descriptor.Type, logger);

            string useLLVM = AotCompilerMode == MonoAotCompilerMode.llvm ? "true" : "false";

            using (var file = new StreamReader(File.OpenRead(projectFile.FullName)))
            {
                var(customProperties, sdkName) = GetSettingsThatNeedsToBeCopied(file, projectFile);

                string content = new StringBuilder(ResourceHelper.LoadTemplate("MonoAOTLLVMCsProj.txt"))
                                 .Replace("$PLATFORM$", buildPartition.Platform.ToConfig())
                                 .Replace("$CODEFILENAME$", Path.GetFileName(artifactsPaths.ProgramCodePath))
                                 .Replace("$CSPROJPATH$", projectFile.FullName)
                                 .Replace("$TFM$", TargetFrameworkMoniker)
                                 .Replace("$PROGRAMNAME$", artifactsPaths.ProgramName)
                                 .Replace("$COPIEDSETTINGS$", customProperties)
                                 .Replace("$CONFIGURATIONNAME$", buildPartition.BuildConfiguration)
                                 .Replace("$SDKNAME$", sdkName)
                                 .Replace("$RUNTIMEPACK$", CustomRuntimePack ?? "")
                                 .Replace("$COMPILERBINARYPATH$", AotCompilerPath)
                                 .Replace("$RUNTIMEIDENTIFIER$", CustomDotNetCliToolchainBuilder.GetPortableRuntimeIdentifier())
                                 .Replace("$USELLVM$", useLLVM)
                                 .ToString();

                File.WriteAllText(artifactsPaths.ProjectFilePath, content);
            }
        }
Esempio n. 2
0
 protected override string GetBinariesDirectoryPath(string buildArtifactsDirectoryPath, string configuration)
 => Path.Combine(buildArtifactsDirectoryPath, "bin", TargetFrameworkMoniker, CustomDotNetCliToolchainBuilder.GetPortableRuntimeIdentifier(), "publish");