Project Template Syntax
From FDT Documentation
(→Libraries) |
(→Libraries) |
||
Line 1: | Line 1: | ||
- | + | <div class="center"><div class="floatnone"><a href="/docs/File:Template_properties.png" class="image"><img alt="Template properties.png" src="/w/images/0/08/Template_properties.png" width="600" height="150" /></a></div></div> | |
- | + | <p>With FDT 4.2, the FDT team greatly expanded project templates and the syntax available in the description.xml. | |
- | With FDT 4.2, the FDT team greatly expanded project templates and the syntax available in the description.xml. | + | </p> |
- | + | <h1>Template Properties</h1> | |
- | + | <h2>description</h2> | |
- | + | <p>Use this tag to add a text description to your template. This will appear in the text area below the template selector. You can even add in variables into your description and update the user about the current selection. | |
- | Use this tag to add a text description to your template. This will appear in the text area below the template selector. You can even add in variables into your description and update the user about the current selection. | + | </p> |
- | + | <div class="center"><div class="floatnone"><a href="/docs/File:Description.png" class="image"><img alt="Description.png" src="/w/images/8/87/Description.png" width="600" height="150" /></a></div></div> | |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"htmlDesc"</span> <span class="re0">value</span>=<span class="st0">"if(${htmlTemplate},</span> | |
- | < | + | <span class="sc3">'This HTML wrapper will create a simple HTML page with your SWF embedded in it.',' ')"</span> <span class="re2">/></span></span> |
- | <expressions> | + | <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span> |
- | <expression name="htmlDesc" value="if(${htmlTemplate}, | + | <span class="sc3"><span class="re1"><description<span class="re2">></span></span></span> |
- | 'This HTML wrapper will create a simple HTML page with your SWF embedded in it.',' ')" /> | + | |
- | </expressions> | + | |
- | <description> | + | |
This template will create a project named '${projectName}' | This template will create a project named '${projectName}' | ||
which contains only the basic libraries to develop and compile a | which contains only the basic libraries to develop and compile a | ||
pure AS3 project.${newline}${htmlDesc} | pure AS3 project.${newline}${htmlDesc} | ||
- | </description> | + | <span class="sc3"><span class="re1"></description<span class="re2">></span></span></span></pre></div></div> |
- | </ | + | <p><br /> |
- | + | </p> | |
- | + | <ul><li> <i>note</i>: Use the <i>${newline}</i> keyword to create a line break in your descriptions. In the above example, if the users sets true <i>htmlDesc</i> then the additional text will be added, on a new line, to the description. | |
- | + | </li></ul> | |
- | + | <p><br /> | |
- | + | </p> | |
- | + | <hr /> | |
- | + | <h2>name</h2> | |
- | + | <p>The name of your template as it appears in the new project wizard. | |
- | + | </p> | |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><name<span class="re2">></span></span></span>AS3<span class="sc3"><span class="re1"></name<span class="re2">></span></span></span></pre></div></div> | |
- | The name of your template as it appears in the new project wizard. | + | <p><br /> |
- | + | </p> | |
- | < | + | <hr /> |
- | <name>AS3</name> | + | <h2>version</h2> |
- | </ | + | <p>FDT uses this element to keep track of the version for the template in case it is to be updated. |
- | + | </p> | |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><version<span class="re2">></span></span></span>2.0<span class="sc3"><span class="re1"></version<span class="re2">></span></span></span></pre></div></div> | |
- | + | <p><br /> | |
- | + | </p> | |
- | + | <hr /> | |
- | + | <h2>projectType</h2> | |
- | FDT uses this element to keep track of the version for the template in case it is to be updated. | + | <p>Each template needs to have its projectType defined. The project type is what determines which SDK &.SWCs are automatically added to your source path, your runtime, player and compiler arguments. |
- | + | </p><p>The project types are located in the <i>projectTypes</i> folder within the <i>FDT</i> folder. | |
- | < | + | </p> |
- | <version>2.0</version> | + | <div class="center"><div class="floatnone"><a href="/docs/File:Project_types.png" class="image"><img alt="Project types.png" src="/w/images/a/a3/Project_types.png" width="225" height="193" /></a></div></div> |
- | </ | + | <p><br /> |
- | + | </p> | |
- | + | <h1>Variables</h1> | |
- | + | <h2>variables</h2> | |
- | + | <p>The <i>variables</i> tag is what defines templates in FDT 4.2 and later. When a template implements this element, you'll be able to create UI elements that allow you to customize your project before completion. Your template can only have one <i>variables</i> element. FDT will read the first and ignore any following <i>variables</i> elements. | |
- | + | </p> | |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> | |
- | Each template needs to have its projectType defined. The project type is what determines which SDK &.SWCs are automatically added to your source path, your runtime, player and compiler arguments. | + | <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Template Options"</span><span class="re2">></span><span class="re1"></primaryGroup<span class="re2">></span></span></span> |
- | + | <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span></pre></div></div> | |
- | The project types are located in the | + | <p><br /> |
- | + | </p> | |
- | + | <hr /> | |
- | + | <h2>primaryGroup</h2> | |
- | + | <p>When you create a <i>variables</i> element, you'll need to have a <i>primaryGroup</i> descendant element. | |
- | + | Similar to <i>variables</i>, <i>primaryGroup</i> can only appear once inside of a <i>variables</i> element. | |
- | = | + | </p> |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> | |
- | == | + | <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Template Options"</span><span class="re2">></span></span> |
- | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addMetaData"</span> <span class="re0">label</span>=<span class="st0">"Add Metadata"</span> <span class="re0">default</span>=<span class="st0">"true"</span></span> | |
- | The | + | <span class="sc3"> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> |
- | + | <span class="sc3"><span class="re1"><group</span> <span class="re0">label</span>=<span class="st0">"Project Setup"</span><span class="re2">></span></span> | |
- | < | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addFla"</span> <span class="re0">label</span>=<span class="st0">"Add .fla"</span> <span class="re0">default</span>=<span class="st0">"true"</span></span> |
- | <variables> | + | <span class="sc3"> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> |
- | <primaryGroup label="Template Options"></primaryGroup> | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"htmlTemplate"</span> <span class="re0">label</span>=<span class="st0">"Include HTML Wrapper"</span></span> |
- | </variables> | + | <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> |
- | </ | + | <span class="sc3"><span class="re1"></group<span class="re2">></span></span></span> |
- | + | <span class="sc3"><span class="re1"></primaryGroup<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span></pre></div></div> | |
- | + | <p><br /> | |
- | + | <b>Arguments</b>: | |
- | + | </p> | |
- | + | <ol><li><b>label</b> : The label description that will appear at the top of the template variables UI section within the New Flash Project Wizard. | |
- | When you create a | + | </li><li><b>description</b> : An optional description for documentation purposes. |
- | Similar to | + | </li></ol> |
- | + | <ul><li><i>note</i>: Other arguments, such as 'enableIf', are ignored. | |
- | < | + | </li></ul> |
- | <variables> | + | <p><br /> |
- | <primaryGroup label="Template Options"> | + | </p> |
- | <variable name="addMetaData" label="Add Metadata" default=" | + | <hr /> |
- | + | <h2>group</h2> | |
- | <group label="Project Setup"> | + | <p>Groups are used to organize similar variables together. They are also used to create popup buttons that will open a new window containing more UI elements. Groups can have more groups nested within them. |
- | <variable name="addFla" label="Add .fla" default=" | + | </p><p><br /> |
- | + | </p> | |
- | <variable name="htmlTemplate" label="Include HTML Wrapper | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> |
- | + | <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Options"</span> <span class="re0">description</span>=<span class="st0">"My Template Variables"</span> <span class="re2">></span></span> | |
- | </group> | + | <span class="sc3"><span class="re1"><group</span> <span class="re0">label</span>=<span class="st0">"Unit Testing"</span><span class="re2">></span></span> |
- | </primaryGroup> | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addUnitTesting"</span> <span class="re0">label</span>=<span class="st0">"Add Unit Testing"</span></span> |
- | </variables> | + | <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> |
- | </ | + | |
- | + | <span class="sc-1"><!-- Create a popupButton that will open these UI variables in a new window --></span> | |
- | + | <span class="sc3"><span class="re1"><group</span> <span class="re0">label</span>=<span class="st0">"More..."</span> <span class="re0">style</span>=<span class="st0">"popupButton"</span><span class="re2">></span></span> | |
- | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"testFolderName"</span> <span class="re0">label</span>=<span class="st0">"Test Folder Name"</span></span> | |
- | + | <span class="sc3"> <span class="re0">default</span>=<span class="st0">"test-src"</span> <span class="re0">type</span>=<span class="st0">"string"</span> <span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addExample"</span> <span class="re0">label</span>=<span class="st0">"Add Unit Test Example"</span></span> | |
- | + | <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addJar"</span> <span class="re0">label</span>=<span class="st0">"Include flexUnitTasks.jar"</span></span> | |
- | + | <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"></group<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></group<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></primaryGroup<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span></pre></div></div> | |
- | Groups are used to organize similar variables together. They are also used to create popup buttons that will open a new window containing more UI elements. Groups can have more groups nested within them. | + | <p><br /> |
- | + | <b>Arguments</b>: | |
- | + | </p> | |
- | < | + | <ol><li><b>label</b> : The label description that will appear at the top group. |
- | <variables> | + | </li><li><b>description</b> : An optional description for documentation purposes. |
- | <primaryGroup label="Options" description="My Template Variables" > | + | </li><li><b>enableIf</b> : A boolean that can disable and enable the UI variables within the group. |
- | <group label="Unit Testing"> | + | </li><li><b>style</b> : Use this to set if the group is to be a popup window. Possible values are <i>popupButton</i> and <i>hyperlink</i>. |
- | <variable name="addUnitTesting" label="Add Unit Testing | + | </li></ol> |
- | + | <p><br /> | |
- | + | </p> | |
- | <!-- Create a popupButton that will open these UI variables in a new window --> | + | <hr /> |
- | <group label="More..." style="popupButton"> | + | <h2>variable</h2> |
- | <variable name="testFolderName" label="Test Folder Name | + | <p>The most powerful part of project templates are the UI variables you can create. Each <i>variable</i> element you create will represent itself as an interactive UI component (e.g. text input, combo box, radio button). The value of the variable will be evaluated as you change it while configuring your template. |
- | + | </p><p>If you reference the variable in any files (ActionScript,XML,JavaScript,HTML....) and you choose to process those files (within a contentCreation element) the variable will be replaced with whatever value you have assigned it. | |
- | <variable name="addExample" label="Add Unit Test Example | + | </p><p>To reference a variable use a dollar sign and brackets, '${}', with your variable name between the brackets. |
- | + | </p> | |
- | <variable name="addJar" label="Include flexUnitTasks.jar | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> |
- | + | <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Options"</span><span class="re2">></span></span> | |
- | </group> | + | <span class="sc-1"><!-- This variable is being used to determine to add Metadata or not--></span> |
- | </group> | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addMetaData"</span> <span class="re0">label</span>=<span class="st0">"Add Metadata"</span> <span class="re0">default</span>=<span class="st0">"true"</span></span> |
- | </primaryGroup> | + | <span class="sc3"> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> |
- | </variables> | + | <span class="sc-1"><!-- This variable is being used to setup the base class of my ActionScript file. </span> |
- | </ | + | <span class="sc-1"> In my ActionScript files'${classExtends}' will be replaced with whatever</span> |
- | + | <span class="sc-1"> value it is assigned here --></span> | |
- | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"classExtends"</span> <span class="re0">label</span>=<span class="st0">"Base Class:"</span> <span class="re0">default</span>=<span class="st0">"Sprite"</span></span> | |
- | + | <span class="sc3"> <span class="re0">type</span>=<span class="st0">"enum('Sprite','MovieClip')"</span> <span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"></primaryGroup<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span></pre></div></div> | |
- | + | <p><br /> | |
- | + | <b>Arguments</b>: | |
- | + | </p> | |
- | + | <ol><li><b>name</b> : To reuse your variable, you'll need to be able to reference it either within the template itself, or in an external file that will be processed ( variables replaced ). | |
- | + | </li><li><b>label</b> : What will be displayed to the users within the template GUI. | |
- | + | </li><li><b>default</b> : The starting value for the variable. | |
- | + | </li><li><b>type</b> : Use this to set the UI component (e.g. text input, combo box, radio button). | |
- | + | </li><li><b>description</b> : An optional description for documentation purposes. | |
- | The most powerful part of project templates are the UI variables you can create. Each | + | </li><li><b>enableIf</b> : A boolean that can disable and enable the variable. |
- | + | </li></ol> | |
- | If you reference the variable in any files (ActionScript,XML,JavaScript,HTML....) and you choose to process those files (within a contentCreation element) the variable will be replaced with whatever value you have assigned it. | + | <p>When using the <i>type</i> attribute here are some examples of UI components you can create: |
- | + | </p> | |
- | To reference a variable use a dollar sign and brackets, '${}', with your variable name between the brackets. | + | <ul><li><b>enum('value 1','value 2','value 3',...)</b>: This will create a combo box or radio button set of predefined values. The default for <i>enum</i> will be a combo box. To create radio buttons, add a <i>style=radio</i> attribute. |
- | + | </li><li><b>color</b>: This will create a button that will display a color hex value and allow you to open the color picker. | |
- | < | + | </li><li><b>int('minimum value','maximum value','increment value')</b>: This will create a text input for number values based on the define range. |
- | <variables> | + | </li><li><b>float</b>: Creates a text input for float values. |
- | <primaryGroup label="Options"> | + | </li><li><b>string</b>: A text input. |
- | <!-- This variable is being used to determine to add Metadata or not--> | + | </li><li><b>string('value 1','value 2',...)</b>: A text input with a combo box that allows for preset (but editable) values. |
- | <variable name="addMetaData" label="Add Metadata" default=" | + | </li><li><b>boolean</b>: This will create a checkbox that will toggle the variable from <i>true</i> to <i>false</i>. |
- | + | </li><li><b>file</b>: This will create a text input and browse button that will point to a specific file. There is also the option to create file filters, e.g. type="file('png','gif')" | |
- | <!-- This variable is being used to setup the base class of my ActionScript file. | + | </li><li><b>folder</b>: This will create a text input and browse button for a specific folder. There is also the option to create file filters, e.g. type="file('png','gif')" |
- | + | </li></ul> | |
- | + | <p><br /> | |
- | <variable name="classExtends" label="Base Class:" default=" | + | </p> |
- | + | <hr /> | |
- | </primaryGroup> | + | <h2>hyperlink</h2> |
- | </variables> | + | <p>Within group elements, you can add a hyperlink which will open your browser and navigate to a particular URL. |
- | </ | + | </p> |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Template Options"</span><span class="re2">></span></span> | |
- | + | <span class="sc3"><span class="re1"><group<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addUnitTesting"</span> <span class="re0">label</span>=<span class="st0">"Add Unit Testing"</span></span> | |
- | + | <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><hyperlink</span> <span class="re0">label</span>=<span class="st0">"More About Unit Testing"</span> <span class="re0">target</span>=<span class="st0">"http://www.flexunit.com..."</span> </span> | |
- | + | <span class="sc3"> <span class="re0">style</span>=<span class="st0">"hyperlink"</span> <span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"></group<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></primaryGroup<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span></pre></div></div> | |
- | When using the | + | <p><br /> |
- | + | <b>Arguments</b>: | |
- | + | </p> | |
- | + | <ol><li><b>label</b> : The text that will appear for the button / hyperlink. | |
- | + | </li><li><b>description</b> : An optional description for documentation purposes. | |
- | + | </li><li><b>enableIf</b> : A boolean that can disable and enable the link. | |
- | + | </li><li><b>style</b> : Use this to set the UI as a button or an HTML style link. Possible values are <i>popupButton</i> and <i>hyperlink</i>. | |
- | + | </li></ol> | |
- | + | <p><br /> | |
- | + | </p> | |
- | + | <hr /> | |
- | + | <h1>Expressions</h1> | |
- | + | <h2>Overview</h2> | |
- | + | <p>Expressions allow you to create more variables (not associated with any UI), if/else statements, hashmaps(maps) and concatenation expressions. | |
- | + | </p><p>There are different ways of using expressions. | |
- | + | </p> | |
- | Within group elements, you can add a hyperlink which will open your browser and navigate to a particular URL. | + | <h3>Simple Assignments</h3> |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> | |
- | < | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"sourceFolder"</span> <span class="re0">value</span>=<span class="st0">"src"</span> <span class="re2">/></span></span> |
- | <variables> | + | <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span></pre></div></div> |
- | <primaryGroup label="Template Options"> | + | <h3>Arithmetic Operations</h3> |
- | <group> | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> |
- | <variable name="addUnitTesting" label="Add Unit Testing | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"number"</span> <span class="re0">value</span>=<span class="st0">"8*2"</span><span class="re2">/></span></span> |
- | + | <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span></pre></div></div> | |
- | <hyperlink label="More About Unit Testing" target="http://www.flexunit.com... | + | <p><br /> |
- | + | </p> | |
- | </group> | + | <h3>Boolean Operations</h3> |
- | </primaryGroup> | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> |
- | </variables> | + | <span class="sc-1"><!--using operator symbols such as '||' and '&amp;&amp;' --></span> |
- | </ | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"allUnitTestingSamples"</span> </span> |
- | + | <span class="sc3"> <span class="re0">value</span>=<span class="st0">"${addExample} &amp;&amp; ${addUnitTesting} &amp;&amp; ${addCIExample}"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"anyExampleChosen"</span> <span class="re0">value</span>=<span class="st0">"${addExample} || ${addCIExample}"</span><span class="re2">/></span></span> | |
- | + | | |
- | + | <span class="sc-1"><!--using operator expressions such as 'or()' and 'and()' --></span> | |
- | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"allUnitTestingSamples2"</span> </span> | |
- | + | <span class="sc3"> <span class="re0">value</span>=<span class="st0">"and(${addExample}, ${addUnitTesting}, ${addCIExample}"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"anyExampleChosen2"</span> <span class="re0">value</span>=<span class="st0">"or(${addExample} ,${addCIExample})"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span></pre></div></div> | |
- | + | <p><br /> | |
- | + | </p> | |
- | + | <ul><li>note: Because of how Ant works, you need to use the '&amp;&amp;' syntax when you want to use '&&'. | |
- | + | </li><li>note: Expressions 'and(value 1, value 2,...)' and 'or(value 1, value 2,...)' can accept any number of arguments. | |
- | + | </li></ul> | |
- | + | <h3>String Operations</h3> | |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> | |
- | Expressions allow you to create more variables (not associated with any UI), if/else statements, hashmaps(maps) and concatenation expressions. | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"var"</span> <span class="re0">value</span>=<span class="st0">" wonderful "</span><span class="re2">/></span></span> |
- | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"myExp"</span> <span class="re0">value</span>=<span class="st0">"concat('hello ',${var},' world')"</span> <span class="re2">/></span></span> | |
- | There are different ways of using expressions. | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"myExp2"</span> <span class="re2">></span></span>hello wonderful world<span class="sc3"><span class="re1"></expression<span class="re2">></span></span></span> |
- | + | <span class="sc-1"><!--both output 'hello wonderful world' --></span> | |
- | + | <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span></pre></div></div> | |
- | + | <p><br /> | |
- | + | </p> | |
- | < | + | <ul><li>note: 'concat(value 1, value 2, value 3,...)' can accept any number of arguments. |
- | <expressions> | + | </li></ul> |
- | <expression name="sourceFolder" value=" | + | <p><br /> |
- | </ | + | </p> |
- | </ | + | <hr /> |
- | + | <h2>expressions</h2> | |
- | ===Arithmetic Operations=== | + | <p>The <i>expressions</i> element is used as a placeholder for your expressions. It can only appear once in your description.xml. |
- | + | </p> | |
- | < | + | <hr /> |
- | <expressions> | + | <h2>expression</h2> |
- | <expression name="number" value="8*2"/> | + | <p>Inside of your <i>expressions</i> tag you can place individual expressions and maps. An expression can be either a simple variable creation or an evaluation. Examples include: |
- | </expressions> | + | </p> |
- | </ | + | <ul><li>if('boolean','use this value if true','use this value if false') |
- | + | </li><li>concat(value 1, value 2, value 3,...) | |
- | + | </li><li>and(value 1, value 2, ...) | |
- | + | </li><li>or(value 1, value 2, ...) | |
- | + | </li><li>true | |
- | < | + | </li><li>false |
- | <expressions> | + | </li></ul> |
- | <!--using operator symbols such as '||' and '&&' --> | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> |
- | <expression name=" | + | <span class="sc-1"><!-- simple variable declaration--></span> |
- | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"sourceFolder"</span> <span class="re0">value</span>=<span class="st0">"src"</span> <span class="re2">/></span></span> | |
- | <expression name="anyExampleChosen" value="${addExample} || ${addCIExample}"/> | + | <span class="sc-1"><!-- using the concat() expression--></span> |
- | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"metaDataExp"</span> <span class="re0">value</span>=<span class="st0">"concat('[SWF(backgroundColor=&quot;',0xFFFFFF,</span> | |
- | <!--using operator expressions such as 'or()' and 'and()' --> | + | <span class="sc3">'&quot;,frameRate=&quot;',bannerFPS(${metaTheme}),'&quot;, width=&quot;',</span> |
- | <expression name=" | + | <span class="sc3">bannerWidth(${metaTheme}),'&quot;,height=&quot;',bannerHeight(${metaTheme}),</span> |
- | + | <span class="sc3">'&quot;)]')"</span> <span class="re2">/></span></span> | |
- | <expression name="anyExampleChosen2" value="or(${addExample} ,${addCIExample})"/> | + | <span class="sc-1"><!-- using an if() expression--></span> |
- | </expressions> | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"htmlDesc"</span></span> |
- | </ | + | <span class="sc3"> <span class="re0">value</span>=<span class="st0">"if(${htmlTemplate},</span> |
- | + | <span class="sc3"> 'This HTML wrapper will create a simple HTML page with </span> | |
- | + | <span class="sc3"> your SWF embedded in it.',' ')"</span> <span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span></pre></div></div> | |
- | + | <p><br /> | |
- | + | </p> | |
- | + | <hr /> | |
- | + | <h2>map</h2> | |
- | < | + | <p>A map (hashmap, hash table, dictionary) is a way to create a collection of key value pairs. This is helpful when creating themes or predefined sets. Whenever a particular theme or set is selected, various variables and values can be changed throughout your template. |
- | <expressions> | + | </p> |
- | <expression name="var" value=" wonderful "/> | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc-1"><!-- Create a variable (a collection of 'themes') that users can select and change--></span> |
- | <expression name="myExp" value="concat('hello ',${var},' world')" /> | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"metaTheme"</span> <span class="re0">label</span>=<span class="st0">"Application Type"</span></span> |
- | <expression name="myExp2" >hello wonderful world</expression> | + | <span class="sc3"><span class="re0">default</span>=<span class="st0">"Leaderboard"</span> <span class="re0">type</span>=<span class="st0">"enum('Leaderboard','Full Banner','Half Banner','Full Site')"</span><span class="re2">/></span></span> |
- | <!--both output 'hello wonderful world' --> | + | |
- | </expressions> | + | |
- | </ | + | <span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> |
- | + | <span class="sc-1"><!-- Create some maps associated with the value of 'metaTheme' --></span> | |
- | + | <span class="sc3"><span class="re1"><map</span> <span class="re0">name</span>=<span class="st0">"bannerWidth"</span> <span class="re2">></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Leaderboard"</span> <span class="re0">value</span>=<span class="st0">"'728'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Banner"</span> <span class="re0">value</span>=<span class="st0">"'468'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Half Banner"</span> <span class="re0">value</span>=<span class="st0">"'234'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Site"</span> <span class="re0">value</span>=<span class="st0">"'800'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"></map<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"><map</span> <span class="re0">name</span>=<span class="st0">"bannerHeight"</span> <span class="re2">></span></span> | |
- | The | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Leaderboard"</span> <span class="re0">value</span>=<span class="st0">"'90'"</span><span class="re2">/></span></span> |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Banner"</span> <span class="re0">value</span>=<span class="st0">"'60'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Half Banner"</span> <span class="re0">value</span>=<span class="st0">"'60'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Site"</span> <span class="re0">value</span>=<span class="st0">"'600'"</span><span class="re2">/></span></span> | |
- | Inside of your | + | <span class="sc3"><span class="re1"></map<span class="re2">></span></span></span> |
- | + | <span class="sc3"><span class="re1"><map</span> <span class="re0">name</span>=<span class="st0">"bannerFPS"</span> <span class="re2">></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Leaderboard"</span> <span class="re0">value</span>=<span class="st0">"'22'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Banner"</span> <span class="re0">value</span>=<span class="st0">"'22'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Half Banner"</span> <span class="re0">value</span>=<span class="st0">"'22'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Site"</span> <span class="re0">value</span>=<span class="st0">"'60'"</span><span class="re2">/></span></span> | |
- | + | <span class="sc3"><span class="re1"></map<span class="re2">></span></span></span> | |
- | + | <span class="sc-1"><!-- Use the maps and pass to them, as a key, the theme you chose. </span> | |
- | + | <span class="sc-1"> E.g if 'metaTheme' is equal to 'Leaderboard', </span> | |
- | < | + | <span class="sc-1">then 'bannerFPS(${metaTheme})' is equal to 728--></span> |
- | <expressions> | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"metaDataExp"</span> <span class="re0">value</span>=<span class="st0">"concat('[SWF(backgroundColor=&quot;',0xFFFFFF,</span> |
- | <!-- simple variable declaration--> | + | <span class="sc3">'&quot;,frameRate=&quot;',bannerFPS(${metaTheme}),'&quot;, width=&quot;',</span> |
- | <expression name="sourceFolder" value="src" /> | + | <span class="sc3">bannerWidth(${metaTheme}),'&quot;,height=&quot;',bannerHeight(${metaTheme}),</span> |
- | <!-- using the concat() expression--> | + | <span class="sc3">'&quot;)]')"</span> <span class="re2">/></span></span> |
- | <expression name="metaDataExp" value="concat('[SWF(backgroundColor="',0xFFFFFF, | + | |
- | '",frameRate="',bannerFPS(${metaTheme}),'", width="', | + | <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span></pre></div></div> |
- | bannerWidth(${metaTheme}),'",height="',bannerHeight(${metaTheme}), | + | <p><br /> |
- | '")]')" /> | + | </p><p><br /> |
- | <!-- using an if() expression--> | + | </p> |
- | <expression name=" | + | <hr /> |
- | + | <p><br /> | |
- | + | </p> | |
- | + | <h2>Replace</h2> | |
- | </expressions> | + | <p>With 4.5, FDT extended the expressions syntax with two new expressions: 'replace' and 'replaceRegex'. Both of these allow you to replace the values of strings or variables. |
- | </ | + | </p> |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc-1"><!-- Create a variable (a collection of 'themes') that users can select and change--></span> | |
- | + | <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"metaTheme"</span> <span class="re0">label</span>=<span class="st0">"Application Type"</span></span> | |
- | + | <span class="sc3"><span class="re0">default</span>=<span class="st0">"Leaderboard"</span> <span class="re0">type</span>=<span class="st0">"enum('Leaderboard','Full Banner','Half Banner','Full Site')"</span><span class="re2">/></span></span> | |
- | + | | |
- | + | <span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> | |
- | + | | |
- | A map (hashmap, hash table, dictionary) is a way to create a collection of key value pairs. This is helpful when creating themes or predefined sets. Whenever a particular theme or set is selected, various variables and values can be changed throughout your template. | + | <span class="sc-1"><!-- This will create a new expression (variable) named 'postFileName'. </span> |
- | + | <span class="sc-1">This expression will execute a regex computation on the variable ${projectName} </span> | |
- | < | + | <span class="sc-1">and replace it. In this case it's replacing it with blank: ''. --></span> |
- | <!-- Create a variable (a collection of 'themes') that users can select and change--> | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"postFileName"</span></span> |
- | <variable name="metaTheme" label="Application Type | + | <span class="sc3"> <span class="re0">value</span>=<span class="st0">"replaceRegex(${projectName}, '([^\w]+)', '')"</span> <span class="re2">/></span></span> |
- | default="Leaderboard" type="enum('Leaderboard','Full Banner','Half Banner','Full Site')"/> | + | |
- | + | <span class="sc-1"><!-- This expression will scan the variable '${projectName}' and if it finds the value</span> | |
- | + | <span class="sc-1"> 'Joe', it will replace it with 'Bob' --></span> | |
- | <expressions> | + | <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"postFileName"</span></span> |
- | <!-- Create some maps associated with the value of 'metaTheme' --> | + | <span class="sc3"> <span class="re0">value</span>=<span class="st0">"replace(${projectName}, 'Joe', 'Bob')"</span> <span class="re2">/></span></span> |
- | <map name="bannerWidth" > | + | <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span></pre></div></div> |
- | <entry key="Leaderboard" value="'728'"/> | + | <p><b>Arguments</b>: |
- | <entry key="Full Banner" value="'468'"/> | + | </p> |
- | <entry key="Half Banner" value="'234'"/> | + | <ol><li><b>name</b> : The reference (variable name) of the expression. Use this to reference the expression elsewhere in the template or your files. |
- | <entry key="Full Site" value="'800'"/> | + | </li><li><b>value</b> : Three values: replaceRegex([the variable or string you'd like to evaluate],[what to look for],[what to replace if found]) |
- | </map> | + | </li></ol> |
- | <map name="bannerHeight" > | + | <h1>Extensions</h1> |
- | <entry key="Leaderboard" value="'90'"/> | + | <p>The extensions tag is used internally by the team to add functionality to templates into the future. When this is developed, more information will added here. |
- | <entry key="Full Banner" value="'60'"/> | + | </p><p><br /> |
- | <entry key="Half Banner" value="'60'"/> | + | </p> |
- | <entry key="Full Site" value="'600'"/> | + | <hr /> |
- | </map> | + | <h1>Folders</h1> |
- | <map name=" | + | <h2>folders</h2> |
- | <entry key="Leaderboard" value="'22'"/> | + | <p>This tag, and its descendants, is used to define properties of special folders in your project. This is where you define which folders are source folder(s), your output folder, and auto library folder(s). If the folder referenced here doesn't exist when the project is created, FDT will create it. |
- | <entry key="Full Banner" value="'22'"/> | + | </p> |
- | <entry key="Half Banner" value="'22'"/> | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><folders<span class="re2">></span></span></span> |
- | <entry key="Full Site" value="'60'"/> | + | <span class="sc-1"><!-- set, or create, a source folder named 'src' --></span> |
- | </map> | + | <span class="sc3"><span class="re1"><sourceFolder<span class="re2">></span></span></span>src<span class="sc3"><span class="re1"></sourceFolder<span class="re2">></span></span></span> |
- | <!-- Use the maps and pass to them, as a key, the theme you chose. | + | <span class="sc-1"><!-- set, or create, a source folder named 'src2' --></span> |
- | + | <span class="sc3"><span class="re1"><sourceFolder<span class="re2">></span></span></span>src2<span class="sc3"><span class="re1"></sourceFolder<span class="re2">></span></span></span> | |
- | then 'bannerFPS(${metaTheme})' is equal to 728--> | + | <span class="sc-1"><!-- set, or create, an output folder named 'bin-debug' --></span> |
- | <expression name="metaDataExp" value="concat('[SWF(backgroundColor="',0xFFFFFF, | + | <span class="sc3"><span class="re1"><outputFolder<span class="re2">></span></span></span>bin-debug<span class="sc3"><span class="re1"></outputFolder<span class="re2">></span></span></span> |
- | '",frameRate="',bannerFPS(${metaTheme}),'", width="', | + | |
- | bannerWidth(${metaTheme}),'",height="',bannerHeight(${metaTheme}), | + | <span class="sc-1"><!-- set, or create, various auto library folders --></span> |
- | '")]')" /> | + | <span class="sc3"><span class="re1"><autoLibFolder<span class="re2">></span></span></span>libs<span class="sc3"><span class="re1"></autoLibFolder<span class="re2">></span></span></span> |
- | + | <span class="sc3"><span class="re1"><autoLibFolder<span class="re2">></span></span></span>libs2<span class="sc3"><span class="re1"></autoLibFolder<span class="re2">></span></span></span> | |
- | </expressions> | + | <span class="sc3"><span class="re1"></folders<span class="re2">></span></span></span></pre></div></div> |
- | </ | + | <p><br /> |
- | + | </p> | |
- | + | <hr /> | |
- | + | <h2>sourceFolder</h2> | |
- | + | <p>When your project is created, FDT will create a source folder for you. | |
- | + | </p> | |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><folders<span class="re2">></span></span></span> | |
- | + | <span class="sc-1"><!-- set, or create, a source folder named 'src' --></span> | |
- | + | <span class="sc3"><span class="re1"><sourceFolder<span class="re2">></span></span></span>src<span class="sc3"><span class="re1"></sourceFolder<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></folders<span class="re2">></span></span></span></pre></div></div> | |
- | With 4.5, FDT extended the expressions syntax with two new expressions: 'replace' and 'replaceRegex'. Both of these allow you to replace the values of strings or variables. | + | <p><br /> |
- | + | <b>Arguments</b>: | |
- | < | + | </p> |
- | <!-- Create a variable (a collection of 'themes') that users can select and change--> | + | <ol><li><b>if</b> : A boolean value that determines if the folder is created. |
- | <variable name="metaTheme" label="Application Type | + | </li></ol> |
- | default="Leaderboard" type="enum('Leaderboard','Full Banner','Half Banner','Full Site')"/> | + | <p><br /> |
- | + | </p> | |
- | <expressions> | + | <hr /> |
- | + | <h2>outputFolder</h2> | |
- | <!-- This will create a new expression (variable) named 'postFileName'. | + | <p>When your project is created, FDT will preset your output folder for you. |
- | This expression will execute a regex computation on the variable ${projectName} | + | </p> |
- | and replace it. In this case it's replacing it with blank: ''. --> | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><folders<span class="re2">></span></span></span> |
- | <expression name=" | + | <span class="sc-1"><!-- set, or create, an output folder named 'bin-debug' --></span> |
- | + | <span class="sc3"><span class="re1"><outputFolder<span class="re2">></span></span></span>bin-debug<span class="sc3"><span class="re1"></outputFolder<span class="re2">></span></span></span> | |
- | + | <span class="sc3"><span class="re1"></folders<span class="re2">></span></span></span></pre></div></div> | |
- | <!-- This expression will scan the variable '${projectName}' and if it finds the value | + | <p><br /> |
- | + | <b>Arguments</b>: | |
- | <expression name=" | + | </p> |
- | + | <ol><li><b>if</b> : A boolean value that determines if the folder is created. | |
- | </expressions> | + | </li></ol> |
- | </ | + | <p><br /> |
- | + | </p> | |
- | + | <hr /> | |
- | + | <h2>autoLibFolder</h2> | |
- | + | <p>When your project is created, FDT will create an auto library folder for you. | |
- | + | </p> | |
- | + | <div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1"><folders<span class="re2">></span></span></span> | |
- | + | <span class="sc-1"><!-- set, or create, various auto library folders --></span> | |
- | The extensions tag is used internally by the team to add functionality to templates into the future. When this is developed, more information will added here. | + | <span class="sc3"><span class="re1"><autoLibFolder<span class="re2">></span></span></span>libs<span class="sc3"><span class="re1"></autoLibFolder<span class="re2">></span></span></span> |
- | + | <span class="sc3"><span class="re1"></folders<span class="re2">></span></span></span></pre></div></div> | |
- | + | <p><b>Arguments</b>: | |
- | + | </p> | |
- | + | <ol><li><b>if</b> : A boolean value that determines if the folder is created. | |
- | + | </li></ol> | |
- | + | <p><br /> | |
- | + | </p> | |
- | This tag, and its descendants, is used to define properties of special folders in your project. This is where you define which folders are source folder(s), your output folder, and auto library folder(s). If the folder referenced here doesn't exist when the project is created, FDT will create it. | + | <hr /> |
- | + | <h1>Libraries</h1> | |
- | < | + | <h2>libraries</h2> |
- | <folders> | + | <p>Use this tag to define a particular .SWC or .ANE to be added to your class path upon template generation. .SWC and .ANE locations are relative to your project root. |
- | <!-- set, or create, a source folder named 'src' --> | + | </p> |
- | <sourceFolder>src</sourceFolder> | + | <ul><li><i>note</i>: When using SWCs, this tag is best implemented when using linked resources; otherwise, we suggest placing your .SWCs inside of an Auto Library Folder. |
- | <!-- set, or create, a source folder named 'src2' --> | + | </li></ul> |
- | <sourceFolder>src2</sourceFolder> | + | <ul><li><i>note</i>: The <div style="border: solid red 1px; padding: .5em;"><p>Invalid language.</p><p>You need to specify a language like this: <samp><source lang="html4strict">...</source></samp></p><p>Supported languages for syntax highlighting:</p><p style="padding: 0em 1em;"><samp>4cs</samp>, <samp>abap</samp>, <samp>actionscript</samp>, <samp>actionscript3</samp>, <samp>ada</samp>, <samp>apache</samp>, <samp>applescript</samp>, <samp>apt_sources</samp>, <samp>asm</samp>, <samp>asp</samp>, <samp>autoconf</samp>, <samp>autohotkey</samp>, <samp>autoit</samp>, <samp>avisynth</samp>, <samp>awk</samp>, <samp>bash</samp>, <samp>basic4gl</samp>, <samp>bf</samp>, <samp>bibtex</samp>, <samp>blitzbasic</samp>, <samp>bnf</samp>, <samp>boo</samp>, <samp>c</samp>, <samp>c_mac</samp>, <samp>caddcl</samp>, <samp>cadlisp</samp>, <samp>cfdg</samp>, <samp>cfm</samp>, <samp>chaiscript</samp>, <samp>cil</samp>, <samp>clojure</samp>, <samp>cmake</samp>, <samp>cobol</samp>, <samp>cpp</samp>, <samp>cpp-qt</samp>, <samp>csharp</samp>, <samp>css</samp>, <samp>cuesheet</samp>, <samp>d</samp>, <samp>dcs</samp>, <samp>delphi</samp>, <samp>diff</samp>, <samp>div</samp>, <samp>dos</samp>, <samp>dot</samp>, <samp>ecmascript</samp>, <samp>eiffel</samp>, <samp>email</samp>, <samp>erlang</samp>, <samp>fo</samp>, <samp>fortran</samp>, <samp>freebasic</samp>, <samp>fsharp</samp>, <samp>gambas</samp>, <samp>gdb</samp>, <samp>genero</samp>, <samp>genie</samp>, <samp>gettext</samp>, <samp>glsl</samp>, <samp>gml</samp>, <samp>gnuplot</samp>, <samp>groovy</samp>, <samp>gwbasic</samp>, <samp>haskell</samp>, <samp>hicest</samp>, <samp>hq9plus</samp>, <samp>html4strict</samp>, <samp>icon</samp>, <samp>idl</samp>, <samp>ini</samp>, <samp>inno</samp>, <samp>intercal</samp>, <samp>io</samp>, <samp>j</samp>, <samp>java</samp>, <samp>java5</samp>, <samp>javascript</samp>, <samp>jquery</samp>, <samp>kixtart</samp>, <samp>klonec</samp>, <samp>klonecpp</samp>, <samp>latex</samp>, <samp>lisp</samp>, <samp>locobasic</samp>, <samp>logtalk</samp>, <samp>lolcode</samp>, <samp>lotusformulas</samp>, <samp>lotusscript</samp>, <samp>lscript</samp>, <samp>lsl2</samp>, <samp>lua</samp>, <samp>m68k</samp>, <samp>magiksf</samp>, <samp>make</samp>, <samp>mapbasic</samp>, <samp>matlab</samp>, <samp>mirc</samp>, <samp>mmix</samp>, <samp>modula2</samp>, <samp>modula3</samp>, <samp>mpasm</samp>, <samp>mxml</samp>, <samp>mysql</samp>, <samp>newlisp</samp>, <samp>nsis</samp>, <samp>oberon2</samp>, <samp>objc</samp>, <samp>ocaml</samp>, <samp>ocaml-brief</samp>, <samp>oobas</samp>, <samp>oracle11</samp>, <samp>oracle8</samp>, <samp>oxygene</samp>, <samp>oz</samp>, <samp>pascal</samp>, <samp>pcre</samp>, <samp>per</samp>, <samp>perl</samp>, <samp>perl6</samp>, <samp>pf</samp>, <samp>php</samp>, <samp>php-brief</samp>, <samp>pic16</samp>, <samp>pike</samp>, <samp>pixelbender</samp>, <samp>plsql</samp>, <samp>postgresql</samp>, <samp>povray</samp>, <samp>powerbuilder</samp>, <samp>powershell</samp>, <samp>progress</samp>, <samp>prolog</samp>, <samp>properties</samp>, <samp>providex</samp>, <samp>purebasic</samp>, <samp>python</samp>, <samp>q</samp>, <samp>qbasic</samp>, <samp>rails</samp>, <samp>rebol</samp>, <samp>reg</samp>, <samp>robots</samp>, <samp>rpmspec</samp>, <samp>rsplus</samp>, <samp>ruby</samp>, <samp>sas</samp>, <samp>scala</samp>, <samp>scheme</samp>, <samp>scilab</samp>, <samp>sdlbasic</samp>, <samp>smalltalk</samp>, <samp>smarty</samp>, <samp>sql</samp>, <samp>systemverilog</samp>, <samp>tcl</samp>, <samp>teraterm</samp>, <samp>text</samp>, <samp>thinbasic</samp>, <samp>tsql</samp>, <samp>typoscript</samp>, <samp>unicon</samp>, <samp>vala</samp>, <samp>vb</samp>, <samp>vbnet</samp>, <samp>verilog</samp>, <samp>vhdl</samp>, <samp>vim</samp>, <samp>visualfoxpro</samp>, <samp>visualprolog</samp>, <samp>whitespace</samp>, <samp>whois</samp>, <samp>winbatch</samp>, <samp>xbasic</samp>, <samp>xml</samp>, <samp>xorg_conf</samp>, <samp>xpp</samp>, <samp>z80</samp></p></div> |
- | <!-- set, or create, an output folder named 'bin-debug' --> | + | </li></ul> |
- | <outputFolder>bin-debug</outputFolder> | + | |
- | + | ||
- | <!-- set, or create, various auto library folders --> | + | |
- | <autoLibFolder>libs</autoLibFolder> | + | |
- | <autoLibFolder>libs2</autoLibFolder> | + | |
- | </folders> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | When your project is created, FDT will create a source folder for you. | + | |
- | + | ||
- | < | + | |
- | <folders> | + | |
- | <!-- set, or create, a source folder named 'src' --> | + | |
- | <sourceFolder>src</sourceFolder> | + | |
- | </folders> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | When your project is created, FDT will preset your output folder for you. | + | |
- | + | ||
- | < | + | |
- | <folders> | + | |
- | <!-- set, or create, an output folder named 'bin-debug' --> | + | |
- | <outputFolder>bin-debug</outputFolder> | + | |
- | </folders> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | When your project is created, FDT will create an auto library folder for you. | + | |
- | + | ||
- | < | + | |
- | <folders> | + | |
- | <!-- set, or create, various auto library folders --> | + | |
- | <autoLibFolder>libs</autoLibFolder> | + | |
- | </folders> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | Use this tag to define a particular .SWC or .ANE to be added to your class path upon template generation. .SWC and .ANE locations are relative to your project root. | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | + | ||
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | < | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + |
Revision as of 15:45, 27 February 2012
With FDT 4.2, the FDT team greatly expanded project templates and the syntax available in the description.xml.
Contents |
Template Properties
description
Use this tag to add a text description to your template. This will appear in the text area below the template selector. You can even add in variables into your description and update the user about the current selection.
<span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"htmlDesc"</span> <span class="re0">value</span>=<span class="st0">"if(${htmlTemplate},</span> <span class="sc3">'This HTML wrapper will create a simple HTML page with your SWF embedded in it.',' ')"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><description<span class="re2">></span></span></span> This template will create a project named '${projectName}' which contains only the basic libraries to develop and compile a pure AS3 project.${newline}${htmlDesc} <span class="sc3"><span class="re1"></description<span class="re2">></span></span></span>
- note: Use the ${newline} keyword to create a line break in your descriptions. In the above example, if the users sets true htmlDesc then the additional text will be added, on a new line, to the description.
name
The name of your template as it appears in the new project wizard.
<span class="sc3"><span class="re1"><name<span class="re2">></span></span></span>AS3<span class="sc3"><span class="re1"></name<span class="re2">></span></span></span>
version
FDT uses this element to keep track of the version for the template in case it is to be updated.
<span class="sc3"><span class="re1"><version<span class="re2">></span></span></span>2.0<span class="sc3"><span class="re1"></version<span class="re2">></span></span></span>
projectType
Each template needs to have its projectType defined. The project type is what determines which SDK &.SWCs are automatically added to your source path, your runtime, player and compiler arguments.
The project types are located in the projectTypes folder within the FDT folder.
Variables
variables
The variables tag is what defines templates in FDT 4.2 and later. When a template implements this element, you'll be able to create UI elements that allow you to customize your project before completion. Your template can only have one variables element. FDT will read the first and ignore any following variables elements.
<span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Template Options"</span><span class="re2">></span><span class="re1"></primaryGroup<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span>
primaryGroup
When you create a variables element, you'll need to have a primaryGroup descendant element. Similar to variables, primaryGroup can only appear once inside of a variables element.
<span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Template Options"</span><span class="re2">></span></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addMetaData"</span> <span class="re0">label</span>=<span class="st0">"Add Metadata"</span> <span class="re0">default</span>=<span class="st0">"true"</span></span> <span class="sc3"> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"><group</span> <span class="re0">label</span>=<span class="st0">"Project Setup"</span><span class="re2">></span></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addFla"</span> <span class="re0">label</span>=<span class="st0">"Add .fla"</span> <span class="re0">default</span>=<span class="st0">"true"</span></span> <span class="sc3"> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"htmlTemplate"</span> <span class="re0">label</span>=<span class="st0">"Include HTML Wrapper"</span></span> <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></group<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></primaryGroup<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span>
Arguments:
- label : The label description that will appear at the top of the template variables UI section within the New Flash Project Wizard.
- description : An optional description for documentation purposes.
- note: Other arguments, such as 'enableIf', are ignored.
group
Groups are used to organize similar variables together. They are also used to create popup buttons that will open a new window containing more UI elements. Groups can have more groups nested within them.
<span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Options"</span> <span class="re0">description</span>=<span class="st0">"My Template Variables"</span> <span class="re2">></span></span> <span class="sc3"><span class="re1"><group</span> <span class="re0">label</span>=<span class="st0">"Unit Testing"</span><span class="re2">></span></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addUnitTesting"</span> <span class="re0">label</span>=<span class="st0">"Add Unit Testing"</span></span> <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> <span class="sc-1"><!-- Create a popupButton that will open these UI variables in a new window --></span> <span class="sc3"><span class="re1"><group</span> <span class="re0">label</span>=<span class="st0">"More..."</span> <span class="re0">style</span>=<span class="st0">"popupButton"</span><span class="re2">></span></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"testFolderName"</span> <span class="re0">label</span>=<span class="st0">"Test Folder Name"</span></span> <span class="sc3"> <span class="re0">default</span>=<span class="st0">"test-src"</span> <span class="re0">type</span>=<span class="st0">"string"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addExample"</span> <span class="re0">label</span>=<span class="st0">"Add Unit Test Example"</span></span> <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addJar"</span> <span class="re0">label</span>=<span class="st0">"Include flexUnitTasks.jar"</span></span> <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></group<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></group<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></primaryGroup<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span>
Arguments:
- label : The label description that will appear at the top group.
- description : An optional description for documentation purposes.
- enableIf : A boolean that can disable and enable the UI variables within the group.
- style : Use this to set if the group is to be a popup window. Possible values are popupButton and hyperlink.
variable
The most powerful part of project templates are the UI variables you can create. Each variable element you create will represent itself as an interactive UI component (e.g. text input, combo box, radio button). The value of the variable will be evaluated as you change it while configuring your template.
If you reference the variable in any files (ActionScript,XML,JavaScript,HTML....) and you choose to process those files (within a contentCreation element) the variable will be replaced with whatever value you have assigned it.
To reference a variable use a dollar sign and brackets, '${}', with your variable name between the brackets.
<span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Options"</span><span class="re2">></span></span> <span class="sc-1"><!-- This variable is being used to determine to add Metadata or not--></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addMetaData"</span> <span class="re0">label</span>=<span class="st0">"Add Metadata"</span> <span class="re0">default</span>=<span class="st0">"true"</span></span> <span class="sc3"> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> <span class="sc-1"><!-- This variable is being used to setup the base class of my ActionScript file. </span> <span class="sc-1"> In my ActionScript files'${classExtends}' will be replaced with whatever</span> <span class="sc-1"> value it is assigned here --></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"classExtends"</span> <span class="re0">label</span>=<span class="st0">"Base Class:"</span> <span class="re0">default</span>=<span class="st0">"Sprite"</span></span> <span class="sc3"> <span class="re0">type</span>=<span class="st0">"enum('Sprite','MovieClip')"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></primaryGroup<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span>
Arguments:
- name : To reuse your variable, you'll need to be able to reference it either within the template itself, or in an external file that will be processed ( variables replaced ).
- label : What will be displayed to the users within the template GUI.
- default : The starting value for the variable.
- type : Use this to set the UI component (e.g. text input, combo box, radio button).
- description : An optional description for documentation purposes.
- enableIf : A boolean that can disable and enable the variable.
When using the type attribute here are some examples of UI components you can create:
- enum('value 1','value 2','value 3',...): This will create a combo box or radio button set of predefined values. The default for enum will be a combo box. To create radio buttons, add a style=radio attribute.
- color: This will create a button that will display a color hex value and allow you to open the color picker.
- int('minimum value','maximum value','increment value'): This will create a text input for number values based on the define range.
- float: Creates a text input for float values.
- string: A text input.
- string('value 1','value 2',...): A text input with a combo box that allows for preset (but editable) values.
- boolean: This will create a checkbox that will toggle the variable from true to false.
- file: This will create a text input and browse button that will point to a specific file. There is also the option to create file filters, e.g. type="file('png','gif')"
- folder: This will create a text input and browse button for a specific folder. There is also the option to create file filters, e.g. type="file('png','gif')"
hyperlink
Within group elements, you can add a hyperlink which will open your browser and navigate to a particular URL.
<span class="sc3"><span class="re1"><variables<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><primaryGroup</span> <span class="re0">label</span>=<span class="st0">"Template Options"</span><span class="re2">></span></span> <span class="sc3"><span class="re1"><group<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"addUnitTesting"</span> <span class="re0">label</span>=<span class="st0">"Add Unit Testing"</span></span> <span class="sc3"> <span class="re0">default</span>=<span class="st0">"false"</span> <span class="re0">type</span>=<span class="st0">"boolean"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"><hyperlink</span> <span class="re0">label</span>=<span class="st0">"More About Unit Testing"</span> <span class="re0">target</span>=<span class="st0">"http://www.flexunit.com..."</span> </span> <span class="sc3"> <span class="re0">style</span>=<span class="st0">"hyperlink"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></group<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></primaryGroup<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></variables<span class="re2">></span></span></span>
Arguments:
- label : The text that will appear for the button / hyperlink.
- description : An optional description for documentation purposes.
- enableIf : A boolean that can disable and enable the link.
- style : Use this to set the UI as a button or an HTML style link. Possible values are popupButton and hyperlink.
Expressions
Overview
Expressions allow you to create more variables (not associated with any UI), if/else statements, hashmaps(maps) and concatenation expressions.
There are different ways of using expressions.
Simple Assignments
<span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"sourceFolder"</span> <span class="re0">value</span>=<span class="st0">"src"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span>
Arithmetic Operations
<span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"number"</span> <span class="re0">value</span>=<span class="st0">"8*2"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span>
Boolean Operations
<span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> <span class="sc-1"><!--using operator symbols such as '||' and '&&' --></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"allUnitTestingSamples"</span> </span> <span class="sc3"> <span class="re0">value</span>=<span class="st0">"${addExample} && ${addUnitTesting} && ${addCIExample}"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"anyExampleChosen"</span> <span class="re0">value</span>=<span class="st0">"${addExample} || ${addCIExample}"</span><span class="re2">/></span></span> <span class="sc-1"><!--using operator expressions such as 'or()' and 'and()' --></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"allUnitTestingSamples2"</span> </span> <span class="sc3"> <span class="re0">value</span>=<span class="st0">"and(${addExample}, ${addUnitTesting}, ${addCIExample}"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"anyExampleChosen2"</span> <span class="re0">value</span>=<span class="st0">"or(${addExample} ,${addCIExample})"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span>
- note: Because of how Ant works, you need to use the '&&' syntax when you want to use '&&'.
- note: Expressions 'and(value 1, value 2,...)' and 'or(value 1, value 2,...)' can accept any number of arguments.
String Operations
<span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"var"</span> <span class="re0">value</span>=<span class="st0">" wonderful "</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"myExp"</span> <span class="re0">value</span>=<span class="st0">"concat('hello ',${var},' world')"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"myExp2"</span> <span class="re2">></span></span>hello wonderful world<span class="sc3"><span class="re1"></expression<span class="re2">></span></span></span> <span class="sc-1"><!--both output 'hello wonderful world' --></span> <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span>
- note: 'concat(value 1, value 2, value 3,...)' can accept any number of arguments.
expressions
The expressions element is used as a placeholder for your expressions. It can only appear once in your description.xml.
expression
Inside of your expressions tag you can place individual expressions and maps. An expression can be either a simple variable creation or an evaluation. Examples include:
- if('boolean','use this value if true','use this value if false')
- concat(value 1, value 2, value 3,...)
- and(value 1, value 2, ...)
- or(value 1, value 2, ...)
- true
- false
<span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> <span class="sc-1"><!-- simple variable declaration--></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"sourceFolder"</span> <span class="re0">value</span>=<span class="st0">"src"</span> <span class="re2">/></span></span> <span class="sc-1"><!-- using the concat() expression--></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"metaDataExp"</span> <span class="re0">value</span>=<span class="st0">"concat('[SWF(backgroundColor="',0xFFFFFF,</span> <span class="sc3">'",frameRate="',bannerFPS(${metaTheme}),'", width="',</span> <span class="sc3">bannerWidth(${metaTheme}),'",height="',bannerHeight(${metaTheme}),</span> <span class="sc3">'")]')"</span> <span class="re2">/></span></span> <span class="sc-1"><!-- using an if() expression--></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"htmlDesc"</span></span> <span class="sc3"> <span class="re0">value</span>=<span class="st0">"if(${htmlTemplate},</span> <span class="sc3"> 'This HTML wrapper will create a simple HTML page with </span> <span class="sc3"> your SWF embedded in it.',' ')"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span>
map
A map (hashmap, hash table, dictionary) is a way to create a collection of key value pairs. This is helpful when creating themes or predefined sets. Whenever a particular theme or set is selected, various variables and values can be changed throughout your template.
<span class="sc-1"><!-- Create a variable (a collection of 'themes') that users can select and change--></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"metaTheme"</span> <span class="re0">label</span>=<span class="st0">"Application Type"</span></span> <span class="sc3"><span class="re0">default</span>=<span class="st0">"Leaderboard"</span> <span class="re0">type</span>=<span class="st0">"enum('Leaderboard','Full Banner','Half Banner','Full Site')"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> <span class="sc-1"><!-- Create some maps associated with the value of 'metaTheme' --></span> <span class="sc3"><span class="re1"><map</span> <span class="re0">name</span>=<span class="st0">"bannerWidth"</span> <span class="re2">></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Leaderboard"</span> <span class="re0">value</span>=<span class="st0">"'728'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Banner"</span> <span class="re0">value</span>=<span class="st0">"'468'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Half Banner"</span> <span class="re0">value</span>=<span class="st0">"'234'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Site"</span> <span class="re0">value</span>=<span class="st0">"'800'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"></map<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><map</span> <span class="re0">name</span>=<span class="st0">"bannerHeight"</span> <span class="re2">></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Leaderboard"</span> <span class="re0">value</span>=<span class="st0">"'90'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Banner"</span> <span class="re0">value</span>=<span class="st0">"'60'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Half Banner"</span> <span class="re0">value</span>=<span class="st0">"'60'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Site"</span> <span class="re0">value</span>=<span class="st0">"'600'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"></map<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><map</span> <span class="re0">name</span>=<span class="st0">"bannerFPS"</span> <span class="re2">></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Leaderboard"</span> <span class="re0">value</span>=<span class="st0">"'22'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Banner"</span> <span class="re0">value</span>=<span class="st0">"'22'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Half Banner"</span> <span class="re0">value</span>=<span class="st0">"'22'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><entry</span> <span class="re0">key</span>=<span class="st0">"Full Site"</span> <span class="re0">value</span>=<span class="st0">"'60'"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"></map<span class="re2">></span></span></span> <span class="sc-1"><!-- Use the maps and pass to them, as a key, the theme you chose. </span> <span class="sc-1"> E.g if 'metaTheme' is equal to 'Leaderboard', </span> <span class="sc-1">then 'bannerFPS(${metaTheme})' is equal to 728--></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"metaDataExp"</span> <span class="re0">value</span>=<span class="st0">"concat('[SWF(backgroundColor="',0xFFFFFF,</span> <span class="sc3">'",frameRate="',bannerFPS(${metaTheme}),'", width="',</span> <span class="sc3">bannerWidth(${metaTheme}),'",height="',bannerHeight(${metaTheme}),</span> <span class="sc3">'")]')"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span>
Replace
With 4.5, FDT extended the expressions syntax with two new expressions: 'replace' and 'replaceRegex'. Both of these allow you to replace the values of strings or variables.
<span class="sc-1"><!-- Create a variable (a collection of 'themes') that users can select and change--></span> <span class="sc3"><span class="re1"><variable</span> <span class="re0">name</span>=<span class="st0">"metaTheme"</span> <span class="re0">label</span>=<span class="st0">"Application Type"</span></span> <span class="sc3"><span class="re0">default</span>=<span class="st0">"Leaderboard"</span> <span class="re0">type</span>=<span class="st0">"enum('Leaderboard','Full Banner','Half Banner','Full Site')"</span><span class="re2">/></span></span> <span class="sc3"><span class="re1"><expressions<span class="re2">></span></span></span> <span class="sc-1"><!-- This will create a new expression (variable) named 'postFileName'. </span> <span class="sc-1">This expression will execute a regex computation on the variable ${projectName} </span> <span class="sc-1">and replace it. In this case it's replacing it with blank: ''. --></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"postFileName"</span></span> <span class="sc3"> <span class="re0">value</span>=<span class="st0">"replaceRegex(${projectName}, '([^\w]+)', '')"</span> <span class="re2">/></span></span> <span class="sc-1"><!-- This expression will scan the variable '${projectName}' and if it finds the value</span> <span class="sc-1"> 'Joe', it will replace it with 'Bob' --></span> <span class="sc3"><span class="re1"><expression</span> <span class="re0">name</span>=<span class="st0">"postFileName"</span></span> <span class="sc3"> <span class="re0">value</span>=<span class="st0">"replace(${projectName}, 'Joe', 'Bob')"</span> <span class="re2">/></span></span> <span class="sc3"><span class="re1"></expressions<span class="re2">></span></span></span>
Arguments:
- name : The reference (variable name) of the expression. Use this to reference the expression elsewhere in the template or your files.
- value : Three values: replaceRegex([the variable or string you'd like to evaluate],[what to look for],[what to replace if found])
Extensions
The extensions tag is used internally by the team to add functionality to templates into the future. When this is developed, more information will added here.
Folders
folders
This tag, and its descendants, is used to define properties of special folders in your project. This is where you define which folders are source folder(s), your output folder, and auto library folder(s). If the folder referenced here doesn't exist when the project is created, FDT will create it.
<span class="sc3"><span class="re1"><folders<span class="re2">></span></span></span> <span class="sc-1"><!-- set, or create, a source folder named 'src' --></span> <span class="sc3"><span class="re1"><sourceFolder<span class="re2">></span></span></span>src<span class="sc3"><span class="re1"></sourceFolder<span class="re2">></span></span></span> <span class="sc-1"><!-- set, or create, a source folder named 'src2' --></span> <span class="sc3"><span class="re1"><sourceFolder<span class="re2">></span></span></span>src2<span class="sc3"><span class="re1"></sourceFolder<span class="re2">></span></span></span> <span class="sc-1"><!-- set, or create, an output folder named 'bin-debug' --></span> <span class="sc3"><span class="re1"><outputFolder<span class="re2">></span></span></span>bin-debug<span class="sc3"><span class="re1"></outputFolder<span class="re2">></span></span></span> <span class="sc-1"><!-- set, or create, various auto library folders --></span> <span class="sc3"><span class="re1"><autoLibFolder<span class="re2">></span></span></span>libs<span class="sc3"><span class="re1"></autoLibFolder<span class="re2">></span></span></span> <span class="sc3"><span class="re1"><autoLibFolder<span class="re2">></span></span></span>libs2<span class="sc3"><span class="re1"></autoLibFolder<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></folders<span class="re2">></span></span></span>
sourceFolder
When your project is created, FDT will create a source folder for you.
<span class="sc3"><span class="re1"><folders<span class="re2">></span></span></span> <span class="sc-1"><!-- set, or create, a source folder named 'src' --></span> <span class="sc3"><span class="re1"><sourceFolder<span class="re2">></span></span></span>src<span class="sc3"><span class="re1"></sourceFolder<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></folders<span class="re2">></span></span></span>
Arguments:
- if : A boolean value that determines if the folder is created.
outputFolder
When your project is created, FDT will preset your output folder for you.
<span class="sc3"><span class="re1"><folders<span class="re2">></span></span></span> <span class="sc-1"><!-- set, or create, an output folder named 'bin-debug' --></span> <span class="sc3"><span class="re1"><outputFolder<span class="re2">></span></span></span>bin-debug<span class="sc3"><span class="re1"></outputFolder<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></folders<span class="re2">></span></span></span>
Arguments:
- if : A boolean value that determines if the folder is created.
autoLibFolder
When your project is created, FDT will create an auto library folder for you.
<span class="sc3"><span class="re1"><folders<span class="re2">></span></span></span> <span class="sc-1"><!-- set, or create, various auto library folders --></span> <span class="sc3"><span class="re1"><autoLibFolder<span class="re2">></span></span></span>libs<span class="sc3"><span class="re1"></autoLibFolder<span class="re2">></span></span></span> <span class="sc3"><span class="re1"></folders<span class="re2">></span></span></span>
Arguments:
- if : A boolean value that determines if the folder is created.
Libraries
libraries
Use this tag to define a particular .SWC or .ANE to be added to your class path upon template generation. .SWC and .ANE locations are relative to your project root.
- note: When using SWCs, this tag is best implemented when using linked resources; otherwise, we suggest placing your .SWCs inside of an Auto Library Folder.
- note: The
Invalid language.
You need to specify a language like this: <samp><source lang="html4strict">...</source></samp>
Supported languages for syntax highlighting:
<samp>4cs</samp>, <samp>abap</samp>, <samp>actionscript</samp>, <samp>actionscript3</samp>, <samp>ada</samp>, <samp>apache</samp>, <samp>applescript</samp>, <samp>apt_sources</samp>, <samp>asm</samp>, <samp>asp</samp>, <samp>autoconf</samp>, <samp>autohotkey</samp>, <samp>autoit</samp>, <samp>avisynth</samp>, <samp>awk</samp>, <samp>bash</samp>, <samp>basic4gl</samp>, <samp>bf</samp>, <samp>bibtex</samp>, <samp>blitzbasic</samp>, <samp>bnf</samp>, <samp>boo</samp>, <samp>c</samp>, <samp>c_mac</samp>, <samp>caddcl</samp>, <samp>cadlisp</samp>, <samp>cfdg</samp>, <samp>cfm</samp>, <samp>chaiscript</samp>, <samp>cil</samp>, <samp>clojure</samp>, <samp>cmake</samp>, <samp>cobol</samp>, <samp>cpp</samp>, <samp>cpp-qt</samp>, <samp>csharp</samp>, <samp>css</samp>, <samp>cuesheet</samp>, <samp>d</samp>, <samp>dcs</samp>, <samp>delphi</samp>, <samp>diff</samp>, <samp>div</samp>, <samp>dos</samp>, <samp>dot</samp>, <samp>ecmascript</samp>, <samp>eiffel</samp>, <samp>email</samp>, <samp>erlang</samp>, <samp>fo</samp>, <samp>fortran</samp>, <samp>freebasic</samp>, <samp>fsharp</samp>, <samp>gambas</samp>, <samp>gdb</samp>, <samp>genero</samp>, <samp>genie</samp>, <samp>gettext</samp>, <samp>glsl</samp>, <samp>gml</samp>, <samp>gnuplot</samp>, <samp>groovy</samp>, <samp>gwbasic</samp>, <samp>haskell</samp>, <samp>hicest</samp>, <samp>hq9plus</samp>, <samp>html4strict</samp>, <samp>icon</samp>, <samp>idl</samp>, <samp>ini</samp>, <samp>inno</samp>, <samp>intercal</samp>, <samp>io</samp>, <samp>j</samp>, <samp>java</samp>, <samp>java5</samp>, <samp>javascript</samp>, <samp>jquery</samp>, <samp>kixtart</samp>, <samp>klonec</samp>, <samp>klonecpp</samp>, <samp>latex</samp>, <samp>lisp</samp>, <samp>locobasic</samp>, <samp>logtalk</samp>, <samp>lolcode</samp>, <samp>lotusformulas</samp>, <samp>lotusscript</samp>, <samp>lscript</samp>, <samp>lsl2</samp>, <samp>lua</samp>, <samp>m68k</samp>, <samp>magiksf</samp>, <samp>make</samp>, <samp>mapbasic</samp>, <samp>matlab</samp>, <samp>mirc</samp>, <samp>mmix</samp>, <samp>modula2</samp>, <samp>modula3</samp>, <samp>mpasm</samp>, <samp>mxml</samp>, <samp>mysql</samp>, <samp>newlisp</samp>, <samp>nsis</samp>, <samp>oberon2</samp>, <samp>objc</samp>, <samp>ocaml</samp>, <samp>ocaml-brief</samp>, <samp>oobas</samp>, <samp>oracle11</samp>, <samp>oracle8</samp>, <samp>oxygene</samp>, <samp>oz</samp>, <samp>pascal</samp>, <samp>pcre</samp>, <samp>per</samp>, <samp>perl</samp>, <samp>perl6</samp>, <samp>pf</samp>, <samp>php</samp>, <samp>php-brief</samp>, <samp>pic16</samp>, <samp>pike</samp>, <samp>pixelbender</samp>, <samp>plsql</samp>, <samp>postgresql</samp>, <samp>povray</samp>, <samp>powerbuilder</samp>, <samp>powershell</samp>, <samp>progress</samp>, <samp>prolog</samp>, <samp>properties</samp>, <samp>providex</samp>, <samp>purebasic</samp>, <samp>python</samp>, <samp>q</samp>, <samp>qbasic</samp>, <samp>rails</samp>, <samp>rebol</samp>, <samp>reg</samp>, <samp>robots</samp>, <samp>rpmspec</samp>, <samp>rsplus</samp>, <samp>ruby</samp>, <samp>sas</samp>, <samp>scala</samp>, <samp>scheme</samp>, <samp>scilab</samp>, <samp>sdlbasic</samp>, <samp>smalltalk</samp>, <samp>smarty</samp>, <samp>sql</samp>, <samp>systemverilog</samp>, <samp>tcl</samp>, <samp>teraterm</samp>, <samp>text</samp>, <samp>thinbasic</samp>, <samp>tsql</samp>, <samp>typoscript</samp>, <samp>unicon</samp>, <samp>vala</samp>, <samp>vb</samp>, <samp>vbnet</samp>, <samp>verilog</samp>, <samp>vhdl</samp>, <samp>vim</samp>, <samp>visualfoxpro</samp>, <samp>visualprolog</samp>, <samp>whitespace</samp>, <samp>whois</samp>, <samp>winbatch</samp>, <samp>xbasic</samp>, <samp>xml</samp>, <samp>xorg_conf</samp>, <samp>xpp</samp>, <samp>z80</samp>