コード例 #1
0
ファイル: DotNetCoreAliases.cs プロジェクト: zokiz/cake
        public static void DotNetCoreClean(this ICakeContext context, string project, DotNetCoreCleanSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (settings == null)
            {
                settings = new DotNetCoreCleanSettings();
            }

            var cleaner = new DotNetCoreCleaner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
            cleaner.Clean(project, settings);
        }
コード例 #2
0
        private void RegisterCleanTasks(IProjectConfiguration projConfig)
        {
            this.Context.BuildCleanTask(projConfig.ProjectAlias);

            this.Context.BuildCleanTask("DotNetCoreClean", false, projConfig.ProjectAlias)
            .Does(() =>
            {
                var clnSettings = new DotNetCoreCleanSettings
                {
                    Configuration = projConfig.Configuration,
                    Framework     = projConfig.Framework
                };

                this.Context.DotNetCoreClean(projConfig.GetRelativeSlnFilePath().FullPath, clnSettings);
            });

            this.Context.BuildCleanTask("BinAndObj", false, projConfig.ProjectAlias)
            .Does(() =>
            {
                var paths = projConfig.GetAllProjectOutputDirectoryPaths();
                foreach (var path in paths)
                {
                    this.Context.Debug($"Cleaning Directory: {path}");
                    this.Context.CleanDirectories(path);
                }
            });

            this.Context.BuildCleanTask("BuildTemp", false, projConfig.ProjectAlias)
            .Does(() =>
            {
                var buildTempDir = projConfig.BuildTempDirectory;
                if (buildTempDir != null && this.Context.DirectoryExists(buildTempDir))
                {
                    this.Context.Debug($"Deleting BuildTemp directory: {buildTempDir.FullPath}");
                    this.Context.DeleteDirectory(buildTempDir, true);
                }
            });
        }