
{"id":1593,"date":"2010-09-29T09:00:19","date_gmt":"2010-09-29T08:00:19","guid":{"rendered":"http:\/\/www.matthijskamstra.nl\/blog\/?p=1593"},"modified":"2011-05-30T09:32:51","modified_gmt":"2011-05-30T08:32:51","slug":"fdt-and-ant-part-2","status":"publish","type":"post","link":"https:\/\/www.matthijskamstra.nl\/blog\/2010\/09\/29\/fdt-and-ant-part-2\/","title":{"rendered":"FDT and ANT &#8211; part 2"},"content":{"rendered":"<blockquote><p>Trying to build the ultimate build.xml in ANT: debug\/production zip ftp version &#8230; etc: will save a lot of keystrokes in FDT4<\/p><\/blockquote>\n<p>source: <a href=\"http:\/\/twitter.com\/MatthijsKamstra\/statuses\/25194997777\">http:\/\/twitter.com\/MatthijsKamstra\/statuses\/25194997777<\/a><\/p>\n<p>All the information about the ultimate build.xml can be found on the internet, so I will post the links and you can figure it out for yourself.<\/p>\n<p>I used the build.xml made by Jankees van Woezik (<a href=\"http:\/\/blog.base42.nl\">Base 42<\/a>) as the base of my ultimate ANT build file. You can read about it and download here: <a href=\"http:\/\/blog.base42.nl\/2009\/12\/11\/my-workflow-with-ant-and-fdt\/\">My workflow with ANT and FDT<\/a>.<\/p>\n<p>Because we work a little bit different I had to do some modifications (for example: I work with 2 swf: preloader.swf and main.swf and work on PC). I created a list of stuff that I wanted to do with ANT and behind the &#8220;wish&#8221; you find a link to the site I found the solution for the problem:<\/p>\n<ol>\n<li>base ant script >> <a href=\"http:\/\/blog.base42.nl\/2009\/12\/11\/my-workflow-with-ant-and-fdt\/\">http:\/\/blog.base42.nl\/2009\/12\/11\/my-workflow-with-ant-and-fdt\/<\/a><\/li>\n<li>inspiration >> <a href=\"http:\/\/code.google.com\/p\/sekati\/source\/browse\/trunk\/build.xml\">http:\/\/code.google.com\/p\/sekati\/source\/browse\/trunk\/build.xml<\/a><\/li>\n<li>install ftp protocol in fdt\/eclips >> <a href=\"http:\/\/www.rumblingskies.com\/blog\/?p=75\">http:\/\/www.rumblingskies.com\/blog\/?p=75<\/a><\/li>\n<li>update version ant script >> <a href=\"http:\/\/github.com\/base42\/projectcreator\/blob\/master\/original\/flash\/builders\/ant\/updateVersionFile.xml\">http:\/\/github.com\/base42\/projectcreator\/blob\/master\/original\/flash\/builders\/ant\/updateVersionFile.xml<\/a><\/li>\n<li>another update ant script >> <a href=\"http:\/\/www.sephiroth.it\/weblog\/archives\/2010\/01\/update_your_app_version_using_ant_bui.php\">http:\/\/www.sephiroth.it\/weblog\/archives\/2010\/01\/update_your_app_version_using_ant_bui.php<\/a><\/li>\n<li>update Firefox (only works on OSX) >> <a href=\"http:\/\/epologee.com\/blog\/2009\/focus-and-reload-pages-in-firefox-with-ant\/\">http:\/\/epologee.com\/blog\/2009\/focus-and-reload-pages-in-firefox-with-ant\/<\/a><\/li>\n<li>html wrapper >> <a href=\"http:\/\/fdt.powerflasher.com\/blog\/?p=1392\">http:\/\/fdt.powerflasher.com\/blog\/?p=1392<\/a><\/li>\n<li>create folders >> <a href=\"http:\/\/code.google.com\/p\/sekati\/source\/browse\/trunk\/build.xml\">http:\/\/code.google.com\/p\/sekati\/source\/browse\/trunk\/build.xml<\/a><\/li>\n<\/ol>\n<p>Something like this needs some time to find its place in my workflow, and will be changed a lot. That is the reason why I&#8217;m not posting my ant file&#8230; not because it&#8217;s ugly or a secret&#8230; but because I need to refine it.&nbsp; <\/p>\n<p>Oh&#8230; I also have a small todo list (perhaps you could call it a nice-to-have-list)<\/p>\n<ul>\n<li>count lines of code >> <a href=\"http:\/\/cloc.sourceforge.net\/\">http:\/\/cloc.sourceforge.net\/<\/a><\/li>\n<li>zip files >> <a href=\"http:\/\/www.funky-monkey.nl\/blog\/2010\/09\/22\/copy-files-to-a-network-share-with-ant-and-fdt\/\">http:\/\/www.funky-monkey.nl\/blog\/2010\/09\/22\/copy-files-to-a-network-share-with-ant-and-fdt\/<\/a><\/li>\n<li>asdoc >> <a href=\"http:\/\/code.google.com\/p\/sekati\/source\/browse\/trunk\/build.xml\">http:\/\/code.google.com\/p\/sekati\/source\/browse\/trunk\/build.xml<\/a><\/li>\n<li>swc >> <a href=\" http:\/\/code.google.com\/p\/sekati\/source\/browse\/trunk\/build.xml\"> http:\/\/code.google.com\/p\/sekati\/source\/browse\/trunk\/build.xml<\/a><\/li>\n<\/ul>\n<p>As you can see, these are the thing that I don&#8217;t need a lot, but perhaps in the nearby future&#8230;<\/p>\n<hr\/>\n<h3>FTP (File transfer protocol)<\/h3>\n<p>Ant doesn&#8217;t have the FTP protocols default installed so you need to update FDT4\/Eclipse.<br \/>\nYou can find the explanation here: <a href=\"http:\/\/www.rumblingskies.com\/blog\/?p=75\" target=\"_blank\">http:\/\/www.rumblingskies.com\/blog\/?p=75<\/a><\/p>\n<div class=\"update\"><strong>Update #1:<\/strong>The locations of the files you need are changed so let me post the correct ones here:<\/p>\n<ul>\n<li><a href=\"http:\/\/commons.apache.org\/net\/download_net.cgi\" target=\"_blank\">commons-net-2.0.jar<\/a> | <a href=\"http:\/\/apache.hippo.nl\/\/commons\/net\/binaries\/commons-net-2.0.zip\" target=\"_blank\">direct link<\/a><\/li>\n<li><a href=\"http:\/\/jakarta.apache.org\/site\/downloads\/downloads_oro.cgi\" target=\"_blank\">jakarta-oro-2.0.8.jar<\/a> | <a href=\"http:\/\/apache.hippo.nl\/\/jakarta\/oro\/binaries\/jakarta-oro-2.0.8.zip\" target=\"_blank\">direct link<\/a><\/li>\n<\/ul>\n<p>Save these files in the following folder: <code>C:\\FDT\\plugins\\org.apache.ant_***\\bin\\<\/code>\n<\/div>\n<div class=\"update\"><strong>Update #2:<\/strong> hmmm jakarta-oro seems to be <a href=\"http:\/\/jakarta.apache.org\/oro\/index.html\">Retired<\/a>&#8230; and I haven&#8217;t got time to figure this out right now&#8230;<\/div>\n<p>You probably can add the zips you downloaded there, I extracted the two files and that worked for me. I did this in FDT4 and all I got was an alert about &#8220;The specified Ant runtime classpath does not include a tools.jar library&#8230;..&#8221; which I ignored (and without any problem).<\/p>\n<p>After the installment of the two .JAR files you need an ANT script to get thing started which I just copied from the previous link:<br \/>\n[as light=&#8221;true&#8221; wraplines=&#8221;true&#8221;]<br \/>\n&lt;target name=&quot;ftp_upload&quot; description=&quot;uploads files through ftp&quot;&gt;<br \/>\n  &lt;echo message=&quot;uploading files&quot; \/&gt;<br \/>\n  &lt;ftp server=&quot;123.456.78.90&quot;<br \/>\n       port=&quot;21&quot;<br \/>\n       remotedir=&quot;\/www\/ant_upload_test&quot;<br \/>\n       userid=&quot;my_user_id&quot;<br \/>\n       password=&quot;my_password&quot;<br \/>\n       passive=&quot;no&quot;<br \/>\n       depends=&quot;yes&quot;<br \/>\n       binary=&quot;yes&quot;&gt;<br \/>\n       &lt;fileset dir=&quot;..\/bin&quot; \/&gt;<br \/>\n  &lt;\/ftp&gt;<br \/>\n&lt;\/target&gt;[\/as]<\/p>\n<hr\/>\n<h3>Update version<\/h3>\n<p>It&#8217;s a combination of writing a build.txt file and a Version.as file.<br \/>\nSee what Jankees van Woezik did and I use the script from Sephiroth to have a building number that adds 1.<\/p>\n<hr\/>\n<h3>Firefox refresh<\/h3>\n<p>this feature is awesome in combination with ftp, so here the one who found the how: Eric Paul (epologee). Read more about it here: <a href=\"http:\/\/epologee.com\/blog\/2009\/focus-and-reload-pages-in-firefox-with-ant\/\">focus-and-reload-pages-in-firefox-with-ant<\/a><\/p>\n<p>So downloaded the file, installed the firefox extension and gave it a run:<br \/>\n[as light=&#8221;true&#8221; wraplines=&#8221;true&#8221;]<br \/>\n&lt;target name=&quot;focus Firefox and reload page&quot;&gt;Execute failed: java.io.IOException: Cannot run program &quot;open&quot; (in directory &quot;C:\\foo\\bar\\test&quot;): CreateProcess error=2, Het systeem kan het opgegeven bestand niet vinden<br \/>\n[\/as]<\/p>\n<p>After some googling, I found that it&#8217;s a OSX command that doesn&#8217;t work on Windows:<\/p>\n<p>[as highlight=&#8221;1&#8243; light=&#8221;true&#8221; wraplines=&#8221;true&#8221;]<br \/>\n&lt;target name=&quot;focus Firefox and reload page&quot;&gt;<br \/>\n    &lt;exec executable=&quot;open&quot;&gt;<br \/>\n        &lt;arg line=&quot;-a Firefox&quot; \/&gt;<br \/>\n    &lt;\/exec&gt;<br \/>\n    &lt;exec executable=&quot;flash\/tools\/fresno\/fresno&quot;&gt;<br \/>\n        &lt;arg line=&quot;-j &#8216;content.location.reload()&#8217;&quot; \/&gt;<br \/>\n    &lt;\/exec&gt;<br \/>\n&lt;\/target&gt;[\/as]<\/p>\n<p>I haven&#8217;t found a solution that refreshes the page like Fresno does on Windows.<br \/>\nSo the only thing I can think of is:<\/p>\n<p>[as light=&#8221;true&#8221; wraplines=&#8221;true&#8221;]<br \/>\n&lt;target name=&quot;Launch in Firefox (reload)&quot;&gt;<br \/>\n        &lt;echo&gt;Launch in Firefox (not really a reload)&lt;\/echo&gt;<br \/>\n        &lt;exec executable=&quot;H:\/Program Files\/Mozilla Firefox\/firefox.exe&quot; spawn=&quot;yes&quot;&gt;<br \/>\n            &lt;arg line=&quot;${flashproject.preview.url}&quot; \/&gt;<br \/>\n        &lt;\/exec&gt;<br \/>\n    &lt;\/target&gt;<br \/>\n[\/as]<\/p>\n<hr\/>\n<h3>Html wrapper<\/h3>\n<p>I changed the file a little bit (removed the history) not really difficult.<\/p>\n<hr\/>\n<h3>Folders<\/h3>\n<p>You get the idea&#8230;.<\/p>\n<p>(reminder for myself: <a href=\"http:\/\/fdt.powerflasher.de\/docs\/FDT_Ant_Tasks\">http:\/\/fdt.powerflasher.de\/docs\/FDT_Ant_Tasks<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trying to build the ultimate build.xml in ANT: debug\/production zip ftp version &#8230; etc: will save a lot of keystrokes in FDT4 source: http:\/\/twitter.com\/MatthijsKamstra\/statuses\/25194997777 All the information about the ultimate build.xml can be found on the internet, so I will post the links and you can figure it out for yourself. I used the build.xml [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,330,3],"tags":[347,411,46,398],"class_list":["post-1593","post","type-post","status-publish","format-standard","hentry","category-as3","category-fdt","category-flash","tag-ant","tag-fdt","tag-firefox","tag-flash"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/1593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/comments?post=1593"}],"version-history":[{"count":10,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/1593\/revisions"}],"predecessor-version":[{"id":1737,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/1593\/revisions\/1737"}],"wp:attachment":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/media?parent=1593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/categories?post=1593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/tags?post=1593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}