plasterManifest.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?xml version="1.0" encoding="utf-8"?>
<plasterManifest
  schemaVersion="1.1"
  templateType="Project" xmlns="http://www.microsoft.com/schemas/PowerShell/Plaster/v1">
  <metadata>
    <name>Stucco</name>
    <id>160a95b4-33f8-4429-8a68-5ceb587ffede</id>
    <version>0.1.1</version>
    <title>High-Quality PowerShell Module Template</title>
    <description>An opinionated Plaster template for high-quality PowerShell modules</description>
    <author>Brandon Olin</author>
    <tags>Module, PowerShell</tags>
  </metadata>
  <parameters>

    <parameter name='ModuleName'
               type='text'
               prompt='Enter the name of the module'/>

    <parameter name='Description'
               type='text'
               prompt='Enter a description of the module'/>

    <parameter name='Version'
               type='text'
               default='0.1.0'
               prompt='Enter the version number (1.2.3) for the module'/>

    <parameter name='FullName'
               type='user-fullname'
               store='text'
               prompt='Enter your full name'/>

    <!-- License -->
    <parameter name='License'
               type='choice'
               default='1'
               store='text'
               prompt='Select a license for your module'>
      <choice label='&amp;Apache'
              help='Adds an Apache license file.'
              value="Apache"/>
      <choice label='&amp;MIT'
              help='Adds an MIT license file.'
              value='MIT'/>
      <choice label='&amp;None'
              help='No license specified.'
              value='None'/>
    </parameter>

    <!-- Code of Conduct -->
    <parameter name='CoC'
               type='choice'
               default='0'
               store='text'
               prompt='Do you want to include a Code of Conduct?'>
      <choice label='&amp;Yes'
              help="Yes, include a Code of Conduct for the project"
              value="Yes"/>
      <choice label='&amp;No'
              help="No, do not include a Code of Conduct for the project"
              value="No"/>
    </parameter>
    <parameter name='CoCEmail'
               type='text'
               condition="$PLASTER_PARAM_CoC -eq 'Yes'"
               prompt='Enter the project team email address for the Code of Conduct'/>

    <!-- MkDocs -->
    <parameter name='MkDocs'
               type='choice'
               default='0'
               store='text'
               prompt='Do you want to include MkDocs support?'>
      <choice label='&amp;Yes'
              help='Yes, include a MkDocs yaml file.'
              value="Yes"/>
      <choice label='&amp;No'
              help='No, do not include a MkDocs yaml file.'
              value='No'/>
    </parameter>
    <parameter name='MkDocsSiteName'
               type='text'
               condition="$PLASTER_PARAM_MkDocs -eq 'Yes'"
               prompt='Enter the MkDocs site name'/>
    <parameter name='MkDocsGitRepoUrl'
               type='text'
               condition="$PLASTER_PARAM_MkDocs -eq 'Yes'"
               prompt='Enter the git repository URL'/>

    <!-- PowerShell classes -->
    <parameter name='Classes'
               type='choice'
               default='1'
               store='text'
               prompt='Will you be using PowerShell classes?'>
      <choice label='&amp;Yes'
              help='Yes, classes will be used in the module'
              value='Yes'/>
      <choice label='&amp;No'
              help="No, classes will not be used in the module"
              value='No'/>
    </parameter>

    <!-- PlatyPS -->
    <parameter name='PlatyPS'
               type='choice'
               default='0'
               store='text'
               prompt='Do you want to use PlatyPS for help documentation?'>
      <choice label='&amp;Yes'
              help='Yes, use PlatyPS to generate markdown help'
              value='Yes'/>
      <choice label='&amp;No'
              help="No, do not include PlatyPS support"
              value='No'/>
    </parameter>

    <!-- VSCode dev container -->
    <parameter name='devcontainer'
               type='choice'
               default='1'
               store='text'
               prompt='Do you want to include VSCode dev container support?'>
      <choice label='&amp;Yes'
              help="Yes, include dev container configuration for the project"
              value="Yes"/>
      <choice label='&amp;No'
              help="No, do not include dev container configuration"
              value="No"/>
    </parameter>

    <!-- CI/CD -->
    <parameter name='CICD'
               type='choice'
               default='0'
               store='text'
               prompt='Do you want to include CI/CD support?'>
      <choice label='&amp;AppVeyor'
              help='Adds an AppVeyor yaml file.'
              value="AppVeyor"/>
      <choice label='Azure &amp;Pipelines'
              help='Adds an Azure Pipelines yaml file.'
              value='AzurePipelines'/>
    <choice label='Git&amp;Hub Actions'
              help='Adds a GitHub Actions workflow file.'
              value='GitHubActions'/>
      <choice label='&amp;GitLab CI'
              help='Adds a GitLab CI yaml file.'
              value='GitLabCI'/>
      <choice label='&amp;None'
              help='No license specified.'
              value='None'/>
    </parameter>


  </parameters>
  <content>
    <message>
Creating an opinionated high-quality PowerShell module with psake tasks and GitHub meta documents`n.
    </message>

    <newModuleManifest destination='${PLASTER_PARAM_ModuleName}\${PLASTER_PARAM_ModuleName}.psd1'
                       moduleVersion='$PLASTER_PARAM_Version'
                       rootModule='${PLASTER_PARAM_ModuleName}.psm1'
                       author='$PLASTER_PARAM_FullName'
                       description='$PLASTER_PARAM_Description'
                       encoding='UTF8-NoBOM'/>

    <!-- Git -->
    <file
      source="template/_gitignore"
      destination=".gitignore" />
    <file
      source="template/_gitattributes"
      destination=".gitattributes" />

    <!-- Build tasks -->
    <file
      source="template/build.ps1"
      destination="build.ps1" />
    <file
      source="template/psakeFile.ps1"
      destination="psakeFile.ps1" />
    <file
      source="template/requirements.psd1"
      destination="requirements.psd1" />

    <!-- VSCode dev container -->
    <templateFile
      source="template/.devcontainer/**"
      destination=".devcontainer"
      condition="$PLASTER_PARAM_devcontainer -eq 'Yes'"/>

    <!-- CI/CD -->
    <templateFile
      source='template/cicd/appveyor.yml'
      destination="appveyor.yml"
      condition="$PLASTER_PARAM_CICD -eq 'Appveyor'"/>
    <templateFile
      source='template/cicd/azure-pipelines.yml'
      destination='azure-pipelines.yml'
      condition="$PLASTER_PARAM_CICD -eq 'AzurePipelines'"/>
    <templateFile
      source='template/cicd/github-actions.yml'
      destination='.github/workflows/CI.yaml'
      condition="$PLASTER_PARAM_CICD -eq 'GitHubActions'"/>
    <templateFile
      source='template/cicd/.gitlab-ci.yml'
      destination='.gitlab-ci.yml'
      condition="$PLASTER_PARAM_CICD -eq 'GitLabCI'"/>

    <!-- Project docs -->
    <templateFile
      source="template/.github/**"
      destination=".github"/>
    <templateFile
      source="template/CHANGELOG.md"
      destination="CHANGELOG.md" />
    <templateFile
      source="template/CODE_OF_CONDUCT.md"
      condition="$PLASTER_PARAM_CoC -eq 'Yes'"
      destination="CODE_OF_CONDUCT.md" />
    <templateFile
      source='template/README.md'
      destination='README.md' />

    <templateFile
      source='template/mkdocs.yml'
      destination="mkdocs.yml"
      condition="$PLASTER_PARAM_MkDocs -eq 'Yes'"/>

    <!-- Recursively copy all *files* into the corresponding directory structure under dest dir -->
    <file
      source='template/module/Classes/**'
      destination='${PLASTER_PARAM_ModuleName}/Classes'
      condition="$PLASTER_PARAM_Classes -eq 'Yes'"/>
    <file
      source='template/module/Private/**'
      destination='${PLASTER_PARAM_ModuleName}/Private'/>
    <file
      source='template/module/Public/**'
      destination='${PLASTER_PARAM_ModuleName}/Public'/>
    <file
      source='template/tests/**'
      destination='tests'/>
    <file
      source='template/.vscode/**'
      destination='.vscode'/>

    <!-- Project license -->
    <templateFile
      source='template/license/Apache.txt'
      destination='LICENSE'
      condition="$PLASTER_PARAM_License -eq 'Apache'"
      encoding="UTF8-NoBOM"/>
    <templateFile
      source='template/license/MIT.txt'
      destination='LICENSE'
      condition="$PLASTER_PARAM_License -eq 'MIT'"/>

    <templateFile condition="$PLASTER_PARAM_PlatyPS -contains 'Yes'"
                  source='template/docs/en-US/about_Module.help.md'
                  destination='docs/en-US/about_${PLASTER_PARAM_ModuleName}.help.md'/>
    <templateFile condition="$PLASTER_PARAM_PlatyPS -contains 'No'"
                  source='template/docs/en-US/about_Module.help.txt'
                  destination='${PLASTER_PARAM_ModuleName}/en-US/about_${PLASTER_PARAM_ModuleName}.help.txt'/>

    <!-- Use PSM1 that supports classes if classes are enabled -->
    <file
      source="template/module/Module_classes.psm1"
      destination="${PLASTER_PARAM_ModuleName}\${PLASTER_PARAM_ModuleName}.psm1"
      condition="$PLASTER_PARAM_Classes -eq 'Yes'"/>
    <file
      source="template/module/Module.psm1"
      destination="${PLASTER_PARAM_ModuleName}\${PLASTER_PARAM_ModuleName}.psm1"
      condition="$PLASTER_PARAM_Classes -eq 'No'"/>

      <message nonewline='true'>`n`nYour new PowerShell module project [$PLASTER_PARAM_ModuleName] has been created</message>
  </content>
</plasterManifest>