sandip chitale's blog    Sandip Chitale's blog (scblog)
NOTE: I have moved many of my modules to NetBeans Plugin Portal . Please check there for latest versions of modules described on this blog.
20080426 Saturday April 26, 2008

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. 

 


Posted by sandipchitale ( Apr 26 2008, 12:27:54 PM PDT ) Permalink Comments [0]


Trackback URL: http://blogs.sun.com/scblog/entry/using_netbeans_6_1_freeform
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed








« November 2009
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

Get NetBeans 5.5

Locations of visitors to this page

Today's Page Hits: 357


XML
All
/Creator
/General
/Hobby
/Java
/JavaScript
/Mozilla
/NetBeans
/Ubuntu
/VisualWeb
/VisualWebPack
/Web 2.0

XML
All
/Creator
/General
/Hobby
/Java
/JavaScript
/Mozilla
/NetBeans
/Ubuntu
/VisualWeb
/VisualWebPack
/Web 2.0

scblog
scblog