new-from-template.pl
|
-t FILE [-o DIRECTORY] [-f[d]] [-h] [-?]
|
${variable-name}
can
be used in these files to refer to values that should be filled out by
new-from-template.pl when the template is processedvariable-name = variable-value
. The
variable-value
may refer to the value of other variables
by using the syntax ${other-variable-name}
. Note that
this is the same way a templatized source file would refer to a
variable. The order of declaration is not significant, as
new-from-template.pl loads the entire list of variables before it
it begins dereferencing them.
Function | Description |
---|---|
file("<file-name>")
|
The file function is used to set the variable to
the contents of another file.
|
eval("<perl-code>")
|
The eval function is used to set the variable to
the result of executing arbitrary perl code.
|
include "<filename.tpl>"
. This will include
filename.tpl as if it were part of the .tpl at the
position of the include
. If filename.tpl declares
any variables that had been set before the include
,
they will be overridden. Any variables you define after the
include
will remain intact.top_wizard_dir
that can be used to locate files relative to
the new-from-template.pl script. Any file references that are not
explicitly relative to this variable will be relative to the user's
working directory.rename ("<templatized-source-name>", "<target-source-name>")
.
When new-from-template.pl process the template, any filename matching
templatized-source-name
will be renamed to
target-source-name
. This has the side effect of setting
the value of the filename:templatized-source-name
variable
to target-source-name
.filename:*
will return
the value following the filename:
as its default value.
This allows you to refer to filename:
variables in your
templatized source files, instead of the actual filenames.template_description
in the template file.
template_description
s provided by template file(s)
include
ed by the main template file will not
be displayed.
perl new-from-template.pl -t templates/xul-app.tpl -h
Shows a description of the XUL App template.
perl new-from-template.pl -t my/sample.xul-app.tpl
Generates a new XUL Application from the variables defined by
sample.xul-app.tpl into the default output directory,
nft-results.
perl new-from-template.pl -t my/sample.xpcom-component.tpl
-o ~/src/cvs/mozilla/extensions/jsdebugger/
Generates a new XPCOM component from the variables defined by
sample.xpcom-component.tpl into the directory
~/src/cvs/mozilla/extensions/jsdebugger/