ResolveProjectRelativePath() public method

public ResolveProjectRelativePath ( string projectFile, string projectRelativePath ) : string
projectFile string
projectRelativePath string
return string
        public void ResolveProjectRelativePath_Should_Resolve_Paths_Beneath_The_Project_Root_Using_Dot_Notation()
        {
            var helper = new ProjectPathHelper(Mock.Of<IFileSystem>());
            var result = helper.ResolveProjectRelativePath("|dev|projects|test-project.csproj".Path(), ".|subdir-1|text-file.txt".Path());

            Assert.AreEqual("|dev|projects|subdir-1|text-file.txt".Path(), result);
        }
        public void ResolveProjectRelativePath_Should_Resolve_Paths_Above_The_Project_Root()
        {
            var helper = new ProjectPathHelper(Mock.Of<IFileSystem>());

            var result = helper.ResolveProjectRelativePath("|dev|projects|test-project.csproj".Path(), "..|externals|external-file.txt".Path());
            Assert.AreEqual("|dev|externals|external-file.txt".Path(), result);
        }
Example #3
0
        private void SetVersionForSolution(string projectPath, Version defaultVersion, string additionalInfo)
        {
            var helper = new ProjectPathHelper(this.fileSystem);
            var solutionParser = new SolutionParser(this.fileSystem);

            List<string> projectPaths = solutionParser
                .GetProjectPaths(projectPath)
                .Select(x => helper.ResolveProjectRelativePath(projectPath, x))
                .ToList();

            foreach (string path in projectPaths)
            {
                SetVersionForProject(path, defaultVersion, additionalInfo);
            }
        }