Using NetBeans 6.1 freeform project to build iPhone mode add-on for Firefox project.

 

In the last entry I talked about an iPhone mode add-on for Firefox. I used a free form Web Project of NetBeans 6.1 IDE to build the iPhone mode add-on. The NetBeans 6.1 IDE has a great JavaScript editor. That was a big plus. Here is a visual tour of the Web Project setup.

The Build Script

<?xml version="1.0" encoding="UTF-8"?>
<project name="iPhoneEmulator" default="all" basedir=".">
<description>iPhone Emulator for Firefox.</description>
<property name="build.dir" value="build"/>
<!-- build iphone -->
<target name="-create-iphone-jar">
<echo message="Build iphone.jar"/>
<mkdir dir="${build.dir}"/>
<zip destfile="${build.dir}/iphone.jar">
<zipfileset dir="." includes="content/\*\*" />
<zipfileset dir="." includes="locale/\*\*" />
<zipfileset dir="." includes="skin/\*\*" />
</zip>
</target>
<target name="-gen-manifest">
<echo message="Configuring chrome-manifest"/>
<mkdir dir="${build.dir}"/>
<copy file="chrome.manifest" tofile="${build.dir}/chrome.manifest" overwrite="true"/>
<replaceregexp file="${build.dir}/chrome.manifest"
match="\^(content\\s+\\S\*\\s+)(\\S\*/)$"
replace="\\1jar:chrome/iphone.jar!/\\2"
flags="g" byline="true"/>
<replaceregexp file="${build.dir}/chrome.manifest"
match="\^(skin|locale)(\\s+\\S\*\\s+\\S\*\\s+)(.\*/)$"
replace="\\1\\2jar:chrome/iphone.jar!/\\3"
flags="g" byline="true"/>
</target>
<target name="-create-iphone-xpi" depends="-create-iphone-jar,-gen-manifest">
<echo message="Build iphone.xpi"/>
<mkdir dir="${build.dir}"/>
<zip destfile="${build.dir}/iphone.xpi">
<zipfileset dir="${build.dir}" includes="iphone.jar" prefix="chrome" />
<zipfileset dir="${build.dir}" includes="chrome.manifest" />
<zipfileset dir="." includes="install.rdf" />
</zip>
</target>
<target name="all" depends="-create-iphone-xpi"/>

<target name="run" depends="clean,all">
<exec executable="firefox" osfamily="unix">
<arg file="${build.dir}/iphone.xpi"/>
</exec>
<exec executable="/usr/bin/open" osfamily="mac">
<arg value="-b"/>
<arg value="org.mozilla.firefox"/>
<arg file="${build.dir}/iphone.xpi"/>
</exec>
<exec executable="C:/Program Files/Mozilla Firefox/firefox.exe" osfamily="windows">
<arg file="${build.dir}/iphone.xpi"/>
</exec>
</target>

<target name="-clean-iphone">
<echo message="Clean iphone"/>
<delete file="${build.dir}/iphone.jar" failonerror="false"/>
<delete file="${build.dir}/chrome.manifest" failonerror="false"/>
<delete file="${build.dir}/iphone.xpi" failonerror="false"/>
</target>
<target name="clean" depends="-clean-iphone"/>
</project>

Here is the rest:

_

_

 

Projects and Files window showing the layout: 

 

__

 

The NetBeans IDE is slowly starting to take shape as a premium AJAX, Web 2.0 and Mobile development IDE. 

 

Comments:

Post a Comment:
Comments are closed for this entry.
About

sandipchitale

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today