Wiki source code of Java Client-Incremental Build
Version 41.1 by David Avendasora on 2008/06/17 14:11
Show last authors
author | version | line-number | content |
---|---|---|---|
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. | ||
2 | |||
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. | ||
4 | |||
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. | ||
6 | |||
7 | 1. Create a "javaclientbuild.xml" file in the root of your project, with the following as its contents: | ||
8 | |||
9 | {{code}} | ||
10 | |||
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> | ||
33 | |||
34 | {{/code}} | ||
35 | |||
36 | 1. Right-Click on your project, and select Properties. | ||
37 | 1. Click on "Builders" on the left side. [[image:Picture 2.png]] | ||
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". | ||
43 | 1. Under the "Refresh" tab, check "Refresh resources upon completion." and select "The project containing the selected resource" | ||
44 | 1. Under the "Targets" tab, set "javaclient, setProps" for "After a 'Clean'", "Manual Build" and "Auto Build". | ||
45 | 1. Click okay to close the Builder Properties window. | ||
46 | 1. Make sure your new Builder is checked and executes AFTER the WOLips Incremental Builder, otherwise it will error. | ||
47 | 1. Click "Okay" to exit Project Properties. | ||
48 | |||
49 | Done. You can now use the Eclipse "Run..." command just as you would for any other WOLips project. |