Ignore shared projects and projects that do not have a project.json for

dependency management
This commit is contained in:
Pranav K 2014-03-07 18:17:15 -08:00
parent f77328258c
commit f01620402a
3 changed files with 12 additions and 4 deletions

View File

@ -55,6 +55,7 @@ namespace TCDependencyManager
ProjectName = p,
Dependencies = ReadDependencies(repo, p)
})
.Where(p => p.Dependencies != null)
.ToList();
}
@ -70,6 +71,13 @@ namespace TCDependencyManager
var content = JsonConvert.DeserializeObject<JObject>(
Encoding.UTF8.GetString(
Convert.FromBase64String(result["content"].Value<string>())));
// Ignore shared repos since they can have the same names
if (content["shared"] != null)
{
return null;
}
var dependencies = (JObject)content["dependencies"];
if (dependencies != null)
{
@ -78,9 +86,11 @@ namespace TCDependencyManager
.Select(prop => prop.Name)
.ToList();
}
return new List<string>(0);
}
}
return new List<string>(0);
// Ignore directories that do not have a project.json
return null;
}
private HttpClient GetClient()

View File

@ -36,7 +36,7 @@ namespace TCDependencyManager
Console.WriteLine("Creating dependency tree");
MapRepoDependencies(projects);
Console.WriteLine("Ensuring depndencies are consistent on TeamCity");
Console.WriteLine("Ensuring dependencies are consistent on TeamCity");
foreach (var repo in repos.Where(p => p.Dependencies.Any()))
{
teamCity.EnsureDependencies(repo.Name, repo.Dependencies.Select(r => r.Name));

View File

@ -112,7 +112,5 @@ namespace TCDependencyManager
return client;
}
}
}