Ignore shared projects and projects that do not have a project.json for
dependency management
This commit is contained in:
parent
f77328258c
commit
f01620402a
|
|
@ -55,6 +55,7 @@ namespace TCDependencyManager
|
||||||
ProjectName = p,
|
ProjectName = p,
|
||||||
Dependencies = ReadDependencies(repo, p)
|
Dependencies = ReadDependencies(repo, p)
|
||||||
})
|
})
|
||||||
|
.Where(p => p.Dependencies != null)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,6 +71,13 @@ namespace TCDependencyManager
|
||||||
var content = JsonConvert.DeserializeObject<JObject>(
|
var content = JsonConvert.DeserializeObject<JObject>(
|
||||||
Encoding.UTF8.GetString(
|
Encoding.UTF8.GetString(
|
||||||
Convert.FromBase64String(result["content"].Value<string>())));
|
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"];
|
var dependencies = (JObject)content["dependencies"];
|
||||||
if (dependencies != null)
|
if (dependencies != null)
|
||||||
{
|
{
|
||||||
|
|
@ -78,9 +86,11 @@ namespace TCDependencyManager
|
||||||
.Select(prop => prop.Name)
|
.Select(prop => prop.Name)
|
||||||
.ToList();
|
.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()
|
private HttpClient GetClient()
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace TCDependencyManager
|
||||||
Console.WriteLine("Creating dependency tree");
|
Console.WriteLine("Creating dependency tree");
|
||||||
MapRepoDependencies(projects);
|
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()))
|
foreach (var repo in repos.Where(p => p.Dependencies.Any()))
|
||||||
{
|
{
|
||||||
teamCity.EnsureDependencies(repo.Name, repo.Dependencies.Select(r => r.Name));
|
teamCity.EnsureDependencies(repo.Name, repo.Dependencies.Select(r => r.Name));
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,5 @@ namespace TCDependencyManager
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue