Beispiel #1
0
 public void AddNugetDirectoryFromConvention()
 {
     foreach (var solutionPackages in DirectoryEx.EnumerateDirectoriesEndsWith(solutionDirectory, "Packages"))
     {
         log($"  Scanning SolutionDir/Packages convention: {solutionPackages}'.");
         AddFiles(ScanDirectoryForPackages(solutionPackages));
     }
 }
    IEnumerable <string> EnumerateInSolutionWeavers()
    {
        IEnumerable <string> ScanDirectory(string directory)
        {
            log($"  Scanning SolutionDir/Packages convention: {directory}'.");
            return(ScanDirectoryForPackages(directory));
        }

        return(DirectoryEx.EnumerateDirectoriesEndsWith(solutionDirectory, "Packages")
               .SelectMany(ScanDirectory));
    }
    static IEnumerable <string> EnumerateNewOrPaketStyleDirectories(string directory)
    {
        foreach (var packageDirectory in DirectoryEx.EnumerateDirectoriesEndsWith(directory, ".fody"))
        {
            var packageName = Path.GetFileName(packageDirectory);

            var newStyleVersionDirectories = Directory.EnumerateDirectories(packageDirectory)
                                             .Where(dir => Regex.IsMatch(Path.GetFileName(dir), @"^[0-9]+\.[0-9]+"))
                                             .ToList();

            if (newStyleVersionDirectories.Any())
            {
                foreach (var versionDirectory in newStyleVersionDirectories)
                {
                    yield return(GetAssemblyFromNugetDir(versionDirectory, packageName));
                }
            }
            else
            {
                yield return(GetAssemblyFromNugetDir(packageDirectory, packageName));
            }
        }
    }