Exemplo n.º 1
0
        public override void Generate(ProjectType projectType, MSBuild.Project project) {
            var filename = Path.Combine(project.DirectoryPath, Name);
            File.WriteAllText(filename, Content);

            if (!IsExcluded) {
                project.AddItem("Content", Name);
            }
        }
 public override void Generate(ProjectType projectType, MSBuild.Project project) {
     var target = project.Xml.AddTarget(Name);
     if (!string.IsNullOrEmpty(DependsOnTargets)) {
         target.DependsOnTargets = DependsOnTargets;
     }
     foreach (var creator in Creators) {
         creator(target);
     }
 }
Exemplo n.º 3
0
        public override void Generate(ProjectType projectType, MSBuild.Project project) {
            if (!IsMissing) {
                Directory.CreateDirectory(Path.Combine(project.DirectoryPath, Name));
            }

            if (!IsExcluded) {
                project.AddItem("Folder", Name);
            }
        }
        public override void Generate(ProjectType projectType, MSBuild.Project project) {
            if (!IsMissing) {
                var absName = Path.IsPathRooted(Name) ? Name : Path.Combine(project.DirectoryPath, Name);
                var absReferencePath = Path.IsPathRooted(ReferencePath) ? ReferencePath : Path.Combine(project.DirectoryPath, ReferencePath);
                
                NativeMethods.CreateSymbolicLink(absName, absReferencePath);
            }

            if (!IsExcluded) {
                project.AddItem("Folder", Name);
            }
        }
Exemplo n.º 5
0
        private static ProjectDefinition LinkedFiles(ProjectType projectType) {
            return new ProjectDefinition(
                "LinkedFiles",
                projectType,
                ItemGroup(
                    Folder("MoveToFolder"),
                    Folder("FolderWithAFile"),
                    Folder("Fob"),
                    Folder("..\\LinkedFilesDir", isExcluded: true),
                    Folder("AlreadyLinkedFolder"),

                    Compile("Program"),
                    Compile("..\\ImplicitLinkedFile"),
                    Compile("..\\ExplicitLinkedFile")
                        .Link("ExplicitDir\\ExplicitLinkedFile"),
                    Compile("..\\ExplicitLinkedFileWrongFilename")
                        .Link("ExplicitDir\\Blah"),
                    Compile("..\\MovedLinkedFile"),
                    Compile("..\\MovedLinkedFileOpen"),
                    Compile("..\\MovedLinkedFileOpenEdit"),
                    Compile("..\\FileNotInProject"),
                    Compile("..\\DeletedLinkedFile"),
                    Compile("LinkedInModule")
                        .Link("Fob\\LinkedInModule"),
                    Compile("SaveAsCreateLink"),
                    Compile("..\\SaveAsCreateFile"),
                    Compile("..\\SaveAsCreateFileNewDirectory"),
                    Compile("FolderWithAFile\\ExistsOnDiskAndInProject"),
                    Compile("FolderWithAFile\\ExistsInProjectButNotOnDisk", isMissing: true),
                    Compile("FolderWithAFile\\ExistsOnDiskButNotInProject"),
                    Compile("..\\LinkedFilesDir\\SomeLinkedFile")
                        .Link("Oar\\SomeLinkedFile"),
                    Compile("..\\RenamedLinkFile")
                        .Link("Fob\\NewNameForLinkFile"),
                    Compile("..\\BadLinkPath")
                        .Link("..\\BadLinkPathFolder\\BadLinkPath"),
                    Compile("..\\RootedLinkIgnored")
                        .Link("C:\\RootedLinkIgnored"),
                    Compile("C:\\RootedIncludeIgnored", isMissing: true)
                        .Link("RootedIncludeIgnored"),
                    Compile("Fob\\AddExistingInProjectDirButNotInProject"),
                    Compile("..\\ExistingItem", isExcluded: true),
                    Compile("..\\ExistsInProjectButNotOnDisk", isExcluded: true),
                    Compile("..\\ExistsOnDiskAndInProject", isExcluded: true),
                    Compile("..\\ExistsOnDiskButNotInProject", isExcluded: true)
                )
            );
        }
        public override void Generate(ProjectType projectType, MSBuild.Project project) {
            var filename = Path.Combine(project.DirectoryPath, Name + projectType.CodeExtension);
            if (!IsMissing) {
                File.WriteAllText(filename, Content ?? projectType.SampleCode);
            }

            if (!IsExcluded) {
                List<KeyValuePair<string, string>> metadata = new List<KeyValuePair<string, string>>();
                if (LinkFile != null) {
                    metadata.Add(new KeyValuePair<string, string>("Link", LinkFile + projectType.CodeExtension));
                }

                project.AddItem(
                    "Compile",
                    Name + projectType.CodeExtension,
                    metadata
                );
            }
        }
Exemplo n.º 7
0
 private static SolutionFile MultiProjectLinkedFiles(ProjectType projectType) {
     return SolutionFile.Generate(
         "MultiProjectLinkedFiles",
         new ProjectDefinition(
             "LinkedFiles1",
             projectType,
             ItemGroup(
                 Compile("..\\FileNotInProject1"),
                 Compile("..\\FileNotInProject2")
             )
         ),
         new ProjectDefinition(
             "LinkedFiles2",
             projectType,
             ItemGroup(
                 Compile("..\\FileNotInProject2", isMissing: true)
             )
         )
     );
 }
Exemplo n.º 8
0
 public override void Generate(ProjectType projectType, MSBuild.Project project)
 {
     var target = project.Xml.AddImport(Project);
 }
Exemplo n.º 9
0
 public override void Generate(ProjectType projectType, MSBuild.Project project) {
     project.SetProperty(Name, Value);
 }
Exemplo n.º 10
0
 private static ProjectDefinition NoSourceControlProject(ProjectType projectType) {
     return new ProjectDefinition("NoSourceControl", projectType,
         ItemGroup(
             Compile("Program")
         )
     );
 }
Exemplo n.º 11
0
 private static ProjectDefinition SourceControlProject(ProjectType projectType) {
     return new ProjectDefinition("SourceControl", projectType,
         PropertyGroup(
             Property("SccProjectName", "HelloWorld"),
             Property("SccLocalPath", "LocalPath"),
             Property("SccAuxPath", "AuxPath"),
             Property("SccProvider", "TestProvider")
         ),
         ItemGroup(
             Folder("TestFolder"),
             Compile("Program"),
             Compile("TestFolder\\SubItem"),
             Compile("ExcludedFile", isExcluded: true)
         )
     );
 }
 public override void Generate(ProjectType projectType, MSBuild.Project project) {
     foreach (var content in _content) {
         content.Generate(projectType, project);
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// Generates the specified item.  The item can use the project type to 
 /// customize the item.  The item can write it's self out to disk if 
 /// necessary and update the project file appropriately.
 /// </summary>
 public abstract void Generate(ProjectType projectType, MSBuild.Project project);
Exemplo n.º 14
0
 /// <summary>
 /// Creates a new project definition which can be included in a solution or generated.
 /// </summary>
 /// <param name="name">The name of the project</param>
 /// <param name="projectType">The project type which controls the language being tested</param>
 /// <param name="items">The items included in the project</param>
 public ProjectDefinition(string name, ProjectType projectType, params ProjectContentGenerator[] items)
 {
     ProjectType = projectType;
     _name       = name;
     Items       = items;
 }
Exemplo n.º 15
0
 public ProjectDefinition(string name, ProjectType projectType, bool isUserProject, params ProjectContentGenerator[] items)
     : this(name, projectType, items)
 {
     _isUserProject = isUserProject;
 }
 public ProjectDefinition(string name, ProjectType projectType, bool isUserProject, params ProjectContentGenerator[] items)
     : this(name, projectType, items) {
     _isUserProject  = isUserProject;
 }
 /// <summary>
 /// Creates a new project definition which can be included in a solution or generated.
 /// </summary>
 /// <param name="name">The name of the project</param>
 /// <param name="projectType">The project type which controls the language being tested</param>
 /// <param name="items">The items included in the project</param>
 public ProjectDefinition(string name, ProjectType projectType, params ProjectContentGenerator[] items) {
     ProjectType = projectType;
     _name = name;
     Items = items;
 }
Exemplo n.º 18
0
 public override void Generate(ProjectType projectType, MSBuild.Project project)
 {
     project.SetProperty(Name, Value);
 }
Exemplo n.º 19
0
        private static ProjectDefinition MakeBasicProject(ProjectType projectType) {
            var def = new ProjectDefinition(
                "ShowAllFiles",
                projectType,
                ItemGroup(
                    Folder("Folder", isExcluded: true),
                    Folder("Folder\\SubFolder", isExcluded: true),
                    Content("Folder\\SubFolder\\SubFile.txt", "", isExcluded: true),
                    Content("Folder\\SubFolder\\File.txt", "", isExcluded: true),
                    Compile("NotInProject", isExcluded: true),
                    Compile("Folder\\File", isExcluded: true),
                    Content("Folder\\File.txt", "", isExcluded: true),
                    Compile("server"),
                    Content("ShowAllFiles.v11.suo", "", isExcluded: true),
                    Folder("..\\MovedIntoShowAllFiles", isExcluded: true),
                    Content("..\\MovedIntoShowAllFiles\\Text.txt", "", isExcluded: true)
                ),
                Property("ProjectView", "ShowAllFiles")
            );

            return def;
        }
Exemplo n.º 20
0
 public ProjectDefinition(ProjectType newProjectType, ProjectDefinition wrap)
     : this(wrap.Name, newProjectType, wrap._isUserProject, wrap.Items)
 {
 }
Exemplo n.º 21
0
 /// <summary>
 /// Generates the specified item.  The item can use the project type to
 /// customize the item.  The item can write it's self out to disk if
 /// necessary and update the project file appropriately.
 /// </summary>
 public abstract void Generate(ProjectType projectType, MSBuild.Project project);
Exemplo n.º 22
0
 public override void Generate(ProjectType projectType, MSBuild.Project project) {
     var target = project.Xml.AddImport(Project);
 }