Skip to content

Commit

Permalink
Remove RepositoriesPresetDependenciesResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitinas committed Nov 17, 2019
1 parent 1394279 commit fdf1a3d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/main/kotlin/org/jetbrains/kotlin/jupyter/resolver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,14 @@ class AliasDependenciesResolver(private val baseResolver: ExternalDependenciesRe
artifactsMapping.containsKey(artifactCoordinates) || baseResolver.acceptsArtifact(artifactCoordinates)
}

class RepositoriesPresetDependenciesResolver(private val baseResolver: ExternalDependenciesResolver, repositories: Iterable<RepositoryCoordinates>)
: ExternalDependenciesResolver by baseResolver {

init {
repositories.forEach {
baseResolver.tryAddRepository(it)
}
}
}

open class JupyterScriptDependenciesResolver(val resolverConfig: ResolverConfig?) {
private val resolver: ExternalDependenciesResolver

init {
var r: ExternalDependenciesResolver = CompoundDependenciesResolver(FileSystemDependenciesResolver(), MavenDependenciesResolver())
if (resolverConfig != null) {
if (resolverConfig.repositories.isNotEmpty()) r = RepositoriesPresetDependenciesResolver(r, resolverConfig.repositories)
if (resolverConfig.libraries.isNotEmpty()) r = AliasDependenciesResolver(r, resolverConfig.libraries.mapValues { it.value.artifacts })
resolverConfig.repositories.forEach { r.tryAddRepository(it) }
}
resolver = r
}
Expand Down

0 comments on commit fdf1a3d

Please sign in to comment.