Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (34 sloc) 1.52 KB
using System.Collections.Generic;
using System.IO;
public partial class Processor
{
public List<string> ConfigFiles = new List<string>();
public string SolutionConfigFilePath;
public virtual void FindProjectWeavers()
{
var fodyDirConfigFilePath = Path.Combine(AssemblyLocation.CurrentDirectory(), "FodyWeavers.xml");
if (File.Exists(fodyDirConfigFilePath))
{
ConfigFiles.Add(fodyDirConfigFilePath);
Logger.LogInfo(string.Format("Found path to weavers file '{0}'.", fodyDirConfigFilePath));
}
var solutionConfigFilePath = Path.Combine(SolutionDir, "FodyWeavers.xml");
if (File.Exists(solutionConfigFilePath))
{
ConfigFiles.Add(solutionConfigFilePath);
Logger.LogInfo(string.Format("Found path to weavers file '{0}'.", solutionConfigFilePath));
}
var projectDirectory = Path.GetDirectoryName(ProjectPath);
var projectConfigFilePath = Path.Combine(projectDirectory, "FodyWeavers.xml");
if (File.Exists(projectConfigFilePath))
{
ConfigFiles.Add(projectConfigFilePath);
Logger.LogInfo(string.Format("Found path to weavers file '{0}'.", projectConfigFilePath));
}
if (ConfigFiles.Count == 0)
{
var pathsSearched = string.Join("', '", fodyDirConfigFilePath, solutionConfigFilePath, projectConfigFilePath);
Logger.LogInfo(string.Format("Could not find path to weavers file. Searched '{0}'.", pathsSearched));
}
}
}