Pages: [1]
  Print  
Author Topic: EXAMPLE: Gaia + Flex Builder 3 ANT Script for Compiling Projects  (Read 3218 times)
panaewa
Gaia Novice
*
Posts: 5


WWW
« on: September 26, 2009, 11:36:08 AM »

Hello, i've created a ANT build to compile Gaia proyect with Eclipse. The blog is spanish, but you can download the file build.zip and explore.

http://blog.desarrolloflash.com/2009/09/gaia-framework-ant/

« Last Edit: September 26, 2009, 12:20:37 PM by steven » Logged
panaewa
Gaia Novice
*
Posts: 5


WWW
« Reply #1 on: October 25, 2009, 05:33:48 AM »

I've created a new version. This include pages class creation, and Pages.as class ( static reference).
 
Spanish: http://blog.desarrolloflash.com/2009/10/gaia-framework-ant-parte-2/
English (Google translate, sorry): http://blog.desarrolloflash.com/2009/10/gaia-framework-ant-parte-2/
Logged
panaewa
Gaia Novice
*
Posts: 5


WWW
« Reply #2 on: November 09, 2009, 09:45:37 AM »

I' ve added a new version of the project, now you donīt need adobe flash for create a gaia web site. Added seo scaffolding too.

Espaņol: http://blog.desarrolloflash.com/2009/11/gaia-framework-creacion-y-compilacion-de-un-proyecto-sin-flash/
Ingles: http://blog.desarrolloflash.com/en/2009/11/gaia-framework-creacion-y-compilacion-de-un-proyecto-sin-flash/
Logged
kyoji
Gaia Novice
*
Posts: 3


kyoji2
WWW
« Reply #3 on: January 06, 2010, 04:47:30 AM »

Awesome job! I like it very much.
My suggestion is to add a function for "update bytes in xml"  Grin
Logged
panaewa
Gaia Novice
*
Posts: 5


WWW
« Reply #4 on: February 15, 2010, 02:07:40 PM »

if you add this code to the last build file, you can execute refresh-site-xml target, and the site.xml page tags update him bytes and seoBytes attribute.

you can download the new project from http://blog.desarrolloflash.com


This code only update the page tag, if i can the next weekend upload a build.xml file with the proper task to update assets.
Thanx kyoji

Code:
<target name="refresh-site-xml">
<echo message="refresh-site-xml"/>
    <update-page-site-xml/>
</target>

<macrodef name="update-bytes-page">
<attribute name="input" default="home"/>
<attribute name="bytes" default="0"/>
<attribute name="seoBytes" default="0"/>
<sequential>
<echo message="@{input}"/>
<if>
<equals arg1="${seoBytes}" arg2="0" />
<then>
<xmltask  source="${bin}/site.xml" dest="${bin}/site3.xml">
<attr path="//page[@id='@{input}']" attr="bytes" value="@{bytes}"/>
<attr path="//page[@id='@{input}']" attr="seoBytes" remove="true"/>
</xmltask>
</then>
<else>
<xmltask  source="${bin}/site.xml" dest="${bin}/site3.xml">
<attr path="//page[@id='@{input}']" attr="bytes" value="@{bytes}"/>
<attr path="//page[@id='@{input}']" attr="seoBytes" value="@{seoBytes}"/>
</xmltask>
</else>
</if>
<copy file="${bin}/site3.xml" tofile="${bin}/site.xml"
overwrite="true"/>
<delete file="${bin}/site3.xml"/>
</sequential>
</macrodef>

<macrodef name="update-page-site-xml">
<sequential>
<xmltask source="${bin}/site.xml" dest="${bin}/site2.xml">
<call path="//page">
<param name="swffile" path="@src"/>
<param name="htmlfile" path="@seo" default="false"/>
<param name="ident" path="@id" default="false"/>
<actions>
<var name="branch" value="" unset="true"/>
<var name="existSwf" value="" unset="true"/>
<var name="existHtmlSeo" value="" unset="true"/>
<var name="existHtmlId" value="" unset="true"/>
<var name="bytes" unset="true"/>
<var name="seoBytes" value="0" unset="true"/>
<available file="${bin}\@{swffile}" property="existSwf"/>
<available file="${bin}\@{htmlfile}.html" property="existHtmlSeo"/>
<available file="${bin}\@{ident}.html" property="existHtmlId"/>
<if>
<equals arg1="${existSwf}" arg2="true" />
<then>
<length file="${bin}/@{swffile}" property="bytes" />
<get-branch-page input="site" page="@{ident}"/>
<if>
<equals arg1="${existHtmlSeo}" arg2="true" />
<then>
<length file="${bin}/@{htmlfile}.html" property="seoBytes" />
</then>
<elseif>
<equals arg1="${existHtmlId}" arg2="true" />
  <then>
<length file="${bin}/@{ident}.html" property="seoBytes" />
  </then>
</elseif>
<else>
<var name="seoBytes" value="0"/>
</else>
</if>
<update-bytes-page input="@{ident}" bytes="${bytes}" seoBytes="${seoBytes}"/>
</then>
</if>
</actions>
</call>
</xmltask>
<delete file="${bin}/site2.xml"/>
</sequential>
</macrodef>
Logged
panaewa
Gaia Novice
*
Posts: 5


WWW
« Reply #5 on: March 10, 2010, 08:19:12 AM »

Static pages reference issue:

For solve the issue with the static page reference you need to change de "get-branch" macro for the next:
Code:
<macrodef name="get-branch">
<attribute name="input" default=""/>
<attribute name="parent" default=""/>
<sequential>
<echo message="get-branch: @{input} | @{parent}"/>
<xmltask source="${sitexml}">
<call path="@{input}/page">
<param name="class" path="@id"/>
<actions>
<var name="uppercase" unset="true"/>
<var name="lowercase" unset="true"/>
<var name="ruta" unset="true"/>
<var name="parentid" unset="true"/>
<uppercase property="uppercase" input="@{class}"/>
<lowercase property="lowercase" input="@{class}"/>
<drop-first-character property="ruta" input="@{parent}/${lowercase}"/>
<var name="pagesconst" value="${pagesconst}${line.separator}        public static const ${uppercase}:String = '${ruta}';"/>
<get-branch input="@{input}/page[@id='@{class}']" parent="@{parent}/${lowercase}"/>
</actions>
</call>
</xmltask>
</sequential>
</macrodef>
Logged
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc