Version 21.1 by David Avendasora on 2011/07/07 10:37

Hide last authors
Steve Peery 15.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
michaelsd 19.1 5 {{toc maxLevel="3"}}{{/toc}}
D Tim Cummings 17.1 6
Steve Peery 15.1 7 = Before You Build =
8
michaelsd 19.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]].
Steve Peery 15.1 10
michaelsd 19.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.
Steve Peery 15.1 12
13 Where Ant looks for this property is different for each method of building a Framework:
14
michaelsd 19.1 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>##**)
David Avendasora 21.1 21 1. h6. WOLips
michaelsd 19.1 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.
Steve Peery 15.1 28
michaelsd 19.1 29 {{note title="Can"}}
Steve Peery 15.1 30
31 If Ant can't find the WebObjects frameworks, you will get compiler errors like this:
michaelsd 19.1 32 {noformat}
Steve Peery 15.1 33 [wocompile] /MyProjects/MyFramework/Sources/com/mycompany/myapp/myclass:10:
34 package com.webobjects.appserver does not exist
35 [wocompile] import com.webobjects.appserver.WOContext;
michaelsd 19.1 36 {noformat}
Steve Peery 15.1 37
38 {{/note}}
39
40 = Building =
41
42 === Command Line / Terminal ===
43
michaelsd 19.1 44 * h5. Standard WebObjects Framework
D Tim Cummings 17.1 45 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.
Steve Peery 15.1 46
michaelsd 19.1 47 {{code value="none"}}
48
Steve Peery 15.1 49 cd /my/project/
50 ant build
51
52 {{/code}}
53
michaelsd 19.1 54 By default, the built framework will be put in a ##dist## directory in your project's root.
Steve Peery 15.1 55
michaelsd 19.1 56 * h5. Project Wonder Frameworks
57 This assumes that you have already downloaded the Wonder source code. Make a note of the location of the Wonder directory.
58 If you are building Project Wonder's frameworks you will use these commands instead:
Steve Peery 15.1 59
michaelsd 19.1 60 {{code value="none"}}
Steve Peery 15.1 61
62 cd /path/to/Wonder
63 ant frameworks
64
65 {{/code}}
66
michaelsd 19.1 67 By default, all the Wonder frameworks will be built to (##/Roots##) (in your home directory).
Steve Peery 15.1 68
David Avendasora 21.1 69 === Eclipse/WOLips ===
70
71 * h5. Standard WebObjects Framework
72 Right-Click on your project in Eclipse and select **WOLips Ant Tools > Install**
73 [[image:WOLipsAntInstall.png||border="1"]]
74 This will build and install the framework in the location defined in the WOLips preferences, overwriting any previously installed version of the framework.
75
76 * h5. Project Wonder Frameworks
77 **You can not build projects from Wonder this way.** You must either use the command line or Hudson/Jenkins methods
78
79 === Hudson/Jenkins ===
80
81 In general, it is recommended that you use Hudson/Jenkins to build your WebObjects frameworks and applications, but it is not required. You can build either from the Terminal as outlined below, or from within Eclipse/WOlips directly (except for Project Wonder's frameworks).
82
Steve Peery 15.1 83 = Customizing the Build =
84
85 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.
86
87 = Installing =
88
89 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.
90
91 ===== Install the frameworks =====
92
michaelsd 19.1 93 {{code value="none"}}
94 sudo ant frameworks.install
Steve Peery 15.1 95 {{/code}}
96
michaelsd 19.1 97 This copies the built frameworks from ##/Roots## to the runtime Frameworks directory:
Steve Peery 15.1 98
michaelsd 19.1 99 * Mac OS X: ##/Library/Framworks/##
100 * Linux: ##/Local/Library/Frameworks##
Steve Peery 15.1 101
102 You can combine the build and install steps by simply executing this Ant command:
103
michaelsd 19.1 104 {{code value="none"}}
105 sudo ant frameworks frameworks.install
Steve Peery 15.1 106 {{/code}}
107
108 === Upgrading ===
109
110 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.
111
michaelsd 19.1 112 1. h5. Navigate to the original Wonder source directory that you created above during initial source installation
Steve Peery 15.1 113
michaelsd 19.1 114 {{code value="none"}}
Steve Peery 15.1 115 cd /path/to/WonderSource
116 {{/code}}
117
michaelsd 19.1 118 1. h5. Pull the changes you do not have and merge them with your local repository
119
120 {{code value="none"}}
Steve Peery 15.1 121 git pull
122 {{/code}}
123
michaelsd 19.1 124 1. h5. Build the frameworks.
125
126 {{code value="none"}}
Steve Peery 15.1 127 ant frameworks
128 {{/code}}
129
michaelsd 19.1 130 1. h5. Navigate to the Roots directory that was automatically created by the initial Source installation procedure above
131
132 {{code value="none"}}
Steve Peery 15.1 133 cd ~/Roots/
134 {{/code}}
135
michaelsd 19.1 136 1. h5. Delete all installed frameworks whose names match the built frameworks in this Roots build folder
137
138 {{code value="none"}}
Steve Peery 15.1 139 for FRAMEWORK in `echo *.framework`; do sudo rm -r /Library/Frameworks/${FRAMEWORK}; done
140 {{/code}}