예제 #1
0
        private void GenerateProjectSection(Project project, ISlnProject slnProject)
        {
            var    projectPath             = slnProject.GetSuiteRelativeProjectFilePath(project);
            string relativeProjectFilePath = suiteRoot.GetRelativePathFrom(slnDir, projectPath);

            string projectGuid = projectGuidManagement.GetGuid(project).ToString("B").ToUpperInvariant();

            output.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\"",
                             slnProject.ProjectTypeGuid, project.Name, relativeProjectFilePath, projectGuid);

            var projectDeps = new HashSet <Project>(getProjectSolutionReferences(project));

            if (projectDeps.Count > 0)
            {
                output.WriteLine("\tProjectSection(ProjectDependencies) = postProject");
                foreach (var dependentProject in projectDeps)
                {
                    var depGuid = projectGuidManagement.GetGuid(dependentProject).ToString("B").ToUpperInvariant();
                    output.WriteLine("\t\t{0} = {0}", depGuid);
                }
                output.WriteLine("\tEndProjectSection");
            }

            output.WriteLine("EndProject");
        }
예제 #2
0
        /// <summary>
        /// Runs this builder
        /// </summary>
        /// <param name="context">Current build context</param>
        /// <returns>Returns a set of generated files, in target relative paths</returns>
        public ISet <TargetRelativePath> Run(IBuildContext context)
        {
            var contents    = project.GetSourceSet("content");
            var contentsDir = project.RootDirectory.GetChildDirectory("content");

            var result = new HashSet <TargetRelativePath>();

            foreach (var sourcePath in contents.Files)
            {
                log.DebugFormat("Copying content {0}...", sourcePath);

                var relativePath = suiteRoot.GetRelativePathFrom(contentsDir, sourcePath);

                Copy(sourcePath, relativePath);

                result.Add(new TargetRelativePath(project.Module.Name, relativePath));
            }

            return(result);
        }
예제 #3
0
        /// <summary>
        /// Runs this builder
        /// </summary>
        /// <param name="context">Current build context</param>
        /// <returns>Returns a set of generated files, in target relative paths</returns>
        public override ISet <TargetRelativePath> Run(IBuildContext context)
        {
            var contents    = project.GetSourceSet("content");
            var contentsDir = project.RootDirectory.GetChildDirectory("content");

            var targetDir = targetRoot.GetChildDirectory(project.RelativeTargetPath, createIfMissing: true);
            var result    = new HashSet <TargetRelativePath>();

            foreach (var sourcePath in contents.Files)
            {
                log.DebugFormat("Copying content {0}...", sourcePath);

                var relativePath = suiteRoot.GetRelativePathFrom(contentsDir, sourcePath);

                suiteRoot.CopyFile(sourcePath, targetDir, relativePath);

                result.Add(new TargetRelativePath(project.RelativeTargetPath, relativePath));
            }

            return(result);
        }
예제 #4
0
 private string GetSourceSetRelativePath(SuiteRelativePath path)
 {
     return(suiteRoot.GetRelativePathFrom(sourceSetRoot, path));
 }