예제 #1
0
    string CreateToolsDirectory(string solutionDirectory)
    {
        var fodyDirectory = FodyDirectoryFinder.TreeWalkForToolsFodyDir(solutionDirectory);

        if (fodyDirectory != null)
        {
            return(fodyDirectory);
        }
        var packagesPath = NugetConfigReader.GetPackagesPathFromConfig(solutionDirectory);

        if (packagesPath != null)
        {
            fodyDirectory = Path.Combine(Directory.GetParent(packagesPath).FullName, @"Tools\Fody");
        }
        else
        {
            fodyDirectory = Path.Combine(solutionDirectory, @"Tools\Fody");
        }
        if (!Directory.Exists(fodyDirectory))
        {
            Directory.CreateDirectory(fodyDirectory);
        }
        return(fodyDirectory);
    }
예제 #2
0
 public void ProcessTaskFile(string solutionDirectory)
 {
     try
     {
         var fodyDir = FodyDirectoryFinder.TreeWalkForToolsFodyDir(solutionDirectory);
         if (fodyDir != null)
         {
             var fodyFile = Path.Combine(fodyDir, "Fody.dll");
             if (File.Exists(fodyFile))
             {
                 Check(fodyFile);
                 return;
             }
         }
         foreach (var filePath in Directory.EnumerateFiles(solutionDirectory, "Fody.dll", SearchOption.AllDirectories))
         {
             Check(filePath);
         }
     }
     catch (Exception exception)
     {
         messageDisplayer.ShowError(string.Format("Fody: An exception occured while trying to check for updates.\r\nException: {0}.", exception));
     }
 }
예제 #3
0
    public void Existing()
    {
        var fodyDir = FodyDirectoryFinder.TreeWalkForToolsFodyDir(AssemblyLocation.CurrentDirectory());

        Assert.IsTrue(Directory.Exists(fodyDir));
    }
예제 #4
0
 public void NotExisting()
 {
     Assert.IsNull(FodyDirectoryFinder.TreeWalkForToolsFodyDir(Path.GetTempPath()));
 }