From bf66a440527e751bcc05c04a3fbc557145bb0877 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Fri, 25 Mar 2016 10:58:32 +0400 Subject: [PATCH] Delete MavenDependency. --- .../maven/dependency/MavenDependency.kt | 128 ------------------ 1 file changed, 128 deletions(-) delete mode 100644 modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt deleted file mode 100644 index a83b368c..00000000 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt +++ /dev/null @@ -1,128 +0,0 @@ -package com.beust.kobalt.maven.dependency - -//class MavenDependency @Inject constructor(val aether: KobaltAether) : IClasspathDependency by aether { -// fun create(id: String) = aether.create(id) -//} - -//class _MavenDependency @Inject constructor( -// @Assisted mavenId: MavenId, -// @Assisted val executor: ExecutorService, -// @Assisted("downloadSources") val downloadSources: Boolean, -// @Assisted("downloadJavadocs") val downloadJavadocs: Boolean, -// override val localRepo: LocalRepo, -// val repoFinder: RepoFinder, -// val dependencyManager: DependencyManager, -// val downloadManager: DownloadManager) -// : LocalDep(mavenId, localRepo), IClasspathDependency, Comparable<_MavenDependency> { -// override var jarFile: Future by Delegates.notNull() -// var pomFile: Future by Delegates.notNull() -// -// interface IFactory { -// fun create(mavenId: MavenId, executor: ExecutorService, -// @Assisted("downloadSources") downloadSources: Boolean, -// @Assisted("downloadJavadocs") downloadJavadocs: Boolean) : _MavenDependency -// } -// -// init { -// val jar = File(localRepo.toFullPath(toJarFile(version))) -// val aar = File(localRepo.toFullPath(toAarFile(version))) -// val pom = File(localRepo.toFullPath(toPomFile(version))) -// -// fun toSuffix(name: String, suffix: String = "") : String { -// val dot = name.lastIndexOf(".") -// return name.substring(0, dot) + suffix + name.substring(dot) -// } -// -// fun download(url: String, fileName: String, suffix: String = "") : Future { -// val localPath = localRepo.toFullPath(toSuffix(fileName, suffix)) -// return downloadManager.download(HostConfig(toSuffix(url, suffix)), localPath, executor) -// } -// -// if (pom.exists() && (jar.exists() || aar.exists())) { -// jarFile = CompletedFuture(if (jar.exists()) jar else aar) -// pomFile = CompletedFuture(pom) -// } else { -// val repoResult = repoFinder.findCorrectRepo(mavenId.toId) -// -// if (repoResult.found) { -// jarFile = -// if (repoResult.archiveUrl != null) { -// download(repoResult.archiveUrl, repoResult.path!!) -// } else { -// CompletedFuture(File("nonexistentFile")) // will be filtered out -// } -// pomFile = downloadManager.download(HostConfig(url = repoResult.hostConfig.url + toPomFile(repoResult)), -// pom.absolutePath, executor) -// } else { -// throw KobaltException("Couldn't resolve ${mavenId.toId}") -// } -// } -// -// if (downloadSources || downloadJavadocs) { -// val repoResult = repoFinder.findCorrectRepo(mavenId.toId) -// if (repoResult.archiveUrl != null && repoResult.path != null) { -// if (downloadSources) { -// download(repoResult.archiveUrl, repoResult.path, "-sources") -// } -// if (downloadJavadocs) { -// download(repoResult.archiveUrl, repoResult.path, "-javadoc") -// } -// } -// } -// -// } -// -// companion object { -// val defaultExecutor = -// Kobalt.INJECTOR.getInstance(Key.get(ExecutorService::class.java, DependencyExecutor::class.java)) -// val depFactory = Kobalt.INJECTOR.getInstance(DepFactory::class.java) -// -// fun create(id: String, downloadSources: Boolean = false, downloadJavadocs: Boolean = false, -// executor: ExecutorService = defaultExecutor) -// = depFactory.create(id, downloadSources, downloadJavadocs, executor = executor) -// -// fun create(mavenId: MavenId, downloadSources: Boolean = false, downloadJavadocs: Boolean = false, -// executor: ExecutorService = defaultExecutor) -// = create(mavenId.toId, downloadSources, downloadJavadocs, executor) -// } -// -// override fun toString() = mavenId.toId -// -// override val id = mavenId.toId -// -// override fun toMavenDependencies() = let { md -> -// Dependency().apply { -// groupId = md.groupId -// artifactId = md.artifactId -// version = md.version -// } -// } -// -//// override fun compareTo(other: _MavenDependency): Int { -// return Versions.toLongVersion(version).compareTo(Versions.toLongVersion(other.version)) -// } -// -// override val shortId = "$groupId:$artifactId:" -// -// override fun directDependencies() : List { -// val result = arrayListOf() -// val maybePom = Pom2.parse(pomFile.get(), dependencyManager) -// if (maybePom.value != null) { -// val pom = maybePom.value -// pom.pomProject.dependencies.filter { -// it.mustDownload -// }.forEach { -// if (it.isValid) { -// result.add(create(MavenId.toId(it.groupId(pom), it.artifactId(pom), it.packaging, it.version(pom)))) -// } else { -// log(2, "Skipping invalid id: ${it.id(pom)}") -// } -// } -// } else { -// warn("Couldn't parse POM file ${pomFile.get()}: " + maybePom.exception?.message, maybePom.exception!!) -// -// } -// return result -// } -//} -//