Exemple #1
0
        public CsProjFile csprojFor(string name)
        {
            var files = new FileSystem().FindFiles(Environment.CurrentDirectory, FileSet.Deep(name + ".csproj"));

            if (files.Count() == 0)
            {
                Assert.Fail("Project {0} could not be found".ToFormat(name));
            }

            return CsProjFile.LoadFrom(files.Single());
        }
Exemple #2
0
        public static string FindSolutionFile()
        {
            var currentDirectory = Environment.CurrentDirectory.ToFullPath();
             var files = new FileSystem().FindFiles(currentDirectory, FileSet.Deep("*.sln"));
             if (files.Count() == 1)
             {
                 return Path.GetFileName(files.Single());
             }

             if (files.Any())
             {
                 ConsoleWriter.Write(ConsoleColor.Yellow, "Found more than one *.sln file:");
                 files.Each(x => ConsoleWriter.Write(ConsoleColor.Yellow, x));
                 ConsoleWriter.Write(ConsoleColor.Yellow, "You need to specify the solution with the --solution flag");
             }
             else
             {
                 ConsoleWriter.Write(ConsoleColor.Yellow, "Could not find any *.sln files");
             }

             return null;
        }