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

Improve aar support.

This commit is contained in:
Cedric Beust 2016-02-09 03:54:30 +04:00
parent 9b94114021
commit e87438910f
6 changed files with 72 additions and 40 deletions

View file

@ -120,8 +120,9 @@ public class DownloadTest @Inject constructor(
// For now, just hardcoding the result we should have received
// val repoResult = repoFinder.findCorrectRepo(id)
val repoResult = RepoFinder.RepoResult(HostConfig("http://repository.jetbrains.com/all/"),
true, Version.of("0.1-SNAPSHOT"), true, Version("0.1-SNAPSHOT", "20151011.112011-29"))
val hc = HostConfig("http://repository.jetbrains.com/all/")
val repoResult = RepoFinder.RepoResult(hc,
Version.of("0.1-SNAPSHOT"), hc.url, Version("0.1-SNAPSHOT", "20151011.112011-29"))
val jarFile = dep.toJarFile(repoResult)
val url = repoResult.hostConfig.url + jarFile

View file

@ -4,19 +4,18 @@ import com.beust.kobalt.Args
import com.beust.kobalt.TestModule
import com.beust.kobalt.maven.dependency.MavenDependency
import com.beust.kobalt.misc.DependencyExecutor
import com.beust.kobalt.app.MainModule
import com.google.inject.Guice
import org.testng.Assert
import org.testng.annotations.Test
import java.util.concurrent.ExecutorService
import javax.inject.Inject
@Test
@org.testng.annotations.Guice(modules = arrayOf(TestModule::class))
public class RemoteRepoTest @Inject constructor(val repoFinder: RepoFinder,
class RemoteRepoTest @Inject constructor(val repoFinder: RepoFinder,
@DependencyExecutor val executor: ExecutorService, val args: Args){
@Test
public fun mavenMetadata() {
fun mavenMetadata() {
val dep = MavenDependency.create("org.codehaus.groovy:groovy-all:")
// Note: this test might fail if a new version of Groovy gets uploaded, need
// to find a stable (i.e. abandoned) package
@ -24,9 +23,23 @@ public class RemoteRepoTest @Inject constructor(val repoFinder: RepoFinder,
}
@Test(enabled = false)
public fun metadataForSnapshots() {
fun metadataForSnapshots() {
val jar = MavenDependency.create("org.apache.maven.wagon:wagon-provider-test:2.10-SNAPSHOT", executor)
.jarFile
Assert.assertTrue(jar.get().exists())
}
fun resolveAarWithVersion() {
val repoResult = repoFinder.findCorrectRepo("com.jakewharton.timber:timber:4.1.0")
with(repoResult) {
Assert.assertEquals(path, "com/jakewharton/timber/timber/4.1.0/timber-4.1.0.aar")
}
}
// fun resolveAarWithoutVersion() {
// val repoResult = repoFinder.findCorrectRepo("com.jakewharton.timber:timber:")
// with(repoResult) {
// Assert.assertEquals(path, "com/jakewharton/timber/timber/4.1.0/timber-4.1.0.aar")
// }
// }
}