@@ -111,6 +111,7 @@ internal open class InitCommand : ProjectAwareSubcommand<ToolState, CommandConte
111111 val name: String
112112 val description: String
113113 val languages: Set <String >
114+ val features: SampleFeatures
114115 val noManifest: Boolean
115116 val hasTests: Boolean
116117 val hasBuild: Boolean
@@ -121,6 +122,18 @@ internal open class InitCommand : ProjectAwareSubcommand<ToolState, CommandConte
121122 val tree: Map <Path , ProjectFile >
122123 }
123124
125+ /* * Features supported by a given sample project. */
126+ @Serializable @JvmRecord private data class SampleFeatures (
127+ val install : Boolean = true ,
128+ val build : Boolean = true ,
129+ val test : Boolean = true ,
130+ ) {
131+ companion object {
132+ /* * Default features for a sample project. */
133+ val DEFAULTS = SampleFeatures ()
134+ }
135+ }
136+
124137 /* * Models project template info as specified in JSON from resources. */
125138 @Serializable @JvmRecord private data class ProjectTemplateInfo (
126139 override val name : String ,
@@ -130,6 +143,7 @@ internal open class InitCommand : ProjectAwareSubcommand<ToolState, CommandConte
130143 override val hasDependencies : Boolean = true ,
131144 override val hasTests : Boolean = true ,
132145 override val hasBuild : Boolean = true ,
146+ override val features : SampleFeatures = SampleFeatures .DEFAULTS ,
133147 val files : List <String > = emptyList(),
134148 ): RenderableTemplateInfo
135149
@@ -177,6 +191,7 @@ internal open class InitCommand : ProjectAwareSubcommand<ToolState, CommandConte
177191 override val hasDependencies: Boolean get() = true
178192 override val hasTests: Boolean get() = true
179193 override val hasBuild: Boolean get() = true
194+ override val features: SampleFeatures get() = SampleFeatures .DEFAULTS
180195 override val tree: Map <Path , ProjectFile > get() = buildMap {
181196 defaultFiles()
182197 }
0 commit comments