Version 47.1 by D Tim Cummings on 2013/12/18 02:55

Hide last authors
David Avendasora 31.1 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
D Tim Cummings 47.1 6
7 {{toc maxLevel="3"/}}
8
David Avendasora 37.1 9 = Before You Build =
David Avendasora 27.1 10
D Tim Cummings 47.1 11 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]].
David Avendasora 27.1 12
D Tim Cummings 47.1 13 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.
David Avendasora 27.1 14
David Avendasora 37.1 15 Where Ant looks for this property is different for each method of building a Framework:
16
D Tim Cummings 47.1 17 1. (((
18 ====== WOJenkins Jobs ======
David Avendasora 37.1 19
D Tim Cummings 47.1 20 1. Completely managed for you by WOJenkins
21 1. Manually overridden as defined in Manual Jenkins Jobs below.
22 )))
23 1. (((
24 ====== Manual Jenkins Jobs ======
David Avendasora 37.1 25
D Tim Cummings 47.1 26 1. Properties specified in the //Targets// line of an Invoke Ant build task using
27
28 {{code language="none"}}
29 -D<property>=<value>
30 {{/code}}
31 1. Properties specified in the //Properties// line of an Invoke Ant build task using (the equivalent of
32
33 {{code language="none"}}
34 -propertyfile <name>
35 {{/code}})
36 )))
37 1. (((
38 ====== Eclipse/WOLips ======
39
40 1. Properties specified for the Eclipse Workspace under Eclipse -> Preferences -> WOLips - > **System Frameworks**
41 1. The
42
43 {{code language="none"}}
44 build.properties
45 {{/code}} file in the same directory as the build.xml file as specified by
46
47 {{code language="none"}}
48 <property file="build.properties" />
49 {{/code}} task in the build.xml file.
50 )))
51 1. (((
52 ====== Command Line ======
53
54 1. Properties specified in the Ant command:
55
56 {{code language="none"}}
57 -D<property>=<value>
58 {{/code}}
59 1. A properties file specified in the Ant command:
60
61 {{code language="none"}}
62 -propertyfile <name>
63 {{/code}}
64 1. The
65
66 {{code language="none"}}
67 build.properties
68 {{/code}} file in the same directory as the build.xml file as specified by
69
70 {{code language="none"}}
71 <property file="build.properties" />
72 {{/code}} task in the build.xml file.
73 )))
74
75 {{note title="Can't Find WebObjects"}}
David Avendasora 37.1 76 If Ant can't find the WebObjects frameworks, you will get compiler errors like this:
D Tim Cummings 47.1 77
78 {{noformat}}
David Avendasora 31.1 79 [wocompile] /MyProjects/MyFramework/Sources/com/mycompany/myapp/myclass:10:
80 package com.webobjects.appserver does not exist
David Avendasora 27.1 81 [wocompile] import com.webobjects.appserver.WOContext;
82
D Tim Cummings 47.1 83 {{/noformat}}
David Avendasora 27.1 84 {{/note}}
85
David Avendasora 37.1 86 = Building =
87
88 === WOJenkins ===
89
90 Using Jenkins is the recommended way to build a Framework and WOJenkins makes the process almost as easy as building from within Eclipse/WOLips.
91
92 === Eclipse/WOLips ===
93
D Tim Cummings 47.1 94 * (((
95 ===== Standard WebObjects Framework =====
96
David Avendasora 37.1 97 Right-Click on your project in Eclipse and select **WOLips Ant Tools > Install**
D Tim Cummings 47.1 98 [[image:attach:WOLipsAntInstall.png]]
David Avendasora 37.1 99 This will build and install the framework in the location defined in the WOLips preferences, overwriting any previously installed version of the framework.
100
Steve Peery 43.1 101 {{note title="BUILD FAILED"}}
D Tim Cummings 47.1 102 If Ant can't write to the WebObjects frameworks directory, you will get an error like this:
Steve Peery 43.1 103
D Tim Cummings 47.1 104 {{noformat}}
Steve Peery 43.1 105 Directory /Library/WebObjects/Versions/WebObjects543/Library/Frameworks/YourFramework.framework
106 creation was not successful for an unknown reason.
D Tim Cummings 47.1 107
108 {{/noformat}}
109
Steve Peery 45.1 110 Give write access to the directory with these commands in Terminal:
D Tim Cummings 47.1 111 sudo chmod 757 /Library/WebObjects/Versions/WebObjects543/Library/Frameworks/
112 sudo chmod 757 /Library/WebObjects/Versions/WebObjects543/Library/WebObjects/Applications
Steve Peery 43.1 113 {{/note}}
D Tim Cummings 47.1 114 )))
Steve Peery 43.1 115
D Tim Cummings 47.1 116 * (((
117 ===== Project Wonder Frameworks =====
118
David Avendasora 37.1 119 **You can not build projects from Wonder this way.** You must either use the command line or Hudson/Jenkins methods
D Tim Cummings 47.1 120 )))
David Avendasora 37.1 121
David Avendasora 27.1 122 === Command Line / Terminal ===
123
D Tim Cummings 47.1 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)
Steve Peery 39.1 125
D Tim Cummings 47.1 126 * (((
127 ===== Standard WebObjects Framework =====
128
David Avendasora 27.1 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
D Tim Cummings 47.1 131 {{code 0="none"}}
David Avendasora 27.1 132 cd /my/project/
133 ant build
134
135 {{/code}}
136
D Tim Cummings 47.1 137 By default, the built framework will be put in a {{code language="none"}}dist{{/code}} directory in your project's root.
138 )))
David Avendasora 27.1 139
D Tim Cummings 47.1 140 * (((
141 ===== Project Wonder Frameworks =====
David Avendasora 27.1 142
D Tim Cummings 47.1 143 First download the Wonder source code (see [[doc:WEB.Getting the Wonder Source Code]]). Make a note of the location of the Wonder directory.
David Avendasora 27.1 144
D Tim Cummings 47.1 145 The Wonder build script will use properties defined in ~~/Library/Application Support/WOLips/wolips.properties. This is a good place to set {{code language="none"}}wo.system.frameworks{{/code}} property.
146
147 To build Project Wonder's frameworks use these commands.
148
149 {{code 0="none"}}
David Avendasora 27.1 150 cd /path/to/Wonder
151 ant frameworks
152
153 {{/code}}
154
D Tim Cummings 47.1 155 By default, all the Wonder frameworks will be built to ({{code language="none"}}~/Roots{{/code}}) (in your home directory). To build elsewhere, set the {{code language="none"}}wo.external.root{{/code}} property.
156 )))
David Avendasora 27.1 157
David Avendasora 31.1 158 = Customizing the Build =
David Avendasora 27.1 159
David Avendasora 37.1 160 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.
David Avendasora 33.1 161
David Avendasora 31.1 162 = Installing =
David Avendasora 27.1 163
David Avendasora 31.1 164 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.
David Avendasora 27.1 165
166 ===== Install the frameworks =====
167
D Tim Cummings 47.1 168 {{code 0="none"}}
169 sudo ant -Duser.home=$HOME frameworks.install
David Avendasora 27.1 170 {{/code}}
171
D Tim Cummings 47.1 172 This copies the built frameworks from {{code language="none"}}~/Roots{{/code}} to the runtime Frameworks directory:
David Avendasora 27.1 173
D Tim Cummings 47.1 174 * Mac OS X: {{code language="none"}}/Library/Frameworks/{{/code}} or {{code language="none"}}/Library/WebObjects/Versions/WebObjects543/Library/Frameworks/{{/code}}
175 * Linux: {{code language="none"}}/Local/Library/Frameworks{{/code}}
David Avendasora 27.1 176
D Tim Cummings 47.1 177 Setting the {{code language="none"}}user.home{{/code}} property is necessary. Otherwise {{code language="none"}}ant{{/code}} will think {{code language="none"}}user.home{{/code}} is {{code language="none"}}/var/root{{/code}} and {{code language="none"}}frameworks.install{{/code}} would look for built frameworks in {{code language="none"}}/var/root/Roots{{/code}} and would miss any custom locations set for {{code language="none"}}wo.local.frameworks{{/code}} that are set in your {{code language="none"}}wolips.properties{{/code}} file.
178
David Avendasora 27.1 179 You can combine the build and install steps by simply executing this Ant command:
180
D Tim Cummings 47.1 181 {{code 0="none"}}
182 sudo ant -Duser.home=$HOME frameworks frameworks.install
David Avendasora 27.1 183 {{/code}}
184
185 === Upgrading ===
186
187 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.
188
D Tim Cummings 47.1 189 1. (((
190 ===== Navigate to the original Wonder source directory that you created above during initial source installation =====
David Avendasora 27.1 191
D Tim Cummings 47.1 192 {{code 0="none"}}
David Avendasora 27.1 193 cd /path/to/WonderSource
194 {{/code}}
D Tim Cummings 47.1 195 )))
196 1. (((
197 ===== Pull the changes you do not have and merge them with your local repository =====
David Avendasora 27.1 198
D Tim Cummings 47.1 199 {{code 0="none"}}
David Avendasora 27.1 200 git pull
201 {{/code}}
D Tim Cummings 47.1 202 )))
203 1. (((
204 ===== Build the frameworks. =====
David Avendasora 27.1 205
D Tim Cummings 47.1 206 {{code 0="none"}}
David Avendasora 27.1 207 ant frameworks
208 {{/code}}
D Tim Cummings 47.1 209 )))
210 1. (((
211 ===== Navigate to the Roots directory that was automatically created by the initial Source installation procedure above =====
David Avendasora 27.1 212
D Tim Cummings 47.1 213 {{code 0="none"}}
David Avendasora 27.1 214 cd ~/Roots/
215 {{/code}}
D Tim Cummings 47.1 216 )))
217 1. (((
218 ===== Delete all installed frameworks whose names match the built frameworks in this Roots build folder =====
David Avendasora 27.1 219
D Tim Cummings 47.1 220 {{code 0="none"}}
David Avendasora 27.1 221 for FRAMEWORK in `echo *.framework`; do sudo rm -r /Library/Frameworks/${FRAMEWORK}; done
222 {{/code}}
D Tim Cummings 47.1 223 )))