public void Should_parse_multiple_target_Frameworks() { var doc = new XmlDocument(); doc.LoadXml(MultiTargetFramework); MsBuildHelpers.GetTargetFrameworks(doc).Should().BeEquivalentTo(new[] { "net452", "netcoreapp1.1" }); }
/// <param name="publishDirName"> /// The directory inside of <see cref="MeditationLogContext.DevopsDistributionPath"/> /// to place the published project. /// Set to null to have it be <paramref name="rid"/>. /// </param> public void DevopsPublish(string rid, string?publishDirName = null) { const string configuration = "Release"; var publishDir = context.DevopsDistributionPath.Combine(publishDirName ?? rid); context.EnsureDirectoryExists(publishDir); context.CleanDirectory(publishDir); var publishSettings = new DotNetCorePublishSettings { Configuration = configuration, OutputDirectory = publishDir, MSBuildSettings = MsBuildHelpers.GetMsBuildSettings(configuration), // We'll be running in a docker image with the runtime, no need // to include the entire runtime. SelfContained = false, Runtime = rid }; context.DotNetCorePublish( context.DevopsCsProj.ToString(), publishSettings ); }
public void Should_not_throw_when_no_target_Framework_found() { var doc = new XmlDocument(); doc.LoadXml(NoTargetFramework); MsBuildHelpers.GetTargetFrameworks(doc).Should().BeNull(); }
// ----------------- Functions ----------------- public override void Run(MeditationLogContext context) { const string configuration = "Release"; var publishDir = context.DockerPath.Combine("bin"); context.EnsureDirectoryExists(publishDir); context.CleanDirectory(publishDir); var publishSettings = new DotNetCorePublishSettings { Configuration = configuration, OutputDirectory = publishDir, MSBuildSettings = MsBuildHelpers.GetMsBuildSettings(configuration), }; context.DotNetCorePublish( context.GuiCsProject.ToString(), publishSettings ); // No need to inclue these files in the docker image, // may as well decrease the file size a bit. var filesToDelete = new FilePath[] { publishDir.CombineWithFilePath("Meditu.Gui.exe"), publishDir.CombineWithFilePath("Meditu.Gui") }; foreach (FilePath path in filesToDelete) { if (context.FileExists(path)) { context.DeleteFile(path); } } }