Ejemplo n.º 1
0
        // ---------------- Functions ----------------

        public override void Run(MeditationLogContext context)
        {
            var settings = new CakeLicenseHeaderUpdaterSettings
            {
                LicenseString = currentLicense,
                Threads       = 0,
            };

            settings.OldHeaderRegexPatterns.Add(oldLicense1);
            settings.OldHeaderRegexPatterns.Add(oldLicense2);

            settings.FileFilter = SolutionProjectHelpers.DefaultCsFileFilter;

            var files = new List <FilePath>();

            context.PerformActionOnSolutionCsFiles(
                context.SlnPath,
                (path) => files.Add(path),
                null,
                delegate(SolutionProject slnProject)
            {
                if (slnProject.Path.ToString().Contains("SethCS", StringComparison.OrdinalIgnoreCase))
                {
                    return(false);
                }

                return(true);
            }
                );

            context.UpdateLicenseHeaders(files, settings);
        }
Ejemplo n.º 2
0
        // ----------------- Functions -----------------

        public override void Run(MeditationLogContext context)
        {
            DockerBuilder.BuildManifestImage(
                context,
                DockerConstants.WinX64Platform,
                DockerConstants.LinuxX64Platform,
                DockerConstants.LinuxArm32Platform
                );
        }
        // ---------------- Functions ----------------

        public override void Run(MeditationLogContext context)
        {
            var electronBuilder = new ElectronBuilder(context);

            electronBuilder.Build("win");

            context.GenerateSha256(
                context.DesktopDistributionPath.CombineWithFilePath("win/Meditu Setup.exe"),
                context.DesktopDistributionPath.CombineWithFilePath("win/Meditu Setup.exe.sha256")
                );
        }
        // ---------------- Functions ----------------

        public override void Run(MeditationLogContext context)
        {
            var args = context.CreateFromArguments <VersionDumpArguments>();

            context.Information($"Writing version '{MedituConstants.VersionString}' to file '{args.OutputFile}'.");

            File.WriteAllText(
                args.OutputFile.ToString(),
                MedituConstants.VersionString
                );
        }
        // ----------------- Functions -----------------

        public override void Run(MeditationLogContext context)
        {
            TestConfig testConfig = new TestConfig
            {
                ResultsFolder = context.RepoRoot.Combine(new DirectoryPath("TestResults")),
                TestCsProject = context.SrcPath.CombineWithFilePath(new FilePath("Meditu.UnitTests/Meditu.UnitTests.csproj"))
            };
            UnitTestRunner runner = new UnitTestRunner(context, testConfig);

            TestArguments args = context.CreateFromArguments <TestArguments>();

            if (args.RunWithCodeCoverage)
            {
                runner.RunCodeCoverage(TestArguments.CoverageFilter);
            }
            else
            {
                runner.RunTests();
            }
        }
        // ----------------- 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);
                }
            }
        }
        // ----------------- Functions -----------------

        public static void PushPlatformImage(MeditationLogContext context, string platform)
        {
            var pusher = new DockerPusher(context);

            pusher.PushPlatformImage(platform);
        }
        public static void PushManifest(MeditationLogContext context)
        {
            var pusher = new DockerPusher(context);

            pusher.PushManifest();
        }
Ejemplo n.º 9
0
        // ----------------- Functions -----------------

        /// <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 static void DevopsPublish(MeditationLogContext context, string rid, string?publishDirName = null)
        {
            var publisher = new DevopsPublisher(context);

            publisher.DevopsPublish(rid, publishDirName);
        }
        // ----------------- Constructor -----------------

        public DockerPusher(MeditationLogContext context)
        {
            this.context = context;
        }
Ejemplo n.º 11
0
        public static void BuildManifestImage(MeditationLogContext context, params string[] platforms)
        {
            var builder = new DockerBuilder(context);

            builder.BuildManifestImage(platforms);
        }
Ejemplo n.º 12
0
        // ----------------- Constructor -----------------

        public DevopsPublisher(MeditationLogContext context)
        {
            this.context = context;
        }
        // ---------------- Functions ----------------

        public override void Run(MeditationLogContext context)
        {
            DockerPusher.PushPlatformImage(context, DockerConstants.LinuxX64Platform);
        }
Ejemplo n.º 14
0
        // ----------------- Functions -----------------

        public static void BuildPlatformImage(MeditationLogContext context, string platform)
        {
            var builder = new DockerBuilder(context);

            builder.BuildPlatformImage(platform);
        }
        // ---------------- Functions ----------------

        public override void Run(MeditationLogContext context)
        {
            DockerPusher.PushManifest(context);
        }
        // ---------------- Constructor ----------------

        public ElectronBuilder(MeditationLogContext context)
        {
            this.context = context;
        }
Ejemplo n.º 17
0
        // ----------------- Functions -----------------

        public override void Run(MeditationLogContext context)
        {
            DockerBuilder.BuildPlatformImage(context, DockerConstants.LinuxArm32Platform);
        }
        // ----------------- Functions -----------------

        public override void Run(MeditationLogContext context)
        {
            DevopsPublisher.DevopsPublish(context, "linux-arm", "linux-arm32");
        }
        // ----------------- Functions -----------------

        public override void Run(MeditationLogContext context)
        {
            DevopsPublisher.DevopsPublish(context, "win-x64");
        }
        // ---------------- Functions ----------------

        public override void Run(MeditationLogContext context)
        {
            var electronBuilder = new ElectronBuilder(context);

            electronBuilder.Build("mac");
        }
Ejemplo n.º 21
0
        // ----------------- Constructor -----------------

        public DockerBuilder(MeditationLogContext context)
        {
            this.context = context;
        }