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

Fix StackOverflowError.

This commit is contained in:
Cedric Beust 2017-02-10 09:15:07 -08:00
parent 0b584c7626
commit 0a0b478ba3
2 changed files with 7 additions and 6 deletions

View file

@ -60,12 +60,7 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors,
/** /**
* Create an IClasspathDependency from a Maven id. * Create an IClasspathDependency from a Maven id.
*/ */
override fun createMaven(id: String, optional: Boolean) : IClasspathDependency= override fun createMaven(id: String, optional: Boolean) : IClasspathDependency = resolver.create(id, optional)
if (KobaltMavenResolver.isRangeVersion(id)) {
Kobalt.INJECTOR.getInstance(DependencyManager::class.java).create(id, optional)
} else {
resolver.create(id, optional)
}
/** /**
* Create an IClasspathDependency from a path. * Create an IClasspathDependency from a path.

View file

@ -34,6 +34,12 @@ class DependencyManagerTest @Inject constructor(val dependencyManager: Dependenc
} }
} }
@Test
fun createId() {
// Caused a StackOverflowException in 0.923
val id = dependencyManager.createMaven("com.beust.kobalt:kobalt-line-count:jar:(0,]")
}
@Test(description = "Make sure that COMPILE scope dependencies get resolved properly") @Test(description = "Make sure that COMPILE scope dependencies get resolved properly")
fun testScopeDependenciesShouldBeDownloaded() { fun testScopeDependenciesShouldBeDownloaded() {
val testDeps = listOf(dependencyManager.create("org.testng:testng:6.10")) val testDeps = listOf(dependencyManager.create("org.testng:testng:6.10"))