mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Improve the archetype support.
This commit is contained in:
parent
3fdc7d8c5b
commit
f6fe0e086e
10 changed files with 75 additions and 19 deletions
|
@ -32,6 +32,9 @@ class Args {
|
|||
@Parameter(names = arrayOf("-i", "--init"), description = "Invoke the archetypes named, separated by a comma")
|
||||
var archetypes : String? = null
|
||||
|
||||
@Parameter(names = arrayOf("--listArchetypes"), description = "List the available archetypes")
|
||||
var listArchetypes: Boolean = false
|
||||
|
||||
@Parameter(names = arrayOf("--log"), description = "Define the log level (1-3)")
|
||||
var log: Int = 1
|
||||
|
||||
|
|
|
@ -7,12 +7,26 @@ import com.beust.kobalt.Args
|
|||
* a new project).
|
||||
*/
|
||||
interface IInitContributor {
|
||||
val archetypes: List<IArchetype>
|
||||
}
|
||||
|
||||
interface IArchetype {
|
||||
/**
|
||||
* The name of this archetype. This is the name that will be looked up when passed to the --init
|
||||
* argument.
|
||||
*/
|
||||
val archetypeName: String
|
||||
|
||||
/**
|
||||
* Description of this archetype.
|
||||
*/
|
||||
val archetypeDescription: String
|
||||
|
||||
/**
|
||||
* The plug-in this archetype belongs to.
|
||||
*/
|
||||
val pluginName: String
|
||||
|
||||
/**
|
||||
* Generate the files for this archetype. The parameter is the arguments that were passed to the kobaltw
|
||||
* command.
|
||||
|
|
|
@ -147,7 +147,7 @@ class PluginInfo(val xml: KobaltPluginXml, val classLoader: ClassLoader?) {
|
|||
if (this is ICompilerFlagContributor) compilerFlagContributors.add(this)
|
||||
if (this is ICompilerInterceptor) compilerInterceptors.add(this)
|
||||
if (this is IDocContributor) docContributors.add(this)
|
||||
if (this is IInitContributor) initContributors.add(this as IInitContributor)
|
||||
if (this is IInitContributor) initContributors.add(this)
|
||||
if (this is IPlugin) plugins.add(this)
|
||||
if (this is IProjectContributor) projectContributors.add(this)
|
||||
if (this is IRepoContributor) repoContributors.add(this)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue