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

Export the POM generator on the KobaltContext.

This commit is contained in:
Cedric Beust 2016-07-30 16:25:56 -07:00
parent e19201de33
commit e2e8e78be6
2 changed files with 10 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import com.beust.kobalt.internal.KobaltSettings
import com.beust.kobalt.internal.PluginInfo import com.beust.kobalt.internal.PluginInfo
import com.beust.kobalt.maven.DependencyManager import com.beust.kobalt.maven.DependencyManager
import com.beust.kobalt.maven.MavenId import com.beust.kobalt.maven.MavenId
import com.beust.kobalt.maven.PomGenerator
import com.beust.kobalt.maven.SimpleDep import com.beust.kobalt.maven.SimpleDep
import com.beust.kobalt.maven.aether.KobaltAether import com.beust.kobalt.maven.aether.KobaltAether
import com.beust.kobalt.misc.KobaltExecutors import com.beust.kobalt.misc.KobaltExecutors
@ -59,6 +60,11 @@ class KobaltContext(val args: Args) {
} }
} }
/**
* @return the content of the pom.xml for the given project.
*/
fun generatePom(project: Project) = pomGeneratorFactory.create(project).generate()
/** All the projects that are being built during this run */ /** All the projects that are being built during this run */
val allProjects = arrayListOf<Project>() val allProjects = arrayListOf<Project>()
@ -75,6 +81,7 @@ class KobaltContext(val args: Args) {
lateinit var settings: KobaltSettings lateinit var settings: KobaltSettings
lateinit var incrementalManager: IncrementalManager lateinit var incrementalManager: IncrementalManager
lateinit var aether: KobaltAether lateinit var aether: KobaltAether
lateinit var pomGeneratorFactory: PomGenerator.IFactory
} }
class InternalContext { class InternalContext {

View file

@ -14,6 +14,7 @@ import com.beust.kobalt.internal.PluginInfo
import com.beust.kobalt.internal.build.BuildFile import com.beust.kobalt.internal.build.BuildFile
import com.beust.kobalt.internal.build.VersionFile import com.beust.kobalt.internal.build.VersionFile
import com.beust.kobalt.maven.DependencyManager import com.beust.kobalt.maven.DependencyManager
import com.beust.kobalt.maven.PomGenerator
import com.beust.kobalt.maven.aether.KobaltAether import com.beust.kobalt.maven.aether.KobaltAether
import com.beust.kobalt.misc.KFiles import com.beust.kobalt.misc.KFiles
import com.beust.kobalt.misc.KobaltExecutors import com.beust.kobalt.misc.KobaltExecutors
@ -35,7 +36,7 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
val dependencyManager: DependencyManager, val pluginProperties: PluginProperties, val dependencyManager: DependencyManager, val pluginProperties: PluginProperties,
val executors: KobaltExecutors, val buildScriptUtil: BuildScriptUtil, val settings: KobaltSettings, val executors: KobaltExecutors, val buildScriptUtil: BuildScriptUtil, val settings: KobaltSettings,
val incrementalManagerFactory: IncrementalManager.IFactory, val args: Args, val incrementalManagerFactory: IncrementalManager.IFactory, val args: Args,
val aether: KobaltAether) { val aether: KobaltAether, val pomGeneratorFactory: PomGenerator.IFactory) {
interface IFactory { interface IFactory {
fun create(@Assisted("buildFiles") buildFiles: List<BuildFile>, pluginInfo: PluginInfo) : BuildFileCompiler fun create(@Assisted("buildFiles") buildFiles: List<BuildFile>, pluginInfo: PluginInfo) : BuildFileCompiler
@ -56,6 +57,7 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
context.settings = settings context.settings = settings
context.incrementalManager = incrementalManagerFactory.create() context.incrementalManager = incrementalManagerFactory.create()
context.aether = aether context.aether = aether
context.pomGeneratorFactory = pomGeneratorFactory
Kobalt.context = context Kobalt.context = context
// //