/// <summary> /// Create the targets that copy 'local copy' references to the build dir /// </summary> /// <param name="solution">the solution being analyzed</param> private void WriteCopyRefsTargets(Solution solution) { // copy the 'copy local' references to the build directory ArrayList referenceNames = new ArrayList(); // get a unique list foreach (Project project in solution.GetProjects()) { if (project.CountFiles("Compile") > 0) { foreach (Reference reference in project.GetReferences()) { if (!referenceNames.Contains(reference.Value)) { referenceNames.Add(reference.Value); } } } } // create the copy targets foreach (string configurationName in solution.GetConfigurationNames()) { writer.WriteStartElement("target"); writer.WriteAttributeString("name", string.Concat(Configuration.NantName(configurationName), ".CopyRefs")); WriteProperty("build.dir", "${build.basedir}\\" + Configuration.NantName(configurationName)); foreach (string referenceName in referenceNames) { writeCopyRef(referenceName, configurationName); } writer.WriteEndElement(); // target } }
/// <summary>Gets all the dependencies of the specified /// <paramref name="source"/> project including referenced /// projects.</summary> /// <param name="source">The source project.</param> /// <returns>An ArrayList of projects.</returns> public ArrayList GetAllDependencies(Project source) { ArrayList dependencies = GetDependencies(source); foreach (Reference reference in source.GetReferences()) { if (reference.Type == "Project") { Project target = GetProject(reference.Value); if (!dependencies.Contains(target)) { dependencies.Add(target); } } } return(dependencies); }
/// <summary>Gets all the dependencies of the specified /// <paramref name="source"/> project including referenced /// projects.</summary> /// <param name="source">The source project.</param> /// <returns>An ArrayList of projects.</returns> public ArrayList GetAllDependencies(Project source) { ArrayList dependencies = GetDependencies(source); foreach (Reference reference in source.GetReferences()) { if (reference.Type == "Project") { Project target = GetProject(reference.Value); if (!dependencies.Contains(target)) { dependencies.Add(target); } } } return dependencies; }