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

Refactoring.

This commit is contained in:
Cedric Beust 2015-11-16 04:41:49 -08:00
parent 8c1f2e8962
commit d8cbbdc772
2 changed files with 4 additions and 2 deletions

View file

@ -19,6 +19,7 @@ public class DependencyManager @Inject constructor(val executors: KobaltExecutor
/** /**
* @return the classpath for this project, including the IClasspathContributors. * @return the classpath for this project, including the IClasspathContributors.
* allDependencies is typically either compileDependencies or testDependencies
*/ */
fun calculateDependencies(project: Project?, context: KobaltContext, fun calculateDependencies(project: Project?, context: KobaltContext,
dependentProjects: List<ProjectDescription> = emptyList(), dependentProjects: List<ProjectDescription> = emptyList(),

View file

@ -62,9 +62,10 @@ class ApplicationPlugin @Inject constructor(val executors: KobaltExecutors,
as List<ProjectDescription> as List<ProjectDescription>
// If the jar file is not fat, we need to add the transitive closure of all dependencies // If the jar file is not fat, we need to add the transitive closure of all dependencies
// on the classpath // on the classpath
allDeps.addAll( val allTheDependencies =
dependencyManager.calculateDependencies(project, context, projDeps, dependencyManager.calculateDependencies(project, context, projDeps,
allDependencies = project.compileDependencies).map { it.jarFile.get().path }) allDependencies = project.compileDependencies).map { it.jarFile.get().path }
allDeps.addAll(allTheDependencies)
} }
val allDepsJoined = allDeps.joinToString(File.pathSeparator) val allDepsJoined = allDeps.joinToString(File.pathSeparator)
val args = listOf("-classpath", allDepsJoined) + config.jvmArgs + config.mainClass!! val args = listOf("-classpath", allDepsJoined) + config.jvmArgs + config.mainClass!!