Gaia Framework – ANT – Part 2

After making a couple of websites with their respective facebook’s applications, I managed to take a little time to create this post.

In the previous article we saw how to compile a project using ANT gaia, in this we will create the various pages of the site and the creation of Pages.as class, which contains a static reference to the various pages.

To create pages for gaia have to read the xml file as we saw in the previous article, and for each of the tags page, copy the file in the folder templates provided in the file downloads. This template is new and is a copy of which appears in the Gaia project, but is modified so that the substitution patterns matches the passed as parameters, besides the class has been included TransitionController, which will be in charge of managing transitions pages.

Everything we do this task using the create-pages provided build file
create-pages

	<target name="create-pages">
		<echo message="create-pages"/>
		<xmltask source="site.xml">
			<call path="//page">
				<param name="package" path="${gaia.pages.package}" default="pages"/>
				<param name="class" path="@id"/>
                                 <actions>
				  	<var name="fuppercase" unset="true"/>
				  	<first-uppercase property="fuppercase" input="@{class}"/>
					<copy file="${gaia.templates}/Page.as" tofile="${gaia.pages}/${fuppercase}Page.as"
						overwrite="false">
				        <filterchain>
				           <replacetokens>
							    <token key="PACKAGENAME"  value="@{package}"/>
							  	<token key="CLASSNAME"    value="${fuppercase}Page"/>
				           </replacetokens>
				        </filterchain>
					</copy>
				</actions>
			</call>
		</xmltask>
	</target>

To create the static reference page reread the site.xml file as static references contain the path of the branch, I created a recursive task that is responsible for making this get-branch . This time the base template file is StaticReferencePages.as

create-static-pages

	<target name="create-static-page">
		<echo message="create-static-page"/>
		<var name="pagesconst" value="//PageConstants"/>
		<get-branch input="site"/>
		<copy file="${gaia.templates}/StaticReferencePages.as" tofile="${gaia.pages}/Pages.as"
			overwrite="true">
	        <filterchain>
	           <replacetokens>
				    <token key="PACKAGENAME"  value="${gaia.pages.package}"/>
				  	<token key="PAGES"        value="${pagesconst}"/>
	           </replacetokens>
	        </filterchain>
		</copy>
	</target>

I have also included the task to compile the Preloader.

GaiaANT File
- Copy the files provided in the project root of Gaia.
- Be careful when replacing the files in templates Page.as and Preloader.as and PreloaderScaffold.as in pages, because if you made any changes to these these were removed.

This entry was posted in ANT, gaia and tagged , , . Bookmark the permalink.

3 Responses to Gaia Framework – ANT – Part 2

  1. Øivind says:

    Can you explain how you start the show.

    Do you start scaffolding a new project, then copy your files into the Gaia project files. Then import the project into Flex as a Flex project. And how do you select the files that need to be compiled in Flex? Do you still define that in the Flash IDE panel ?

    This is probably basic and can be deduced from your article, It would be nice if you start off simple and then go advanced.

    Thanks for your effort though!!!

  2. Pingback: Gaia Framework - Creación y compilacion de un proyecto sin Flash | Desarrollo Flash

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>