Version 15.1 by Steve Peery on 2012/10/23 23:30

Show last authors
1 {{tip title="Pro Tip"}}
2 If you use Hudson/Jenkins to build your WebObjects Frameworks and Applications, then you do not need to build or install either the Project Wonder frameworks or even your own Frameworks on your development machine, just having yours and the individual Wonder source code projects (ERJars, ERExtensions, AJAX, etc) open in your eclipse workspace is sufficient.
3 {{/tip}}
4
5 {{toc maxLevel="3"/}}
6
7 = Before You Build =
8
9 When building a Framework project, Ant needs to be able to find WebObjects. WebObjects itself is a set of Frameworks just like the one you are building. They can be installed anywhere using [[these instructions>>doc:WO.Installing WebObjects 5\.4 on Snow Leopard]].
10
11 Where Ant will look for WebObjects is specified by the {{code language="none"}}wo.system.frameworks{{/code}} build property. This property can be set in a number of locations, or even passed as a command-line property to Ant.
12
13 Where Ant looks for this property is different for each method of building a Framework:
14
15 1. (((
16 ====== WOJenkins Jobs ======
17
18 1. Completely managed for you by WOJenkins
19 1. Manually overridden as defined in Manual Jenkins Jobs below.
20 )))
21 1. (((
22 ====== Manual Jenkins Jobs ======
23
24 1. Properties specified in the //Targets// line of an Invoke Ant build task using
25
26 {{code language="none"}}
27 -D<property>=<value>
28 {{/code}}
29 1. Properties specified in the //Properties// line of an Invoke Ant build task using (the equivalent of
30
31 {{code language="none"}}
32 -propertyfile <name>
33 {{/code}})
34 )))
35 1. (((
36 ====== Eclipse/WOLips ======
37
38 1. Properties specified for the Eclipse Workspace under Eclipse -> Preferences -> WOLips - > **System Frameworks**
39 1. The
40
41 {{code language="none"}}
42 build.properties
43 {{/code}} file in the same directory as the build.xml file as specified by
44
45 {{code language="none"}}
46 <property file="build.properties" />
47 {{/code}} task in the build.xml file.
48 )))
49 1. (((
50 ====== Command Line ======
51
52 1. Properties specified in the Ant command:
53
54 {{code language="none"}}
55 -D<property>=<value>
56 {{/code}}
57 1. A properties file specified in the Ant command:
58
59 {{code language="none"}}
60 -propertyfile <name>
61 {{/code}}
62 1. The
63
64 {{code language="none"}}
65 build.properties
66 {{/code}} file in the same directory as the build.xml file as specified by
67
68 {{code language="none"}}
69 <property file="build.properties" />
70 {{/code}} task in the build.xml file.
71 )))
72
73 {{note title="Can't Find WebObjects"}}
74 If Ant can't find the WebObjects frameworks, you will get compiler errors like this:
75
76 {{noformat}}
77
78 [wocompile] /MyProjects/MyFramework/Sources/com/mycompany/myapp/myclass:10:
79 package com.webobjects.appserver does not exist
80 [wocompile] import com.webobjects.appserver.WOContext;
81
82 {{/noformat}}
83 {{/note}}
84
85 = Building =
86
87 === WOJenkins ===
88
89 Using Jenkins is the recommended way to build a Framework and WOJenkins makes the process almost as easy as building from within Eclipse/WOLips.
90
91 === Eclipse/WOLips ===
92
93 * (((
94 ===== Standard WebObjects Framework =====
95
96 Right-Click on your project in Eclipse and select **WOLips Ant Tools > Install**
97 [[image:attach:WOLipsAntInstall.png]]
98 This will build and install the framework in the location defined in the WOLips preferences, overwriting any previously installed version of the framework.
99
100 {{note title="BUILD FAILED"}}
101 If Ant can't write to the WebObjects frameworks directory, you will get an error like this:
102
103 {{noformat}}
104
105 Directory /Library/WebObjects/Versions/WebObjects543/Library/Frameworks/YourFramework.framework
106 creation was not successful for an unknown reason.
107
108 {{/noformat}}
109
110 Give write access to the directory with these commands in Terminal:
111 sudo chmod 757 /Library/WebObjects/Versions/WebObjects543/Library/Frameworks/
112 sudo chmod 757 /Library/WebObjects/Versions/WebObjects543/Library/WebObjects/Applications
113 {{/note}}
114 )))
115
116 * (((
117 ===== Project Wonder Frameworks =====
118
119 **You can not build projects from Wonder this way.** You must either use the command line or Hudson/Jenkins methods
120 )))
121
122 === Command Line / Terminal ===
123
124 You have to install woproject.jar first and make it available for ant before the following instructions will work. (see [[doc:WEB.Building a WebObjects Project||anchor="Overview"]] first)
125
126 * (((
127 ===== Standard WebObjects Framework =====
128
129 You can build a standard WebObjects Framework project by calling Ant and passing it the Project directory, and the name of the build target contained in the build.xml file at your project's root.
130
131 {{code 0="none"}}
132 cd /my/project/
133 ant build
134 {{/code}} By default, the built framework will be put in a
135
136 {{code language="none"}}
137 dist
138 {{/code}}
139
140 directory in your project's root.
141 )))
142
143 * (((
144 ===== Project Wonder Frameworks =====
145
146 This assumes that you have already downloaded the Wonder source code. Make a note of the location of the Wonder directory.
147 If you are building Project Wonder's frameworks you will use these commands instead:
148
149 {{code 0="none"}}
150 cd /path/to/Wonder
151 ant frameworks
152 {{/code}} By default, all the Wonder frameworks will be built to (
153
154 {{code language="none"}}
155 ~/Roots
156 {{/code}}
157
158 ) (in your home directory).
159 )))
160
161 = Customizing the Build =
162
163 By modifying the values in the build.properties and wolips.properties files or by passing in arguments to the Ant command, you can change where Ant will look for dependencies (binary frameworks, libraries, etc.) and where it will install the build products.
164
165 = Installing =
166
167 Assuming you already cloned and built Wonder from source using the method outlined above, you can use the following procedure pull the latest changes into your local repository.
168
169 ===== Install the frameworks =====
170
171 {{code 0="none"}}
172 sudo ant frameworks.install
173 {{/code}}
174
175 This copies the built frameworks from {{code language="none"}}~/Roots{{/code}} to the runtime Frameworks directory:
176
177 * Mac OS X: {{code language="none"}}/Library/Frameworks/{{/code}} or {{code language="none"}}/Library/WebObjects/Versions/WebObjects543/Library/Frameworks/{{/code}}
178 * Linux: {{code language="none"}}/Local/Library/Frameworks{{/code}}
179
180 You can combine the build and install steps by simply executing this Ant command:
181
182 {{code 0="none"}}
183 sudo ant frameworks frameworks.install
184 {{/code}}
185
186 === Upgrading ===
187
188 This will clean out the existing versions of the frameworks. This isn't strictly necessary, you could just re-install over the top of the old frameworks, but deleting then manually copying over the new ones will clean up any old frameworks that are no longer included in the standard build.
189
190 1. (((
191 ===== Navigate to the original Wonder source directory that you created above during initial source installation =====
192
193 {{code 0="none"}}
194 cd /path/to/WonderSource
195 {{/code}}
196 )))
197 1. (((
198 ===== Pull the changes you do not have and merge them with your local repository =====
199
200 {{code 0="none"}}
201 git pull
202 {{/code}}
203 )))
204 1. (((
205 ===== Build the frameworks. =====
206
207 {{code 0="none"}}
208 ant frameworks
209 {{/code}}
210 )))
211 1. (((
212 ===== Navigate to the Roots directory that was automatically created by the initial Source installation procedure above =====
213
214 {{code 0="none"}}
215 cd ~/Roots/
216 {{/code}}
217 )))
218 1. (((
219 ===== Delete all installed frameworks whose names match the built frameworks in this Roots build folder =====
220
221 {{code 0="none"}}
222 for FRAMEWORK in `echo *.framework`; do sudo rm -r /Library/Frameworks/${FRAMEWORK}; done
223 {{/code}}
224 )))