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

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 {{toc maxLevel="3"}}{{/toc}}
6
David Avendasora 37.1 7 = Before You Build =
David Avendasora 27.1 8
David Avendasora 37.1 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>>WO:Installing WebObjects 5.4 on Snow Leopard]].
David Avendasora 27.1 10
David Avendasora 37.1 11 Where Ant will look for WebObjects is specified by the ##wo.system.frameworks## 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 12
David Avendasora 37.1 13 Where Ant looks for this property is different for each method of building a Framework:
14
15 1. h6. WOJenkins Jobs
16 11. Completely managed for you by WOJenkins
17 11. Manually overridden as defined in Manual Jenkins Jobs below.
18 1. h6. Manual Jenkins Jobs
19 11. Properties specified in the //Targets// line of an Invoke Ant build task using **##-D<property>=<value>##**
20 11. Properties specified in the //Properties// line of an Invoke Ant build task using (the equivalent of **##-propertyfile <name>##**)
21 1. h6. Eclipse/WOLips
22 11. Properties specified for the Eclipse Workspace under Eclipse -> Preferences -> WOLips - > **System Frameworks**
23 11. The ##build.properties## file in the same directory as the build.xml file as specified by **##<property file="build.properties" />##** task in the build.xml file.
24 1. h6. Command Line
25 11. Properties specified in the Ant command: **##-D<property>=<value>##**
26 11. A properties file specified in the Ant command: **##-propertyfile <name>##**
27 11. The ##build.properties## file in the same directory as the build.xml file as specified by **##<property file="build.properties" />##** task in the build.xml file.
28
29 {{note title="Can"}}
30
31 If Ant can't find the WebObjects frameworks, you will get compiler errors like this:
David Avendasora 27.1 32 {noformat}
David Avendasora 31.1 33 [wocompile] /MyProjects/MyFramework/Sources/com/mycompany/myapp/myclass:10:
34 package com.webobjects.appserver does not exist
David Avendasora 27.1 35 [wocompile] import com.webobjects.appserver.WOContext;
36 {noformat}
37
38 {{/note}}
39
David Avendasora 37.1 40 = Building =
41
42 === WOJenkins ===
43
44 Using Jenkins is the recommended way to build a Framework and WOJenkins makes the process almost as easy as building from within Eclipse/WOLips.
45
46 === Eclipse/WOLips ===
47
48 * h5. Standard WebObjects Framework
49 Right-Click on your project in Eclipse and select **WOLips Ant Tools > Install**
50 [[image:WOLipsAntInstall.png||border="1"]]
51 This will build and install the framework in the location defined in the WOLips preferences, overwriting any previously installed version of the framework.
52
Steve Peery 43.1 53 {{note title="BUILD FAILED"}}
54
55 If Ant can't write to the WebObjects frameworks directory, you will get an error like this:
56 {noformat}
57 Directory /Library/WebObjects/Versions/WebObjects543/Library/Frameworks/YourFramework.framework
58 creation was not successful for an unknown reason.
59 {noformat}
Steve Peery 45.1 60 Give write access to the directory with these commands in Terminal:
Steve Peery 43.1 61 sudo chmod 757 /Library/WebObjects/Versions/WebObjects543/Library/Frameworks/
Steve Peery 45.1 62 sudo chmod 757 /Library/WebObjects/Versions/WebObjects543/Library/WebObjects/Applications
Steve Peery 43.1 63
64 {{/note}}
65
David Avendasora 37.1 66 * h5. Project Wonder Frameworks
67 **You can not build projects from Wonder this way.** You must either use the command line or Hudson/Jenkins methods
68
David Avendasora 27.1 69 === Command Line / Terminal ===
70
Steve Peery 39.1 71 You have to install woproject.jar first and make it available for ant before the following instructions will work. (see [[Building a WebObjects Project||anchor="Overview"]] first)
72
David Avendasora 27.1 73 * h5. Standard WebObjects Framework
74 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.
75
76 {{code value="none"}}
77
78 cd /my/project/
79 ant build
80
81 {{/code}}
82
83 By default, the built framework will be put in a ##dist## directory in your project's root.
84
David Avendasora 31.1 85 * h5. Project Wonder Frameworks
86 This assumes that you have already downloaded the Wonder source code. Make a note of the location of the Wonder directory.
87 If you are building Project Wonder's frameworks you will use these commands instead:
David Avendasora 27.1 88
89 {{code value="none"}}
90
91 cd /path/to/Wonder
92 ant frameworks
93
94 {{/code}}
95
David Avendasora 31.1 96 By default, all the Wonder frameworks will be built to (##/Roots##) (in your home directory).
David Avendasora 27.1 97
David Avendasora 31.1 98 = Customizing the Build =
David Avendasora 27.1 99
David Avendasora 37.1 100 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 101
David Avendasora 31.1 102 = Installing =
David Avendasora 27.1 103
David Avendasora 31.1 104 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 105
106 ===== Install the frameworks =====
107
108 {{code value="none"}}
109 sudo ant frameworks.install
110 {{/code}}
111
112 This copies the built frameworks from ##/Roots## to the runtime Frameworks directory:
113
Steve Peery 41.1 114 * Mac OS X: ##/Library/Frameworks/## or ##/Library/WebObjects/Versions/WebObjects543/Library/Frameworks/##
David Avendasora 27.1 115 * Linux: ##/Local/Library/Frameworks##
116
117 You can combine the build and install steps by simply executing this Ant command:
118
119 {{code value="none"}}
120 sudo ant frameworks frameworks.install
121 {{/code}}
122
123 === Upgrading ===
124
125 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.
126
127 1. h5. Navigate to the original Wonder source directory that you created above during initial source installation
128
129 {{code value="none"}}
130 cd /path/to/WonderSource
131 {{/code}}
132
133 1. h5. Pull the changes you do not have and merge them with your local repository
134
135 {{code value="none"}}
136 git pull
137 {{/code}}
138
139 1. h5. Build the frameworks.
140
141 {{code value="none"}}
142 ant frameworks
143 {{/code}}
144
145 1. h5. Navigate to the Roots directory that was automatically created by the initial Source installation procedure above
146
147 {{code value="none"}}
148 cd ~/Roots/
149 {{/code}}
150
151 1. h5. Delete all installed frameworks whose names match the built frameworks in this Roots build folder
152
153 {{code value="none"}}
154 for FRAMEWORK in `echo *.framework`; do sudo rm -r /Library/Frameworks/${FRAMEWORK}; done
155 {{/code}}