Wiki source code of Java Client-Incremental Build

Version 45.1 by David Avendasora on 2008/06/17 14:06

Hide last authors
David Avendasora 34.1 1 WOLips incremental builder will not automatically create the required jar of your client-side classes and place it in the project.woa/Contents/WebServerResources/Java/ directory as is required by a Java Client application.
David Avendasora 18.1 2
David Avendasora 34.1 3 Without the client classes placed in WebServerResources, Eclipse's built-in Run... command will not work properly as the client application will not have access to its classes and WebObjects will silently fall-back to EOGenericRecord. This causes the confusing condition of the application launching and likely not generating any errors, but not working correctly either.
David Avendasora 18.1 4
David Avendasora 34.1 5 Below are the steps for adding an additional "Ant Builder" to your project to generate and place the required jar in the right location.
David Avendasora 18.1 6
David Avendasora 34.1 7 1. Create a "javaclientbuild.xml" file in the root of your project, with the following as its contents:
8
David Avendasora 28.1 9 {{code}}
David Avendasora 18.1 10
David Avendasora 34.1 11 <project name="javaclient" default="javaclient" basedir=".">
12 <target name="setProps">
13 <property file="${user.home}${file.separator}build.properties"/>
14 <property file="build.properties"/>
15 <property file="${user.home}${file.separator}Library${file.separator}wobuild.properties"/>
16 <condition property="wo.properties.check.failed">
17 <not>
18 <and>
19 <isset property="wo.wosystemroot"/>
20 <isset property="wo.wolocalroot"/>
21 </and>
22 </not>
23 </condition>
24 <fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed"/>
25 </target>
26 <target name="javaclient" depends="setProps">
27 <mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java"/>
28 <jar basedir="${classes.dir}" includes="**/client/**/*.class,**/common/**/*.class"
29 jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar">
30 </jar>
31 </target>
32 </project>
David Avendasora 18.1 33
34 {{/code}}
35
David Avendasora 34.1 36 1. Right-Click on your project, and select Properties.
David Avendasora 42.1 37 1. Click on "Builders" on the right side.
David Avendasora 34.1 38 1. Click the "New" button.
39 1. Select "Ant Build" and click "Okay".
40 1. Name it "Java Client Incremental Builder"
41 1. Under the "Main" tab, click "Browse Workspace".
42 1. Click on your Project, and select the javaclientbuild.xml file you created in step 1, click "Okay".
David Avendasora 44.1 43
44 * Under the "Refresh" tab, check "Refresh resources upon completion." and select "The project containing the selected resource"
45
David Avendasora 38.1 46 1. Under the "Targets" tab, set "javaclient, setProps" for "After a 'Clean'", "Manual Build" and "Auto Build".
David Avendasora 34.1 47 1. Click okay to close the Builder Properties window.
48 1. Make sure your new Builder is checked and executes AFTER the WOLips Incremental Builder, otherwise it will error.
49 1. Click "Okay" to exit Project Properties.
David Avendasora 30.1 50
David Avendasora 34.1 51 Done. You can now use the Eclipse "Run..." command just as you would for any other WOLips project.