View Javadoc

1   package org.codehaus.mojo.javascript;
2   
3   import java.util.ArrayList;
4   import java.util.Iterator;
5   import java.util.List;
6   
7   import org.apache.maven.plugin.AbstractMojo;
8   import org.apache.maven.plugin.MojoExecutionException;
9   
10  /**
11   * Display help information on javascript-maven-plugin.<br/> Call <pre>  mvn javascript:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</pre> to display parameter details.
12   *
13   * @version generated on Wed Sep 14 22:12:57 CEST 2011
14   * @author org.apache.maven.tools.plugin.generator.PluginHelpGenerator (version 2.9)
15   * @goal help
16   * @requiresProject false
17   * @threadSafe
18   */
19  public class HelpMojo
20      extends AbstractMojo
21  {
22      /**
23       * If <code>true</code>, display all settable properties for each goal.
24       * 
25       * @parameter expression="${detail}" default-value="false"
26       */
27      private boolean detail;
28  
29      /**
30       * The name of the goal for which to show help. If unspecified, all goals will be displayed.
31       * 
32       * @parameter expression="${goal}"
33       */
34      private java.lang.String goal;
35  
36      /**
37       * The maximum length of a display line, should be positive.
38       * 
39       * @parameter expression="${lineLength}" default-value="80"
40       */
41      private int lineLength;
42  
43      /**
44       * The number of spaces per indentation level, should be positive.
45       * 
46       * @parameter expression="${indentSize}" default-value="2"
47       */
48      private int indentSize;
49  
50  
51      /** {@inheritDoc} */
52      public void execute()
53          throws MojoExecutionException
54      {
55          if ( lineLength <= 0 )
56          {
57              getLog().warn( "The parameter 'lineLength' should be positive, using '80' as default." );
58              lineLength = 80;
59          }
60          if ( indentSize <= 0 )
61          {
62              getLog().warn( "The parameter 'indentSize' should be positive, using '2' as default." );
63              indentSize = 2;
64          }
65  
66          StringBuffer sb = new StringBuffer();
67  
68          append( sb, "org.codehaus.mojo.javascript:javascript-maven-plugin:1.1-softec", 0 );
69          append( sb, "", 0 );
70  
71          append( sb, "Javascript Maven Plugin", 0 );
72          append( sb, "A multi-purpose build management maven plugin for JavaScript", 1 );
73          append( sb, "", 0 );
74  
75          if ( goal == null || goal.length() <= 0 )
76          {
77              append( sb, "This plugin has 19 goals:", 0 );
78              append( sb, "", 0 );
79          }
80  
81          if ( goal == null || goal.length() <= 0 || "attach-compressed".equals( goal ) )
82          {
83              append( sb, "javascript:attach-compressed", 0 );
84              append( sb, "Goal used to package compressed JavaScript files and package them as a javascript archive attaching this new artifact to the project for beeing installed / deployed with the regular uncompressed js-archive.", 1 );
85              append( sb, "", 0 );
86              if ( detail )
87              {
88                  append( sb, "Available parameters:", 1 );
89                  append( sb, "", 0 );
90  
91                  append( sb, "buildDirectory (Default: ${project.build.directory})", 2 );
92                  append( sb, "The output directory of the compressed javascript archive.", 3 );
93                  append( sb, "", 0 );
94  
95                  append( sb, "classifier (Default: compressed)", 2 );
96                  append( sb, "classifier for the compressed artifact", 3 );
97                  append( sb, "", 0 );
98  
99                  append( sb, "compressedDirectory (Default: ${project.build.directory}/compressed)", 2 );
100                 append( sb, "The output directory of the compressed javascript files.", 3 );
101                 append( sb, "", 0 );
102 
103                 append( sb, "finalName (Default: ${project.build.finalName})", 2 );
104                 append( sb, "The filename of the js file.", 3 );
105                 append( sb, "", 0 );
106 
107                 append( sb, "manifest", 2 );
108                 append( sb, "(no description available)", 3 );
109                 append( sb, "", 0 );
110             }
111         }
112 
113         if ( goal == null || goal.length() <= 0 || "attach-stripped".equals( goal ) )
114         {
115             append( sb, "javascript:attach-stripped", 0 );
116             append( sb, "Goal used to package stripped JavaScript files and package them as a javascript archive attaching this new artifact to the project for beeing installed / deployed with the regular uncompressed js-archive.", 1 );
117             append( sb, "", 0 );
118             if ( detail )
119             {
120                 append( sb, "Available parameters:", 1 );
121                 append( sb, "", 0 );
122 
123                 append( sb, "buildDirectory (Default: ${project.build.directory})", 2 );
124                 append( sb, "The output directory of the compressed javascript archive.", 3 );
125                 append( sb, "", 0 );
126 
127                 append( sb, "classifier (Default: stripped)", 2 );
128                 append( sb, "classifier for the compressed artifact", 3 );
129                 append( sb, "", 0 );
130 
131                 append( sb, "finalName (Default: ${project.build.finalName})", 2 );
132                 append( sb, "The filename of the js file.", 3 );
133                 append( sb, "", 0 );
134 
135                 append( sb, "manifest", 2 );
136                 append( sb, "(no description available)", 3 );
137                 append( sb, "", 0 );
138 
139                 append( sb, "strippedDirectory (Default: ${project.build.directory}/stripped)", 2 );
140                 append( sb, "The output directory of the compressed javascript files.", 3 );
141                 append( sb, "", 0 );
142             }
143         }
144 
145         if ( goal == null || goal.length() <= 0 || "compile".equals( goal ) )
146         {
147             append( sb, "javascript:compile", 0 );
148             append( sb, "Goal which assemble javascript sources into the packaging directory. An optional assembler descriptor can be set to configure scripts to be merged. Other scripts are simply copied to the output directory.", 1 );
149             append( sb, "", 0 );
150             if ( detail )
151             {
152                 append( sb, "Available parameters:", 1 );
153                 append( sb, "", 0 );
154 
155                 append( sb, "depsDirectory (Default: ${project.build.directory}/javascript-dependency)", 2 );
156                 append( sb, "The folder where javascript dependencies are extracted and taken during assembling", 3 );
157                 append( sb, "", 0 );
158 
159                 append( sb, "descriptor (Default: ${basedir}/src/assembler/${project.artifactId}.xml)", 2 );
160                 append( sb, "Descriptor for the strategy to assemble individual scripts sources into destination.", 3 );
161                 append( sb, "", 0 );
162 
163                 append( sb, "descriptorFormat", 2 );
164                 append( sb, "Descriptor file format (default or jsbuilder)", 3 );
165                 append( sb, "", 0 );
166 
167                 append( sb, "excludes", 2 );
168                 append( sb, "Exclusion pattern.", 3 );
169                 append( sb, "", 0 );
170 
171                 append( sb, "includes", 2 );
172                 append( sb, "Inclusion pattern.", 3 );
173                 append( sb, "", 0 );
174 
175                 append( sb, "outputDirectory (Default: ${project.build.outputDirectory})", 2 );
176                 append( sb, "The output directory of the assembled js file.", 3 );
177                 append( sb, "", 0 );
178 
179                 append( sb, "sourceDirectory (Default: ${basedir}/src/main/javascript)", 2 );
180                 append( sb, "Location of the source files.", 3 );
181                 append( sb, "", 0 );
182 
183                 append( sb, "useArtifactId", 2 );
184                 append( sb, "For dependencies, if true, create a folder named by the artifactId while unpacking", 3 );
185                 append( sb, "", 0 );
186             }
187         }
188 
189         if ( goal == null || goal.length() <= 0 || "compress".equals( goal ) )
190         {
191             append( sb, "javascript:compress", 0 );
192             append( sb, "Goal used to strip and compress the JavaScript files from the target script directory", 1 );
193             append( sb, "", 0 );
194             if ( detail )
195             {
196                 append( sb, "Available parameters:", 1 );
197                 append( sb, "", 0 );
198 
199                 append( sb, "buildDirectory (Default: ${project.build.directory})", 2 );
200                 append( sb, "The output directory of the compressed javascript archive.", 3 );
201                 append( sb, "", 0 );
202 
203                 append( sb, "compressedDirectory (Default: ${project.build.directory}/compressed)", 2 );
204                 append( sb, "The output directory of the compressed javascript files.", 3 );
205                 append( sb, "", 0 );
206 
207                 append( sb, "compressor (Default: jsmin)", 2 );
208                 append( sb, "The compressor to used. Either \'shrinksafe\', \'yahooui\' or \'jsmin\' for default compressor, or a custom one provided as an artifact in repo org.codehaus.mojo.javascript:[xxx]-compressor.", 3 );
209                 append( sb, "", 0 );
210 
211                 append( sb, "excludes", 2 );
212                 append( sb, "Exclusion patterns", 3 );
213                 append( sb, "", 0 );
214 
215                 append( sb, "includes", 2 );
216                 append( sb, "Inclusion patterns", 3 );
217                 append( sb, "", 0 );
218 
219                 append( sb, "languageVersion (Default: 130)", 2 );
220                 append( sb, "JS Language version (130 for JS 1.3)", 3 );
221                 append( sb, "", 0 );
222 
223                 append( sb, "localRepository", 2 );
224                 append( sb, "The local repository", 3 );
225                 append( sb, "Required: Yes", 3 );
226                 append( sb, "Expression: ${localRepository}", 3 );
227                 append( sb, "", 0 );
228 
229                 append( sb, "optimizationLevel (Default: 9)", 2 );
230                 append( sb, "Optimization level, from 0 to 9", 3 );
231                 append( sb, "", 0 );
232 
233                 append( sb, "remoteRepositories", 2 );
234                 append( sb, "The remote repositories declared in the pom.", 3 );
235                 append( sb, "Expression: ${project.pluginArtifactRepositories}", 3 );
236                 append( sb, "", 0 );
237 
238                 append( sb, "scriptClassifier", 2 );
239                 append( sb, "optional extension for the compressed artifact. Example \'compressed\'", 3 );
240                 append( sb, "", 0 );
241 
242                 append( sb, "scriptsDirectory (Default: ${project.build.outputDirectory})", 2 );
243                 append( sb, "The intput directory for the source javascript files.", 3 );
244                 append( sb, "", 0 );
245 
246                 append( sb, "skipStats", 2 );
247                 append( sb, "Don\'t display compression stats", 3 );
248                 append( sb, "", 0 );
249 
250                 append( sb, "strip", 2 );
251                 append( sb, "A special token to recognize lines to be removed from scripts (debugging code).", 3 );
252                 append( sb, "", 0 );
253 
254                 append( sb, "strippedDirectory (Default: ${project.build.directory}/stripped)", 2 );
255                 append( sb, "The output directory of the compressed javascript files.", 3 );
256                 append( sb, "", 0 );
257 
258                 append( sb, "strips", 2 );
259                 append( sb, "A list of special token to recognize lines to be removed from scripts (debugging code).", 3 );
260                 append( sb, "", 0 );
261             }
262         }
263 
264         if ( goal == null || goal.length() <= 0 || "generateManualRunner".equals( goal ) )
265         {
266             append( sb, "javascript:generateManualRunner", 0 );
267             append( sb, "(no description available)", 1 );
268             append( sb, "", 0 );
269             if ( detail )
270             {
271                 append( sb, "Available parameters:", 1 );
272                 append( sb, "", 0 );
273 
274                 append( sb, "browsers", 2 );
275                 append( sb, "The Browser simulation used for Unit tests (default to FF3.6)", 3 );
276                 append( sb, "", 0 );
277 
278                 append( sb, "jasmineTargetDir (Default: ${project.build.directory}${file.separator}jasmine)", 2 );
279                 append( sb, "(no description available)", 3 );
280                 append( sb, "", 0 );
281 
282                 append( sb, "jasmineTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
283                 append( sb, "(no description available)", 3 );
284                 append( sb, "Expression: ${jsunitTestSourceDirectory}", 3 );
285                 append( sb, "", 0 );
286 
287                 append( sb, "jsunitTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
288                 append( sb, "Base directory for jsunit test.", 3 );
289                 append( sb, "Expression: ${jsunitTestSourceDirectory}", 3 );
290                 append( sb, "", 0 );
291 
292                 append( sb, "libsDirectory (Default: lib)", 2 );
293                 append( sb, "The folder for javascripts dependencies", 3 );
294                 append( sb, "Expression: ${scripts}", 3 );
295                 append( sb, "", 0 );
296 
297                 append( sb, "manualSpecRunnerHtmlFileName (Default: ManualSpecRunner.html)", 2 );
298                 append( sb, "(no description available)", 3 );
299                 append( sb, "", 0 );
300 
301                 append( sb, "mavenProject (Default: ${project})", 2 );
302                 append( sb, "(no description available)", 3 );
303                 append( sb, "", 0 );
304 
305                 append( sb, "packageDir (Default: ${project.build.directory}${file.separator}${project.build.finalName})", 2 );
306                 append( sb, "(no description available)", 3 );
307                 append( sb, "", 0 );
308 
309                 append( sb, "packageJavaScriptPath (Default: js)", 2 );
310                 append( sb, "(no description available)", 3 );
311                 append( sb, "Expression: ${packageJavaScriptPath}", 3 );
312                 append( sb, "", 0 );
313 
314                 append( sb, "pluginArtifacts (Default: ${plugin.artifacts})", 2 );
315                 append( sb, "(no description available)", 3 );
316                 append( sb, "", 0 );
317 
318                 append( sb, "preloadSources", 2 );
319                 append( sb, "JavaScript sources (typically vendor/lib dependencies) that need to be loaded before other sources (and specs) in a particular order, these are relative to the ${sourceDirectory} directory! Therefore, if jquery.js is in `${sourceDirectory}/vendor`, you would configure: <preloadSources> <source>vendor/z.js</source> </preloadSources> And z.js would load before all the other sources and specs.", 3 );
320                 append( sb, "", 0 );
321 
322                 append( sb, "skipTests", 2 );
323                 append( sb, "Set this to \'true\' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
324                 append( sb, "Expression: ${maven.test.skip}", 3 );
325                 append( sb, "", 0 );
326 
327                 append( sb, "sourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}main${file.separator}javascript)", 2 );
328                 append( sb, "(no description available)", 3 );
329                 append( sb, "Expression: ${sourceDirectory}", 3 );
330                 append( sb, "", 0 );
331 
332                 append( sb, "specDirectoryName (Default: spec)", 2 );
333                 append( sb, "(no description available)", 3 );
334                 append( sb, "", 0 );
335 
336                 append( sb, "specRunnerHtmlFileName (Default: SpecRunner.html)", 2 );
337                 append( sb, "(no description available)", 3 );
338                 append( sb, "", 0 );
339 
340                 append( sb, "srcDirectoryName (Default: src)", 2 );
341                 append( sb, "(no description available)", 3 );
342                 append( sb, "", 0 );
343 
344                 append( sb, "testFailureIgnore", 2 );
345                 append( sb, "Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
346                 append( sb, "Expression: ${maven.test.failure.ignore}", 3 );
347                 append( sb, "", 0 );
348 
349                 append( sb, "useArtifactId", 2 );
350                 append( sb, "Use the artifactId as folder", 3 );
351                 append( sb, "", 0 );
352             }
353         }
354 
355         if ( goal == null || goal.length() <= 0 || "help".equals( goal ) )
356         {
357             append( sb, "javascript:help", 0 );
358             append( sb, "Display help information on javascript-maven-plugin.\nCall\n\u00a0\u00a0mvn\u00a0javascript:help\u00a0-Ddetail=true\u00a0-Dgoal=<goal-name>\nto display parameter details.", 1 );
359             append( sb, "", 0 );
360             if ( detail )
361             {
362                 append( sb, "Available parameters:", 1 );
363                 append( sb, "", 0 );
364 
365                 append( sb, "detail (Default: false)", 2 );
366                 append( sb, "If true, display all settable properties for each goal.", 3 );
367                 append( sb, "Expression: ${detail}", 3 );
368                 append( sb, "", 0 );
369 
370                 append( sb, "goal", 2 );
371                 append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 );
372                 append( sb, "Expression: ${goal}", 3 );
373                 append( sb, "", 0 );
374 
375                 append( sb, "indentSize (Default: 2)", 2 );
376                 append( sb, "The number of spaces per indentation level, should be positive.", 3 );
377                 append( sb, "Expression: ${indentSize}", 3 );
378                 append( sb, "", 0 );
379 
380                 append( sb, "lineLength (Default: 80)", 2 );
381                 append( sb, "The maximum length of a display line, should be positive.", 3 );
382                 append( sb, "Expression: ${lineLength}", 3 );
383                 append( sb, "", 0 );
384             }
385         }
386 
387         if ( goal == null || goal.length() <= 0 || "inplace".equals( goal ) )
388         {
389             append( sb, "javascript:inplace", 0 );
390             append( sb, "Goal that copies javascript dependencies to the web application script folder, inside the webapp source directory. This allows to prepare the webapp for running on a lightweight servlet container that does not requires packaging (when using the jetty:run goal).", 1 );
391             append( sb, "", 0 );
392             if ( detail )
393             {
394                 append( sb, "Available parameters:", 1 );
395                 append( sb, "", 0 );
396 
397                 append( sb, "libsDirectory (Default: lib)", 2 );
398                 append( sb, "The folder for javascripts dependencies", 3 );
399                 append( sb, "Expression: ${scripts}", 3 );
400                 append( sb, "", 0 );
401 
402                 append( sb, "scriptsDirectory (Default: scripts/libs)", 2 );
403                 append( sb, "The folder in webapp for javascripts", 3 );
404                 append( sb, "Expression: ${scripts}", 3 );
405                 append( sb, "", 0 );
406 
407                 append( sb, "useArtifactId", 2 );
408                 append( sb, "Use the artifactId as folder", 3 );
409                 append( sb, "", 0 );
410 
411                 append( sb, "warSourceDirectory", 2 );
412                 append( sb, "Single directory for extra files to include in the WAR.", 3 );
413                 append( sb, "Required: Yes", 3 );
414                 append( sb, "Expression: ${basedir}/src/main/webapp", 3 );
415                 append( sb, "", 0 );
416             }
417         }
418 
419         if ( goal == null || goal.length() <= 0 || "jasmine".equals( goal ) )
420         {
421             append( sb, "javascript:jasmine", 0 );
422             append( sb, "(no description available)", 1 );
423             append( sb, "", 0 );
424             if ( detail )
425             {
426                 append( sb, "Available parameters:", 1 );
427                 append( sb, "", 0 );
428 
429                 append( sb, "browsers", 2 );
430                 append( sb, "The Browser simulation used for Unit tests (default to FF3.6)", 3 );
431                 append( sb, "", 0 );
432 
433                 append( sb, "jasmineTargetDir (Default: ${project.build.directory}${file.separator}jasmine)", 2 );
434                 append( sb, "(no description available)", 3 );
435                 append( sb, "", 0 );
436 
437                 append( sb, "jasmineTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
438                 append( sb, "(no description available)", 3 );
439                 append( sb, "Expression: ${jsunitTestSourceDirectory}", 3 );
440                 append( sb, "", 0 );
441 
442                 append( sb, "jsunitTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
443                 append( sb, "Base directory for jsunit test.", 3 );
444                 append( sb, "Expression: ${jsunitTestSourceDirectory}", 3 );
445                 append( sb, "", 0 );
446 
447                 append( sb, "libsDirectory (Default: lib)", 2 );
448                 append( sb, "The folder for javascripts dependencies", 3 );
449                 append( sb, "Expression: ${scripts}", 3 );
450                 append( sb, "", 0 );
451 
452                 append( sb, "manualSpecRunnerHtmlFileName (Default: ManualSpecRunner.html)", 2 );
453                 append( sb, "(no description available)", 3 );
454                 append( sb, "", 0 );
455 
456                 append( sb, "mavenProject (Default: ${project})", 2 );
457                 append( sb, "(no description available)", 3 );
458                 append( sb, "", 0 );
459 
460                 append( sb, "packageDir (Default: ${project.build.directory}${file.separator}${project.build.finalName})", 2 );
461                 append( sb, "(no description available)", 3 );
462                 append( sb, "", 0 );
463 
464                 append( sb, "packageJavaScriptPath (Default: js)", 2 );
465                 append( sb, "(no description available)", 3 );
466                 append( sb, "Expression: ${packageJavaScriptPath}", 3 );
467                 append( sb, "", 0 );
468 
469                 append( sb, "pluginArtifacts (Default: ${plugin.artifacts})", 2 );
470                 append( sb, "(no description available)", 3 );
471                 append( sb, "", 0 );
472 
473                 append( sb, "preloadSources", 2 );
474                 append( sb, "JavaScript sources (typically vendor/lib dependencies) that need to be loaded before other sources (and specs) in a particular order, these are relative to the ${sourceDirectory} directory! Therefore, if jquery.js is in `${sourceDirectory}/vendor`, you would configure: <preloadSources> <source>vendor/z.js</source> </preloadSources> And z.js would load before all the other sources and specs.", 3 );
475                 append( sb, "", 0 );
476 
477                 append( sb, "skipTests", 2 );
478                 append( sb, "Set this to \'true\' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
479                 append( sb, "Expression: ${maven.test.skip}", 3 );
480                 append( sb, "", 0 );
481 
482                 append( sb, "sourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}main${file.separator}javascript)", 2 );
483                 append( sb, "(no description available)", 3 );
484                 append( sb, "Expression: ${sourceDirectory}", 3 );
485                 append( sb, "", 0 );
486 
487                 append( sb, "specDirectoryName (Default: spec)", 2 );
488                 append( sb, "(no description available)", 3 );
489                 append( sb, "", 0 );
490 
491                 append( sb, "specRunnerHtmlFileName (Default: SpecRunner.html)", 2 );
492                 append( sb, "(no description available)", 3 );
493                 append( sb, "", 0 );
494 
495                 append( sb, "srcDirectoryName (Default: src)", 2 );
496                 append( sb, "(no description available)", 3 );
497                 append( sb, "", 0 );
498 
499                 append( sb, "testFailureIgnore", 2 );
500                 append( sb, "Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
501                 append( sb, "Expression: ${maven.test.failure.ignore}", 3 );
502                 append( sb, "", 0 );
503 
504                 append( sb, "useArtifactId", 2 );
505                 append( sb, "Use the artifactId as folder", 3 );
506                 append( sb, "", 0 );
507             }
508         }
509 
510         if ( goal == null || goal.length() <= 0 || "jsunit".equals( goal ) )
511         {
512             append( sb, "javascript:jsunit", 0 );
513             append( sb, "Goal which runs javascript tests using jsunit framework. Tests can be writter either inside an html page, as documented by jsunit, or simply as javascript.", 1 );
514             append( sb, "", 0 );
515             if ( detail )
516             {
517                 append( sb, "Available parameters:", 1 );
518                 append( sb, "", 0 );
519 
520                 append( sb, "browsers", 2 );
521                 append( sb, "Browsers to run the jsunit tests", 3 );
522                 append( sb, "", 0 );
523 
524                 append( sb, "excludes", 2 );
525                 append( sb, "Exclusion pattern.", 3 );
526                 append( sb, "", 0 );
527 
528                 append( sb, "firefoxPath (Default: c:/program files/Mozilla Firefox/firefox.exe)", 2 );
529                 append( sb, "(no description available)", 3 );
530                 append( sb, "Expression: ${javascript.jsunit.firefox.path}", 3 );
531                 append( sb, "", 0 );
532 
533                 append( sb, "iePath (Default: c:/program files/internet explorer/iexplore.exe)", 2 );
534                 append( sb, "(no description available)", 3 );
535                 append( sb, "Expression: ${javascript.jsunit.ie.path}", 3 );
536                 append( sb, "", 0 );
537 
538                 append( sb, "includes", 2 );
539                 append( sb, "Inclusion pattern.", 3 );
540                 append( sb, "", 0 );
541 
542                 append( sb, "jasmineTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
543                 append( sb, "(no description available)", 3 );
544                 append( sb, "Expression: ${testSourceDirectory}", 3 );
545                 append( sb, "", 0 );
546 
547                 append( sb, "jsunitTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
548                 append( sb, "Base directory for jsunit test.", 3 );
549                 append( sb, "Expression: ${testSourceDirectory}", 3 );
550                 append( sb, "", 0 );
551 
552                 append( sb, "port (Default: 8080)", 2 );
553                 append( sb, "The local port to use for the jsunit HTTP server", 3 );
554                 append( sb, "", 0 );
555 
556                 append( sb, "reportsDirectory", 2 );
557                 append( sb, "Base directory where all reports are written to.", 3 );
558                 append( sb, "Expression: ${project.build.directory}${file.separator}surefire-reports", 3 );
559                 append( sb, "", 0 );
560 
561                 append( sb, "skipTests", 2 );
562                 append( sb, "Set this to \'true\' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
563                 append( sb, "Expression: ${maven.test.skip}", 3 );
564                 append( sb, "", 0 );
565 
566                 append( sb, "testFailureIgnore", 2 );
567                 append( sb, "Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
568                 append( sb, "Expression: ${maven.test.failure.ignore}", 3 );
569                 append( sb, "", 0 );
570 
571                 append( sb, "workDirectory", 2 );
572                 append( sb, "Base directory where jsunit will run.", 3 );
573                 append( sb, "Expression: ${project.build.directory}${file.separator}test-scripts", 3 );
574                 append( sb, "", 0 );
575             }
576         }
577 
578         if ( goal == null || goal.length() <= 0 || "package".equals( goal ) )
579         {
580             append( sb, "javascript:package", 0 );
581             append( sb, "Goal which packages scripts and resources as a javascript archive to be installed / deployed in maven repositories.", 1 );
582             append( sb, "", 0 );
583             if ( detail )
584             {
585                 append( sb, "Available parameters:", 1 );
586                 append( sb, "", 0 );
587 
588                 append( sb, "classifier", 2 );
589                 append( sb, "Optional classifier", 3 );
590                 append( sb, "", 0 );
591 
592                 append( sb, "finalName (Default: ${project.build.finalName})", 2 );
593                 append( sb, "The filename of the js file.", 3 );
594                 append( sb, "", 0 );
595 
596                 append( sb, "manifest", 2 );
597                 append( sb, "(no description available)", 3 );
598                 append( sb, "", 0 );
599 
600                 append( sb, "outputDirectory (Default: ${project.build.directory})", 2 );
601                 append( sb, "The output directory of the js file.", 3 );
602                 append( sb, "", 0 );
603 
604                 append( sb, "scriptsDirectory (Default: ${project.build.outputDirectory})", 2 );
605                 append( sb, "Location of the scripts files.", 3 );
606                 append( sb, "", 0 );
607             }
608         }
609 
610         if ( goal == null || goal.length() <= 0 || "prepare-jasmine-tests".equals( goal ) )
611         {
612             append( sb, "javascript:prepare-jasmine-tests", 0 );
613             append( sb, "Goal which copies scripts to the jasmine target directory.", 1 );
614             append( sb, "", 0 );
615             if ( detail )
616             {
617                 append( sb, "Available parameters:", 1 );
618                 append( sb, "", 0 );
619 
620                 append( sb, "browsers", 2 );
621                 append( sb, "The Browser simulation used for Unit tests (default to FF3.6)", 3 );
622                 append( sb, "", 0 );
623 
624                 append( sb, "jasmineTargetDir (Default: ${project.build.directory}${file.separator}jasmine)", 2 );
625                 append( sb, "(no description available)", 3 );
626                 append( sb, "", 0 );
627 
628                 append( sb, "jasmineTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
629                 append( sb, "(no description available)", 3 );
630                 append( sb, "Expression: ${jsunitTestSourceDirectory}", 3 );
631                 append( sb, "", 0 );
632 
633                 append( sb, "jsunitTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
634                 append( sb, "Base directory for jsunit test.", 3 );
635                 append( sb, "Expression: ${jsunitTestSourceDirectory}", 3 );
636                 append( sb, "", 0 );
637 
638                 append( sb, "libsDirectory (Default: lib)", 2 );
639                 append( sb, "The folder for javascripts dependencies", 3 );
640                 append( sb, "Expression: ${scripts}", 3 );
641                 append( sb, "", 0 );
642 
643                 append( sb, "manualSpecRunnerHtmlFileName (Default: ManualSpecRunner.html)", 2 );
644                 append( sb, "(no description available)", 3 );
645                 append( sb, "", 0 );
646 
647                 append( sb, "mavenProject (Default: ${project})", 2 );
648                 append( sb, "(no description available)", 3 );
649                 append( sb, "", 0 );
650 
651                 append( sb, "packageDir (Default: ${project.build.directory}${file.separator}${project.build.finalName})", 2 );
652                 append( sb, "(no description available)", 3 );
653                 append( sb, "", 0 );
654 
655                 append( sb, "packageJavaScriptPath (Default: js)", 2 );
656                 append( sb, "(no description available)", 3 );
657                 append( sb, "Expression: ${packageJavaScriptPath}", 3 );
658                 append( sb, "", 0 );
659 
660                 append( sb, "pluginArtifacts (Default: ${plugin.artifacts})", 2 );
661                 append( sb, "(no description available)", 3 );
662                 append( sb, "", 0 );
663 
664                 append( sb, "preloadSources", 2 );
665                 append( sb, "JavaScript sources (typically vendor/lib dependencies) that need to be loaded before other sources (and specs) in a particular order, these are relative to the ${sourceDirectory} directory! Therefore, if jquery.js is in `${sourceDirectory}/vendor`, you would configure: <preloadSources> <source>vendor/z.js</source> </preloadSources> And z.js would load before all the other sources and specs.", 3 );
666                 append( sb, "", 0 );
667 
668                 append( sb, "skipTests", 2 );
669                 append( sb, "Set this to \'true\' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
670                 append( sb, "Expression: ${maven.test.skip}", 3 );
671                 append( sb, "", 0 );
672 
673                 append( sb, "sourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}main${file.separator}javascript)", 2 );
674                 append( sb, "(no description available)", 3 );
675                 append( sb, "Expression: ${sourceDirectory}", 3 );
676                 append( sb, "", 0 );
677 
678                 append( sb, "specDirectoryName (Default: spec)", 2 );
679                 append( sb, "(no description available)", 3 );
680                 append( sb, "", 0 );
681 
682                 append( sb, "specRunnerHtmlFileName (Default: SpecRunner.html)", 2 );
683                 append( sb, "(no description available)", 3 );
684                 append( sb, "", 0 );
685 
686                 append( sb, "srcDirectoryName (Default: src)", 2 );
687                 append( sb, "(no description available)", 3 );
688                 append( sb, "", 0 );
689 
690                 append( sb, "testFailureIgnore", 2 );
691                 append( sb, "Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
692                 append( sb, "Expression: ${maven.test.failure.ignore}", 3 );
693                 append( sb, "", 0 );
694 
695                 append( sb, "useArtifactId", 2 );
696                 append( sb, "Use the artifactId as folder", 3 );
697                 append( sb, "", 0 );
698             }
699         }
700 
701         if ( goal == null || goal.length() <= 0 || "prepare-jsunit-tests".equals( goal ) )
702         {
703             append( sb, "javascript:prepare-jsunit-tests", 0 );
704             append( sb, "Goal which copies scripts to the test-script directory.", 1 );
705             append( sb, "", 0 );
706             if ( detail )
707             {
708                 append( sb, "Available parameters:", 1 );
709                 append( sb, "", 0 );
710 
711                 append( sb, "jasmineTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
712                 append( sb, "(no description available)", 3 );
713                 append( sb, "Expression: ${testSourceDirectory}", 3 );
714                 append( sb, "", 0 );
715 
716                 append( sb, "jsunitTestSourceDirectory (Default: ${basedir}/src/test/javascript)", 2 );
717                 append( sb, "Location of the source files.", 3 );
718                 append( sb, "", 0 );
719 
720                 append( sb, "libsDirectory (Default: lib)", 2 );
721                 append( sb, "The folder for javascripts dependencies", 3 );
722                 append( sb, "Expression: ${scripts}", 3 );
723                 append( sb, "", 0 );
724 
725                 append( sb, "skipTests", 2 );
726                 append( sb, "Set this to \'true\' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
727                 append( sb, "Expression: ${maven.test.skip}", 3 );
728                 append( sb, "", 0 );
729 
730                 append( sb, "sourceDirectory (Default: ${basedir}/src/main/javascript)", 2 );
731                 append( sb, "Location of the source files.", 3 );
732                 append( sb, "", 0 );
733 
734                 append( sb, "useArtifactId", 2 );
735                 append( sb, "Use the artifactId as folder", 3 );
736                 append( sb, "", 0 );
737 
738                 append( sb, "workDirectory (Default: ${project.build.directory}/test-scripts)", 2 );
739                 append( sb, "Location of the source files.", 3 );
740                 append( sb, "", 0 );
741             }
742         }
743 
744         if ( goal == null || goal.length() <= 0 || "prepare-titanium-jasmine-tests".equals( goal ) )
745         {
746             append( sb, "javascript:prepare-titanium-jasmine-tests", 0 );
747             append( sb, "This Mojo create the titanium project structure required to execute the jasmine tests.", 1 );
748             append( sb, "", 0 );
749             if ( detail )
750             {
751                 append( sb, "Available parameters:", 1 );
752                 append( sb, "", 0 );
753 
754                 append( sb, "jasmineTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
755                 append( sb, "The location of the javascript test files", 3 );
756                 append( sb, "Expression: ${jsunitTestSourceDirectory}", 3 );
757                 append( sb, "", 0 );
758 
759                 append( sb, "libsDirectory (Default: lib)", 2 );
760                 append( sb, "The folder for javascripts dependencies", 3 );
761                 append( sb, "Expression: ${scripts}", 3 );
762                 append( sb, "", 0 );
763 
764                 append( sb, "outputDirectory (Default: ${project.build.outputDirectory})", 2 );
765                 append( sb, "The output directory of the assembled js file.", 3 );
766                 append( sb, "", 0 );
767 
768                 append( sb, "platform", 2 );
769                 append( sb, "The platform for which the code should be packaged.\n\nSupported platforms are:\n\nandroid\n\tPackage for the android platform.\niphone\n\tPackage for the iPhone platform.\nipad\n\tPackage for the iPad platform.\nuniversal\n\tPackage for iPhone and iPad.\n", 3 );
770                 append( sb, "Required: Yes", 3 );
771                 append( sb, "Expression: ${platform}", 3 );
772                 append( sb, "", 0 );
773 
774                 append( sb, "pluginArtifacts (Default: ${plugin.artifacts})", 2 );
775                 append( sb, "(no description available)", 3 );
776                 append( sb, "", 0 );
777 
778                 append( sb, "preloadSources", 2 );
779                 append( sb, "JavaScript sources (typically vendor/lib dependencies) that need to be loaded before other sources (and specs) in a particular order, these are relative to the ${sourceDirectory} directory! Therefore, if jquery.js is in `${sourceDirectory}/vendor`, you would configure: <preloadSources> <source>vendor/z.js</source> </preloadSources> And z.js would load before all the other sources and specs.", 3 );
780                 append( sb, "", 0 );
781 
782                 append( sb, "skipTests", 2 );
783                 append( sb, "Set this to \'true\' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
784                 append( sb, "Expression: ${maven.test.skip}", 3 );
785                 append( sb, "", 0 );
786 
787                 append( sb, "sourceDirectory (Default: ${basedir}/src/main/javascript)", 2 );
788                 append( sb, "Location of the source files.", 3 );
789                 append( sb, "", 0 );
790 
791                 append( sb, "specExcludes", 2 );
792                 append( sb, "Exclusion pattern.\nAllow to specify which jasmine spec files should be excluded.\n", 3 );
793                 append( sb, "", 0 );
794 
795                 append( sb, "specsDirectory (Default: specs)", 2 );
796                 append( sb, "The output folder for jasmine spec files.", 3 );
797                 append( sb, "Expression: ${specs}", 3 );
798                 append( sb, "", 0 );
799 
800                 append( sb, "testOutputDirectory (Default: ${project.build.testOutputDirectory})", 2 );
801                 append( sb, "The output directory of the test files.", 3 );
802                 append( sb, "", 0 );
803 
804                 append( sb, "useArtifactId", 2 );
805                 append( sb, "Use the artifactId as folder", 3 );
806                 append( sb, "", 0 );
807             }
808         }
809 
810         if ( goal == null || goal.length() <= 0 || "titanium-compile".equals( goal ) )
811         {
812             append( sb, "javascript:titanium-compile", 0 );
813             append( sb, "Goal that will place in a titanium build directory the file needed to create a titanium package.", 1 );
814             append( sb, "", 0 );
815             if ( detail )
816             {
817                 append( sb, "Available parameters:", 1 );
818                 append( sb, "", 0 );
819 
820                 append( sb, "depsDirectory (Default: ${project.build.directory}/javascript-dependency)", 2 );
821                 append( sb, "The folder where javascript dependencies are extracted and taken during assembling", 3 );
822                 append( sb, "", 0 );
823 
824                 append( sb, "descriptor (Default: ${basedir}/src/assembler/${project.artifactId}.xml)", 2 );
825                 append( sb, "Descriptor for the strategy to assemble individual scripts sources into destination.", 3 );
826                 append( sb, "", 0 );
827 
828                 append( sb, "descriptorFormat", 2 );
829                 append( sb, "Descriptor file format (default or jsbuilder)", 3 );
830                 append( sb, "", 0 );
831 
832                 append( sb, "excludes", 2 );
833                 append( sb, "Exclusion pattern.", 3 );
834                 append( sb, "", 0 );
835 
836                 append( sb, "includes", 2 );
837                 append( sb, "Inclusion pattern.", 3 );
838                 append( sb, "", 0 );
839 
840                 append( sb, "libsDirectory (Default: lib)", 2 );
841                 append( sb, "The folder for javascripts dependencies", 3 );
842                 append( sb, "Expression: ${scripts}", 3 );
843                 append( sb, "", 0 );
844 
845                 append( sb, "outputDirectory (Default: ${project.build.outputDirectory})", 2 );
846                 append( sb, "The output directory of the assembled js file.", 3 );
847                 append( sb, "", 0 );
848 
849                 append( sb, "platform", 2 );
850                 append( sb, "The platform for which the code should be compiled. android, iphone, ipad, universal", 3 );
851                 append( sb, "Required: Yes", 3 );
852                 append( sb, "Expression: ${platform}", 3 );
853                 append( sb, "", 0 );
854 
855                 append( sb, "scriptsDir", 2 );
856                 append( sb, "The name of the script directory.\nThis parameter is optional it defaults to platform-scripts\n", 3 );
857                 append( sb, "", 0 );
858 
859                 append( sb, "sourceDirectory (Default: ${basedir}/src/main/javascript)", 2 );
860                 append( sb, "Location of the source files.", 3 );
861                 append( sb, "", 0 );
862 
863                 append( sb, "tiapp", 2 );
864                 append( sb, "The Titanium tiapp.xml configuration. If not specified a default tiapp.xml file will be generated", 3 );
865                 append( sb, "", 0 );
866 
867                 append( sb, "useArtifactId", 2 );
868                 append( sb, "For dependencies, if true, create a folder named by the artifactId while unpacking", 3 );
869                 append( sb, "", 0 );
870             }
871         }
872 
873         if ( goal == null || goal.length() <= 0 || "titanium-jasmine".equals( goal ) )
874         {
875             append( sb, "javascript:titanium-jasmine", 0 );
876             append( sb, "(no description available)", 1 );
877             append( sb, "", 0 );
878             if ( detail )
879             {
880                 append( sb, "Available parameters:", 1 );
881                 append( sb, "", 0 );
882 
883                 append( sb, "androidAPI", 2 );
884                 append( sb, "The version of the platform for which the code should be compiled.\n\nThis is the version of the library to use to compile the application. It\'s possible to specify another android API for the android virtual device. See VirtualDevice.androidAPI.\n", 3 );
885                 append( sb, "Expression: ${androidAPI}", 3 );
886                 append( sb, "", 0 );
887 
888                 append( sb, "executeMode (Default: none)", 2 );
889                 append( sb, "The package execution mode.\n\nAllow the execution of the package on an emulator/device.\n\nValues are:\n\nnone\n\tDo not execute. (Default value)\nvirtual\n\tExecute on an emulator whose settings are specified in virtualDevice.\ndevice\n\tExecute on a connected device.\n", 3 );
890                 append( sb, "Expression: ${executeMode}", 3 );
891                 append( sb, "", 0 );
892 
893                 append( sb, "iosVersion", 2 );
894                 append( sb, "The version of the platform for which the code should be compiled.", 3 );
895                 append( sb, "Expression: ${iosVersion}", 3 );
896                 append( sb, "", 0 );
897 
898                 append( sb, "jasmineTestSourceDirectory (Default: ${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript)", 2 );
899                 append( sb, "(no description available)", 3 );
900                 append( sb, "Expression: ${jsunitTestSourceDirectory}", 3 );
901                 append( sb, "", 0 );
902 
903                 append( sb, "outputDirectory (Default: ${project.build.outputDirectory})", 2 );
904                 append( sb, "The output directory of the packaged titanium files.", 3 );
905                 append( sb, "", 0 );
906 
907                 append( sb, "platform", 2 );
908                 append( sb, "The platform for which the code should be packaged.\n\nSupported platforms are:\n\nandroid\n\tPackage for the android platform.\niphone\n\tPackage for the iPhone platform.\nipad\n\tPackage for the iPad platform.\nuniversal\n\tPackage for iPhone and iPad.\n", 3 );
909                 append( sb, "Required: Yes", 3 );
910                 append( sb, "Expression: ${platform}", 3 );
911                 append( sb, "", 0 );
912 
913                 append( sb, "skipTests", 2 );
914                 append( sb, "Set this to \'true\' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.", 3 );
915                 append( sb, "Expression: ${maven.test.skip}", 3 );
916                 append( sb, "", 0 );
917 
918                 append( sb, "testExecuteMode", 2 );
919                 append( sb, "The test package execution mode.\n\nAllow the execution of the package on an emulator/device.\n\nValues are:\n\nnone\n\tDo not execute. (Default value)\nemulator\n\tExecute on an emulator whose settings are specified in VirtualDevice.\ndevice\n\tExecute on a connected device.\nIf not specified, the value of executeMode will be taken.", 3 );
920                 append( sb, "Expression: ${testExecuteMode}", 3 );
921                 append( sb, "", 0 );
922 
923                 append( sb, "testOutputDirectory (Default: ${project.build.testOutputDirectory})", 2 );
924                 append( sb, "The output directory of the test files.", 3 );
925                 append( sb, "", 0 );
926 
927                 append( sb, "titaniumSettings", 2 );
928                 append( sb, "The titanium settings.\n\nContains various information needed to execute a titanium build.\n\nHere\'s the list of the titaniumSettings parameters:\n\nTitaniumSettings.androidBuilder\n\tThe titanium android builder.py file location. Optional. If not specified it tries to retrieve the builder based on titaniumVersion\nTitaniumSettings.iosBuilder\n\tThe titanium iOS builder.py location. Optional. If not specified, it tries to retrieve the builder based on titaniumVersion\nTitaniumSettings.androidSDK\n\tThe android SDK location. This parameter is optional, by default the android SDK is retrieved based on the environment variable ANDROID_HOME.\nTitaniumSettings.keystore\n\tThe android keystore to use to sign the application. Optional. If not specified the Titanium keystore is used.\nTitaniumSettings.keystorePassword\n\tThe android keystore password. Optional. If not specified the default titanium keystore password is used.\nTitaniumSettings.keystoreAlias\n\tThe android keystore key alias. Optional. The alias of the key to use to sign the application. If not specified the default titanium alias is used.\nTitaniumSettings.iosDevelopmentProvisioningProfile\n\tThe iOS development provisioning profile. This profile is use when executeMode is virtual or device.\nTitaniumSettings.iosDistributionProvisioningProfile\n\tThe iOS distribution provisioning profile. This profile is used when executeMode is none.\nTitaniumSettings.iosDevelopmentCertificate\n\tThe iOS development certificate. This certificate is used when executeMode is virtual or device.\nTitaniumSettings.iosDistributionCertificate\n\tThe iOS distribution certificate. This certificate is used when executeMode is none.\n", 3 );
929                 append( sb, "", 0 );
930 
931                 append( sb, "titaniumVersion", 2 );
932                 append( sb, "The titanium SDK version to use.", 3 );
933                 append( sb, "Required: Yes", 3 );
934                 append( sb, "Expression: ${titaniumVersion}", 3 );
935                 append( sb, "", 0 );
936 
937                 append( sb, "virtualDevice", 2 );
938                 append( sb, "Virtual device configuration.\n\nWhen executeMode is virtual, the parameters in virtualDevice are used to configure the android emulator or iphone simulator.\n\nVirtualDevice has the following parameters:\n\nVirtualDevice.androidAPI\n\tThe version on which the virtual device should run. If not specified, the latest android API version will be used. Regardless of the global androidAPI value.\nVirtualDevice.iosVersion\n\tThe ios version of the virtual device. If not specified the latest available version will be used. Regardless of the global parameter value.\nVirtualDevice.skin\n\tThe skin of the android emulator. Defaults to HVGA for version less than 10 and to WXGA for version greater than 10\nVirtualDevice.family\n\tThe iOS device family. Valid values are iphone or ipad.\nVirtualDevice.wait\n\tHow much miliseconds to wait after launching emulator before installing the android application.\n", 3 );
939                 append( sb, "", 0 );
940             }
941         }
942 
943         if ( goal == null || goal.length() <= 0 || "titanium-package".equals( goal ) )
944         {
945             append( sb, "javascript:titanium-package", 0 );
946             append( sb, "Compile the titanium application based on the selected platform.", 1 );
947             append( sb, "", 0 );
948             if ( detail )
949             {
950                 append( sb, "Available parameters:", 1 );
951                 append( sb, "", 0 );
952 
953                 append( sb, "androidAPI", 2 );
954                 append( sb, "The version of the platform for which the code should be compiled.\n\nThis is the version of the library to use to compile the application. It\'s possible to specify another android API for the android virtual device. See VirtualDevice.androidAPI.\n", 3 );
955                 append( sb, "Expression: ${androidAPI}", 3 );
956                 append( sb, "", 0 );
957 
958                 append( sb, "executeMode (Default: none)", 2 );
959                 append( sb, "The package execution mode.\n\nAllow the execution of the package on an emulator/device.\n\nValues are:\n\nnone\n\tDo not execute. (Default value)\nvirtual\n\tExecute on an emulator whose settings are specified in virtualDevice.\ndevice\n\tExecute on a connected device.\n", 3 );
960                 append( sb, "Expression: ${executeMode}", 3 );
961                 append( sb, "", 0 );
962 
963                 append( sb, "iosVersion", 2 );
964                 append( sb, "The version of the platform for which the code should be compiled.", 3 );
965                 append( sb, "Expression: ${iosVersion}", 3 );
966                 append( sb, "", 0 );
967 
968                 append( sb, "outputDirectory (Default: ${project.build.outputDirectory})", 2 );
969                 append( sb, "The output directory of the packaged titanium files.", 3 );
970                 append( sb, "", 0 );
971 
972                 append( sb, "platform", 2 );
973                 append( sb, "The platform for which the code should be packaged.\n\nSupported platforms are:\n\nandroid\n\tPackage for the android platform.\niphone\n\tPackage for the iPhone platform.\nipad\n\tPackage for the iPad platform.\nuniversal\n\tPackage for iPhone and iPad.\n", 3 );
974                 append( sb, "Required: Yes", 3 );
975                 append( sb, "Expression: ${platform}", 3 );
976                 append( sb, "", 0 );
977 
978                 append( sb, "titaniumSettings", 2 );
979                 append( sb, "The titanium settings.\n\nContains various information needed to execute a titanium build.\n\nHere\'s the list of the titaniumSettings parameters:\n\nTitaniumSettings.androidBuilder\n\tThe titanium android builder.py file location. Optional. If not specified it tries to retrieve the builder based on titaniumVersion\nTitaniumSettings.iosBuilder\n\tThe titanium iOS builder.py location. Optional. If not specified, it tries to retrieve the builder based on titaniumVersion\nTitaniumSettings.androidSDK\n\tThe android SDK location. This parameter is optional, by default the android SDK is retrieved based on the environment variable ANDROID_HOME.\nTitaniumSettings.keystore\n\tThe android keystore to use to sign the application. Optional. If not specified the Titanium keystore is used.\nTitaniumSettings.keystorePassword\n\tThe android keystore password. Optional. If not specified the default titanium keystore password is used.\nTitaniumSettings.keystoreAlias\n\tThe android keystore key alias. Optional. The alias of the key to use to sign the application. If not specified the default titanium alias is used.\nTitaniumSettings.iosDevelopmentProvisioningProfile\n\tThe iOS development provisioning profile. This profile is use when executeMode is virtual or device.\nTitaniumSettings.iosDistributionProvisioningProfile\n\tThe iOS distribution provisioning profile. This profile is used when executeMode is none.\nTitaniumSettings.iosDevelopmentCertificate\n\tThe iOS development certificate. This certificate is used when executeMode is virtual or device.\nTitaniumSettings.iosDistributionCertificate\n\tThe iOS distribution certificate. This certificate is used when executeMode is none.\n", 3 );
980                 append( sb, "", 0 );
981 
982                 append( sb, "titaniumVersion", 2 );
983                 append( sb, "The titanium SDK version to use.", 3 );
984                 append( sb, "Required: Yes", 3 );
985                 append( sb, "Expression: ${titaniumVersion}", 3 );
986                 append( sb, "", 0 );
987 
988                 append( sb, "virtualDevice", 2 );
989                 append( sb, "Virtual device configuration.\n\nWhen executeMode is virtual, the parameters in virtualDevice are used to configure the android emulator or iphone simulator.\n\nVirtualDevice has the following parameters:\n\nVirtualDevice.androidAPI\n\tThe version on which the virtual device should run. If not specified, the latest android API version will be used. Regardless of the global androidAPI value.\nVirtualDevice.iosVersion\n\tThe ios version of the virtual device. If not specified the latest available version will be used. Regardless of the global parameter value.\nVirtualDevice.skin\n\tThe skin of the android emulator. Defaults to HVGA for version less than 10 and to WXGA for version greater than 10\nVirtualDevice.family\n\tThe iOS device family. Valid values are iphone or ipad.\nVirtualDevice.wait\n\tHow much miliseconds to wait after launching emulator before installing the android application.\n", 3 );
990                 append( sb, "", 0 );
991             }
992         }
993 
994         if ( goal == null || goal.length() <= 0 || "titanium-prepare-package".equals( goal ) )
995         {
996             append( sb, "javascript:titanium-prepare-package", 0 );
997             append( sb, "This goal strips and compress the source scripts in order to create the distribution package.", 1 );
998             append( sb, "", 0 );
999             if ( detail )
1000             {
1001                 append( sb, "Available parameters:", 1 );
1002                 append( sb, "", 0 );
1003 
1004                 append( sb, "compressedDirectory (Default: ${project.build.outputDirectory})", 2 );
1005                 append( sb, "The output directory of the compressed javascript files.", 3 );
1006                 append( sb, "", 0 );
1007 
1008                 append( sb, "compressor (Default: jsmin)", 2 );
1009                 append( sb, "The compressor to used. Either \'shrinksafe\', \'yahooui\' or \'jsmin\' for default compressor, or a custom one provided as an artifact in repo org.codehaus.mojo.javascript:[xxx]-compressor.", 3 );
1010                 append( sb, "", 0 );
1011 
1012                 append( sb, "excludes", 2 );
1013                 append( sb, "Exclusion patterns", 3 );
1014                 append( sb, "", 0 );
1015 
1016                 append( sb, "executeMode (Default: none)", 2 );
1017                 append( sb, "The package execution mode.\n\nAllow the execution of the package on an emulator/device.\n\nValues are:\n\nnone\n\tDo not execute. (Default value)\nvirtual\n\tExecute on an emulator whose settings are specified in TitaniumPackageMojo.virtualDevice.\ndevice\n\tExecute on a connected device.\n", 3 );
1018                 append( sb, "Expression: ${executeMode}", 3 );
1019                 append( sb, "", 0 );
1020 
1021                 append( sb, "forceCompress (Default: false)", 2 );
1022                 append( sb, "Force compression even if not in \'none\' executeMode.", 3 );
1023                 append( sb, "Expression: ${forceCompress}", 3 );
1024                 append( sb, "", 0 );
1025 
1026                 append( sb, "includes", 2 );
1027                 append( sb, "Inclusion patterns", 3 );
1028                 append( sb, "", 0 );
1029 
1030                 append( sb, "languageVersion (Default: 130)", 2 );
1031                 append( sb, "JS Language version (130 for JS 1.3)", 3 );
1032                 append( sb, "", 0 );
1033 
1034                 append( sb, "localRepository", 2 );
1035                 append( sb, "The local repository", 3 );
1036                 append( sb, "Required: Yes", 3 );
1037                 append( sb, "Expression: ${localRepository}", 3 );
1038                 append( sb, "", 0 );
1039 
1040                 append( sb, "optimizationLevel (Default: 9)", 2 );
1041                 append( sb, "Optimization level, from 0 to 9", 3 );
1042                 append( sb, "", 0 );
1043 
1044                 append( sb, "platform", 2 );
1045                 append( sb, "The platform for which the code should be compiled. android, iphone, ipad, universal", 3 );
1046                 append( sb, "Required: Yes", 3 );
1047                 append( sb, "Expression: ${platform}", 3 );
1048                 append( sb, "", 0 );
1049 
1050                 append( sb, "remoteRepositories", 2 );
1051                 append( sb, "The remote repositories declared in the pom.", 3 );
1052                 append( sb, "Expression: ${project.pluginArtifactRepositories}", 3 );
1053                 append( sb, "", 0 );
1054 
1055                 append( sb, "scriptClassifier", 2 );
1056                 append( sb, "optional extension for the compressed artifact. Example \'compressed\'", 3 );
1057                 append( sb, "", 0 );
1058 
1059                 append( sb, "scriptsDir", 2 );
1060                 append( sb, "The name of the script directory.\nThis parameter is optional it defaults to platform-scripts\n", 3 );
1061                 append( sb, "", 0 );
1062 
1063                 append( sb, "scriptsDirectory (Default: ${project.build.outputDirectory})", 2 );
1064                 append( sb, "The intput directory for the source javascript files.", 3 );
1065                 append( sb, "", 0 );
1066 
1067                 append( sb, "skipStats", 2 );
1068                 append( sb, "Don\'t display compression stats", 3 );
1069                 append( sb, "", 0 );
1070 
1071                 append( sb, "strip", 2 );
1072                 append( sb, "A special token to recognize lines to be removed from scripts (debugging code).", 3 );
1073                 append( sb, "", 0 );
1074 
1075                 append( sb, "strippedDirectory (Default: ${project.build.directory}/stripped)", 2 );
1076                 append( sb, "The output directory of the compressed javascript files.", 3 );
1077                 append( sb, "", 0 );
1078 
1079                 append( sb, "strippedDirName", 2 );
1080                 append( sb, "The name of the stripped directory.\nThis parameter is optional, it defaults to platform-stripped\n", 3 );
1081                 append( sb, "", 0 );
1082 
1083                 append( sb, "strips", 2 );
1084                 append( sb, "A list of special token to recognize lines to be removed from scripts (debugging code).", 3 );
1085                 append( sb, "", 0 );
1086             }
1087         }
1088 
1089         if ( goal == null || goal.length() <= 0 || "war-compress".equals( goal ) )
1090         {
1091             append( sb, "javascript:war-compress", 0 );
1092             append( sb, "Goal to be used from a war project, to compress the scripts present in the webapp packaging folder. Configured to run in the test phase as there is no way (in maven 2.0) to run between exploded webapp assembly and .war packaging.", 1 );
1093             append( sb, "", 0 );
1094             if ( detail )
1095             {
1096                 append( sb, "Available parameters:", 1 );
1097                 append( sb, "", 0 );
1098 
1099                 append( sb, "classifier", 2 );
1100                 append( sb, "classifier for the compressed artifact. If not set, compressed script will replace uncompressed ones, and will apply without any change in HTML/JSP.", 3 );
1101                 append( sb, "", 0 );
1102 
1103                 append( sb, "compressor (Default: jsmin)", 2 );
1104                 append( sb, "The compressor to used. Either \'shrinksafe\', \'yahooui\' or \'jsmin\' for default compressor, or a custom one provided as an artifact in repo org.codehaus.mojo.javascript:[xxx]-compressor.", 3 );
1105                 append( sb, "", 0 );
1106 
1107                 append( sb, "excludes", 2 );
1108                 append( sb, "Exclusion patterns", 3 );
1109                 append( sb, "", 0 );
1110 
1111                 append( sb, "includes", 2 );
1112                 append( sb, "Inclusion patterns", 3 );
1113                 append( sb, "", 0 );
1114 
1115                 append( sb, "languageVersion (Default: 130)", 2 );
1116                 append( sb, "JS Language version (130 for JS 1.3)", 3 );
1117                 append( sb, "", 0 );
1118 
1119                 append( sb, "localRepository", 2 );
1120                 append( sb, "The local repository", 3 );
1121                 append( sb, "Required: Yes", 3 );
1122                 append( sb, "Expression: ${localRepository}", 3 );
1123                 append( sb, "", 0 );
1124 
1125                 append( sb, "optimizationLevel (Default: 9)", 2 );
1126                 append( sb, "Optimization level, from 0 to 9", 3 );
1127                 append( sb, "", 0 );
1128 
1129                 append( sb, "remoteRepositories", 2 );
1130                 append( sb, "The remote repositories declared in the pom.", 3 );
1131                 append( sb, "Expression: ${project.pluginArtifactRepositories}", 3 );
1132                 append( sb, "", 0 );
1133 
1134                 append( sb, "scripts (Default: scripts)", 2 );
1135                 append( sb, "Folder in webapp containing javascripts", 3 );
1136                 append( sb, "", 0 );
1137 
1138                 append( sb, "skipStats", 2 );
1139                 append( sb, "Don\'t display compression stats", 3 );
1140                 append( sb, "", 0 );
1141 
1142                 append( sb, "strip", 2 );
1143                 append( sb, "A special token to recognize lines to be removed from scripts (debugging code).", 3 );
1144                 append( sb, "", 0 );
1145 
1146                 append( sb, "strips", 2 );
1147                 append( sb, "A list of special token to recognize lines to be removed from scripts (debugging code).", 3 );
1148                 append( sb, "", 0 );
1149 
1150                 append( sb, "webappDirectory", 2 );
1151                 append( sb, "The directory where the webapp is built.", 3 );
1152                 append( sb, "Required: Yes", 3 );
1153                 append( sb, "Expression: ${project.build.directory}/${project.build.finalName}", 3 );
1154                 append( sb, "", 0 );
1155             }
1156         }
1157 
1158         if ( goal == null || goal.length() <= 0 || "war-package".equals( goal ) )
1159         {
1160             append( sb, "javascript:war-package", 0 );
1161             append( sb, "Goal that prepares scripts for packaging as a web application.", 1 );
1162             append( sb, "", 0 );
1163             if ( detail )
1164             {
1165                 append( sb, "Available parameters:", 1 );
1166                 append( sb, "", 0 );
1167 
1168                 append( sb, "depsDirectory (Default: ${project.build.directory}/javascript-dependency)", 2 );
1169                 append( sb, "The folder where javascript dependencies are extracted and taken during assembling", 3 );
1170                 append( sb, "", 0 );
1171 
1172                 append( sb, "descriptor (Default: ${basedir}/src/assembler/${project.artifactId}.xml)", 2 );
1173                 append( sb, "Descriptor for the strategy to assemble individual scripts sources into destination.", 3 );
1174                 append( sb, "", 0 );
1175 
1176                 append( sb, "descriptorFormat", 2 );
1177                 append( sb, "Descriptor file format (default or jsbuilder)", 3 );
1178                 append( sb, "", 0 );
1179 
1180                 append( sb, "excludes", 2 );
1181                 append( sb, "Exclusion pattern.", 3 );
1182                 append( sb, "", 0 );
1183 
1184                 append( sb, "includes", 2 );
1185                 append( sb, "Inclusion pattern.", 3 );
1186                 append( sb, "", 0 );
1187 
1188                 append( sb, "libsDirectory (Default: lib)", 2 );
1189                 append( sb, "The folder for javascripts dependencies", 3 );
1190                 append( sb, "Expression: ${scripts}", 3 );
1191                 append( sb, "", 0 );
1192 
1193                 append( sb, "outputDirectory (Default: ${project.build.outputDirectory})", 2 );
1194                 append( sb, "The output directory of the assembled js file.", 3 );
1195                 append( sb, "", 0 );
1196 
1197                 append( sb, "scriptsDirectory (Default: scripts)", 2 );
1198                 append( sb, "The folder in webapp for javascripts", 3 );
1199                 append( sb, "Expression: ${scripts}", 3 );
1200                 append( sb, "", 0 );
1201 
1202                 append( sb, "sourceDirectory (Default: ${basedir}/src/main/javascript)", 2 );
1203                 append( sb, "Location of the source files.", 3 );
1204                 append( sb, "", 0 );
1205 
1206                 append( sb, "useArtifactId", 2 );
1207                 append( sb, "Use the artifactId as folder", 3 );
1208                 append( sb, "", 0 );
1209 
1210                 append( sb, "webappDirectory", 2 );
1211                 append( sb, "The directory where the webapp is built.", 3 );
1212                 append( sb, "Required: Yes", 3 );
1213                 append( sb, "Expression: ${project.build.directory}/${project.build.finalName}", 3 );
1214                 append( sb, "", 0 );
1215             }
1216         }
1217 
1218         if ( getLog().isInfoEnabled() )
1219         {
1220             getLog().info( sb.toString() );
1221         }
1222     }
1223 
1224     /**
1225      * <p>Repeat a String <code>n</code> times to form a new string.</p>
1226      *
1227      * @param str String to repeat
1228      * @param repeat number of times to repeat str
1229      * @return String with repeated String
1230      * @throws NegativeArraySizeException if <code>repeat < 0</code>
1231      * @throws NullPointerException if str is <code>null</code>
1232      */
1233     private static String repeat( String str, int repeat )
1234     {
1235         StringBuffer buffer = new StringBuffer( repeat * str.length() );
1236 
1237         for ( int i = 0; i < repeat; i++ )
1238         {
1239             buffer.append( str );
1240         }
1241 
1242         return buffer.toString();
1243     }
1244 
1245     /** 
1246      * Append a description to the buffer by respecting the indentSize and lineLength parameters.
1247      * <b>Note</b>: The last character is always a new line.
1248      * 
1249      * @param sb The buffer to append the description, not <code>null</code>.
1250      * @param description The description, not <code>null</code>.
1251      * @param indent The base indentation level of each line, must not be negative.
1252      */
1253     private void append( StringBuffer sb, String description, int indent )
1254     {
1255         for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); )
1256         {
1257             sb.append( it.next().toString() ).append( '\n' );
1258         }
1259     }
1260 
1261     /** 
1262      * Splits the specified text into lines of convenient display length.
1263      * 
1264      * @param text The text to split into lines, must not be <code>null</code>.
1265      * @param indent The base indentation level of each line, must not be negative.
1266      * @param indentSize The size of each indentation, must not be negative.
1267      * @param lineLength The length of the line, must not be negative.
1268      * @return The sequence of display lines, never <code>null</code>.
1269      * @throws NegativeArraySizeException if <code>indent < 0</code>
1270      */
1271     private static List toLines( String text, int indent, int indentSize, int lineLength )
1272     {
1273         List lines = new ArrayList();
1274 
1275         String ind = repeat( "\t", indent );
1276         String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
1277         for ( int i = 0; i < plainLines.length; i++ )
1278         {
1279             toLines( lines, ind + plainLines[i], indentSize, lineLength );
1280         }
1281 
1282         return lines;
1283     }
1284 
1285     /** 
1286      * Adds the specified line to the output sequence, performing line wrapping if necessary.
1287      * 
1288      * @param lines The sequence of display lines, must not be <code>null</code>.
1289      * @param line The line to add, must not be <code>null</code>.
1290      * @param indentSize The size of each indentation, must not be negative.
1291      * @param lineLength The length of the line, must not be negative.
1292      */
1293     private static void toLines( List lines, String line, int indentSize, int lineLength )
1294     {
1295         int lineIndent = getIndentLevel( line );
1296         StringBuffer buf = new StringBuffer( 256 );
1297         String[] tokens = line.split( " +" );
1298         for ( int i = 0; i < tokens.length; i++ )
1299         {
1300             String token = tokens[i];
1301             if ( i > 0 )
1302             {
1303                 if ( buf.length() + token.length() >= lineLength )
1304                 {
1305                     lines.add( buf.toString() );
1306                     buf.setLength( 0 );
1307                     buf.append( repeat( " ", lineIndent * indentSize ) );
1308                 }
1309                 else
1310                 {
1311                     buf.append( ' ' );
1312                 }
1313             }
1314             for ( int j = 0; j < token.length(); j++ )
1315             {
1316                 char c = token.charAt( j );
1317                 if ( c == '\t' )
1318                 {
1319                     buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
1320                 }
1321                 else if ( c == '\u00A0' )
1322                 {
1323                     buf.append( ' ' );
1324                 }
1325                 else
1326                 {
1327                     buf.append( c );
1328                 }
1329             }
1330         }
1331         lines.add( buf.toString() );
1332     }
1333 
1334     /** 
1335      * Gets the indentation level of the specified line.
1336      * 
1337      * @param line The line whose indentation level should be retrieved, must not be <code>null</code>.
1338      * @return The indentation level of the line.
1339      */
1340     private static int getIndentLevel( String line )
1341     {
1342         int level = 0;
1343         for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
1344         {
1345             level++;
1346         }
1347         for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
1348         {
1349             if ( line.charAt( i ) == '\t' )
1350             {
1351                 level++;
1352                 break;
1353             }
1354         }
1355         return level;
1356     }
1357 }