dev@jsftemplating.java.net

Re: JSFTemplating: Re: Setting up to compile with Apt (handlers) in Netbeans

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Thu, 18 Jan 2007 17:42:57 -0800

Thanks for all the detail. I'm sure this will help other developers as
well!

Thanks!

Ken

Karam Singh Badesha wrote:
> Sure.
>
> Basically I created two new files (same names as in demo application)
> aptbuild.xml and build.properties at the same level as build.xml.
>
> In the aptbuild.xml, I added classpath to the compile rule:
>
> <apt
> srcdir="${apt.dir}"
> fork="true"
> destdir="${build.classes.dir}/."
> debug="${javac.debug}"
> classpath="${javac.classpath}"
> deprecation="${javac.deprecation}">
> </apt>
>
> In build.properties file I added:
>
> ant-apt.jar=C:/Program Files/netbeans-5.5/ide7/ant/lib/ant-apt.jar
>
> build.classes.dir=${build.web.dir}/WEB-INF/classes
> build.classes.excludes=**/*.java,**/*.form
> build.dir=build
> build.web.dir=${build.dir}/web
>
> file.reference.commons-beanutils.jar=web/WEB-INF/lib/commons-beanutils.jar
>
> file.reference.commons-collections.jar=web/WEB-INF/lib/commons-collections.jar
>
> file.reference.commons-digester.jar=web/WEB-INF/lib/commons-digester.jar
> file.reference.commons-fileupload-1.0.jar=web/WEB-INF/lib/commons-fileupload-1.0.jar
>
> file.reference.commons-logging.jar=web/WEB-INF/lib/commons-logging.jar
> file.reference.dataprovider.jar=web/WEB-INF/lib/dataprovider.jar
> file.reference.dojo-0.4.0-ajax.jar=web/WEB-INF/lib/dojo-0.4.0-ajax.jar
> file.reference.jsf-extensions-common-0.1-SNAPSHOT.jar=web/WEB-INF/lib/jsf-extensions-common-0.1-SNAPSHOT.jar
>
> file.reference.jsf-impl.jar=web/WEB-INF/lib/jsf-impl.jar
> file.reference.jsftemplating-dt.jar=web/WEB-INF/lib/jsftemplating-dt.jar
> file.reference.jsftemplating-dynafaces-0.1.jar=web/WEB-INF/lib/jsftemplating-dynafaces-0.1.jar
>
> file.reference.jsftemplating.jar=web/WEB-INF/lib/jsftemplating.jar
> file.reference.json.jar=web/WEB-INF/lib/json.jar
> file.reference.webui-jsf-suntheme.jar=web/WEB-INF/lib/webui-jsf-suntheme.jar
>
> file.reference.webui-jsf.jar=web/WEB-INF/lib/webui-jsf.jar
> j2ee.platform=1.5
> j2ee.server.type=J2EE
> javac.classpath=\
> ${file.reference.commons-digester.jar}:\
> ${file.reference.commons-beanutils.jar}:\
> ${file.reference.webui-jsf-suntheme.jar}:\
> ${file.reference.commons-logging.jar}:\
> ${file.reference.json.jar}:\
> ${file.reference.jsftemplating.jar}:\
> ${file.reference.dataprovider.jar}:\
> ${file.reference.commons-fileupload-1.0.jar}:\
> ${file.reference.commons-collections.jar}:\
> ${file.reference.webui-jsf.jar}:\
> ${file.reference.jsf-impl.jar}:\
> ${file.reference.jsf-extensions-common-0.1-SNAPSHOT.jar}:\
> ${file.reference.dojo-0.4.0-ajax.jar}:\
> ${file.reference.jsftemplating-dynafaces-0.1.jar}:\
> ${file.reference.jsftemplating-dt.jar}
> # Space-separated list of extra javac options
> javac.compilerargs=
> javac.debug=true
> javac.deprecation=false
> lib.dir=${web.docbase.dir}/WEB-INF/lib
>
> source.root=src
> apt.dir=${source.root}/apt
>
> As you can see I have a separate inside src dir called apt for these
> handler sources (whatever else needs to get compiled using apt).
>
> In the build.xml I added (This was an empty rule defined in
> nbproject/build-impl.xml for overwriting purposes):
>
> <target name="-pre-compile">
> <mkdir dir="${build.classes.dir}/." />
> <echo> Building with apt: </echo>
> <exec dir="." executable="${execute.ant}" failonerror="true"
> failifexecutionfails="false">
> <!-- We do this to add the ant-apt.jar to the lib path -->
> <arg line="-f aptbuild.xml -lib ${ant-apt.jar} compile" />
> </exec>
> </target>
>
> In the nbproject/project.properties I added (You probably don't need
> this as there might be something that is already defined to use in
> place of execute.ant, but I don't know what it is. So this is a quick
> workaround.):
> execute.ant=C:/Program Files/netbeans-5.5/ide7/ant/bin/ant.bat
>
> That was it. You probably need more rules if you want more controls
> etc. This is good enough for me.
>
> -Karam
>
> Ken Paulsen wrote:
>>
>> If you have any tips you can provide for other developers, this would
>> be helpful.
>>
>> Thanks!
>>
>> Ken
>>
>> Karam Singh Badesha wrote:
>>> Anyway I got this working. Another step forward :)
>>>
>>> -Karam
>>>
>>> Karam Singh Badesha wrote:
>>>> Hi,
>>>> I am having hard time setting this up in Netbeans. Any
>>>> pointers/help is greatly appreciated. I have already looked at the
>>>> demo application file, it doesn't help me to get it working in
>>>> Netbeans. Someone please send me steps on how I can get this going
>>>> so that I can proceed with my work.
>>>>
>>>> thanks
>>>> Karam
>>>>