コード例 #1
0
        public void Should_parse_multiple_target_Frameworks()
        {
            var doc = new XmlDocument();

            doc.LoadXml(MultiTargetFramework);
            MsBuildHelpers.GetTargetFrameworks(doc).Should().BeEquivalentTo(new[] { "net452", "netcoreapp1.1" });
        }
コード例 #2
0
        /// <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
                );
        }
コード例 #3
0
        public void Should_not_throw_when_no_target_Framework_found()
        {
            var doc = new XmlDocument();

            doc.LoadXml(NoTargetFramework);
            MsBuildHelpers.GetTargetFrameworks(doc).Should().BeNull();
        }
コード例 #4
0
        // ----------------- 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);
                }
            }
        }