1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Fix the repo bug.

Repo contributors were not applied early enough, so resources coming from the Android m2repository could not be resolved.
This commit is contained in:
Cedric Beust 2015-12-28 20:56:03 +04:00
parent 5dc1953ea8
commit c16a93e4a2
2 changed files with 21 additions and 15 deletions

View file

@ -16,9 +16,21 @@ public class Kobalt {
var context: KobaltContext? = null
val repos = HashSet<HostConfig>(Constants.DEFAULT_REPOS.map { HostConfig(it) })
/**
* @return the repos from the build files and from the contributors.
*/
val repos : Set<HostConfig>
get() {
val result = HashSet(reposFromBuildFiles)
Kobalt.context?.pluginInfo?.repoContributors?.forEach {
result.addAll(it.reposFor(null))
}
return result
}
fun addRepo(repo: HostConfig) = repos.add(
val reposFromBuildFiles = HashSet<HostConfig>(Constants.DEFAULT_REPOS.map { HostConfig(it) })
fun addRepo(repo: HostConfig) = reposFromBuildFiles.add(
if (repo.url.endsWith("/")) repo
else repo.copy(url = (repo.url + "/")))