예제 #1
0
        /// <summary>
        /// Initializes a new instance of the BuildProfileTask class with the specified project.
        /// </summary>
        /// <param name="profile">The project to build.</param>
        public BuildProfileTask(ProjectInfo project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            this.Project = project;
        }
예제 #2
0
파일: Program.cs 프로젝트: adbre/cab42
        private static void Build(ProjectInfo projectInfo)
        {
            using (var buildContext = new CabwizBuildContext())
            {
                var tasks = projectInfo.CreateBuildTasks();

                var feedback = new BuildFeedbackBase(Console.Out);
                buildContext.Build(tasks, feedback);
            }
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectOutput"/> class.
        /// </summary>
        /// <param name="projectInfo">The project which this class will produce output for.</param>
        /// <exception cref="ArgumentNullException"><paramref name="projectInfo"/> is null.</exception>
        public ProjectOutput(ProjectInfo projectInfo)
        {
            if (projectInfo == null)
            {
                throw new ArgumentNullException("buildProject");
            }

            this.ProjectInfo = projectInfo;

            this.InstallationDirectory = new OutputDirectoryInfo(Cabwiz.SpecialFolderMacros.InstallationDirectory);
            this.ProgramFiles = new OutputDirectoryInfo(Cabwiz.SpecialFolderMacros.ProgramFiles);
            this.StartMenu = new OutputDirectoryInfo(Cabwiz.SpecialFolderMacros.StartMenu);
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the BuildProfileTask class with the specified project and profile.
        /// </summary>
        /// <param name="project">The project to build.</param>
        /// <param name="profile">The profile to build.</param>
        public BuildProfileTask(ProjectInfo project, BuildProfile profile)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            if (profile != null && project != profile.ProjectInfo)
            {
                throw new ArgumentException("The profile argument is not null and is not a profile child of the specified project", "profile");
            }

            this.Project = project;
            this.Profile = profile;
        }
예제 #5
0
        /// <summary>
        /// Creates 
        /// </summary>
        /// <param name="project">The project for which to create the build tasks for.</param>
        /// <returns>A collection of build tasks.</returns>
        public static IBuildTask[] CreateBuildTasks(ProjectInfo project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            var tasks = new List<IBuildTask>();

            if (project.Profiles != null && project.Profiles.Count > 0)
            {
                foreach (var profile in project.Profiles.Where(p => !p.Value.IsPlaceholder))
                {
                    tasks.Add(new BuildProfileTask(project, profile.Value));
                }
            }
            else
            {
                tasks.Add(new BuildProfileTask(project));
            }

            return tasks.ToArray();
        }
예제 #6
0
 /// <summary>
 /// Serializes a <see cref="ProjectInfo"/> object and saving the output to <paramref name="fileName"/>.
 /// </summary>
 /// <param name="project">The project to save.</param>
 /// <param name="fileName">The file to save the output to.</param>
 public static void SaveAs(ProjectInfo project, string fileName)
 {
     SaveAs(project, new System.IO.FileInfo(fileName));
 }
예제 #7
0
        /// <summary>
        /// Serializes a <see cref="ProjectInfo"/> object to the specified output stream.
        /// </summary>
        /// <param name="project">The object to serialize.</param>
        /// <param name="stream">The stream to write the serialized contents to.</param>
        public static void Serialize(ProjectInfo project, System.IO.Stream stream)
        {
            if (xmlSerializer == null)
            {
                xmlSerializer = new XmlSerializer(typeof(ProjectInfo));
            }

            xmlSerializer.Serialize(stream, project);
        }
예제 #8
0
 /// <summary>
 /// Serializes a <see cref="ProjectInfo"/> object and saving the output to <paramref name="fileName"/>.
 /// </summary>
 /// <param name="project">The project to save.</param>
 /// <param name="fileName">The file to save the output to.</param>
 public static void SaveAs(ProjectInfo project, string fileName)
 {
     SaveAs(project, new System.IO.FileInfo(fileName));
 }
예제 #9
0
        /// <summary>
        /// Serializes a <see cref="ProjectInfo"/> object and saving the output to <paramref name="file"/>.
        /// </summary>
        /// <param name="project">The project to save.</param>
        /// <param name="file">The file to save the output to.</param>
        public static void SaveAs(ProjectInfo project, System.IO.FileInfo file)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            using (var stream = file.Open(System.IO.FileMode.Create))
            {
                Serialize(project, stream);
            }
        }
예제 #10
0
        /// <summary>
        /// Serializes a <see cref="ProjectInfo"/> object and saving the output to the project's <see cref="ProjectInfo.ProjectFile"/>.
        /// </summary>
        /// <param name="project">The project to save.</param>
        public static void Save(ProjectInfo project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            SaveAs(project, project.ProjectFile);
        }