Ejemplo n.º 1
0
        public void Clean(Project project)
        {
            if (project == null)
            {
                throw new ArgumentNullException(nameof(project));
            }

            if (_cleanedProjects.Contains(project.FullPath))
            {
                return;
            }

            _cleanedProjects.Add(project.FullPath);

            Disk.DeleteDirectory(project.BuildDirectory);
            Disk.DeleteDirectory(project.CacheDirectory);

            // Remove files installed by stuff
            Installer.CleanAll(Log,
                               project.StuffFiles.Select(
                                   x => Path.Combine(project.RootDirectory, x.NativePath)));

            foreach (var pref in project.ProjectReferences)
            {
                Clean(Project.Load(Path.Combine(project.RootDirectory, pref.ProjectPath)));
            }
        }
Ejemplo n.º 2
0
        public void Clean(Project project)
        {
            if (project == null)
            {
                throw new ArgumentNullException(nameof(project));
            }

            if (_cleanedProjects.Contains(project.FullPath))
            {
                return;
            }

            _cleanedProjects.Add(project.FullPath);

            if (_target != null)
            {
                using (var driver = new BuildDriver(Log.GetQuieterLog(), _target,
                                                    new BuildOptions {
                    Configuration = _configuration
                },
                                                    project, project.Config))
                    driver.Clean();
            }
            else
            {
                Disk.DeleteDirectory(project.BuildDirectory);
                Disk.DeleteDirectory(project.CacheDirectory);

                // Remove files installed by stuff
                Installer.CleanAll(Log,
                                   project.StuffFiles.Select(
                                       x => Path.Combine(project.RootDirectory, x.NativePath)));

                foreach (var pref in project.ProjectReferences)
                {
                    Clean(Project.Load(Path.Combine(project.RootDirectory, pref.ProjectPath)));
                }
            }
        }
Ejemplo n.º 3
0
 public override void Execute(IEnumerable <string> args)
 {
     Installer.CleanAll(args.GetFiles("*.stuff"));
 }