Last modified by Markus Ruggiero on 2025/10/24 16:16

From version 27.1
edited by David Avendasora
on 2011/04/25 17:55
Change comment: There is no comment for this version
To version 16.1
edited by Steve Peery
on 2012/10/23 23:30
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Building and Installing a WO Framework with Ant
1 +Building and Installing a Framework with Ant
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.avendasora
1 +XWiki.speery
Content
... ... @@ -2,65 +2,166 @@
2 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 3  {{/tip}}
4 4  
5 -{{toc maxLevel="3"}}{{/toc}}
5 +{{toc maxLevel="3"/}}
6 6  
7 -= Building =
7 += Before You Build =
8 8  
9 -{{note title="Requires WebObjects"}}
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 10  
11 -These build instructions require the WebObjects frameworks to already be installed in the normal location:
12 -* Mac OS X: {{/System/Library/Framworks/}}
13 -* Linux: {{/Library/Frameworks}}
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.
14 14  
15 -Otherwise you will get compiler errors like this:
16 -{noformat}
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 +
17 17  [wocompile] /MyProjects/MyFramework/Sources/com/mycompany/myapp/myclass:10:
18 18   package com.webobjects.appserver does not exist
19 19  [wocompile] import com.webobjects.appserver.WOContext;
20 -{noformat}
21 21  
82 +{{/noformat}}
22 22  {{/note}}
23 23  
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 +
24 24  === Command Line / Terminal ===
25 25  
26 -* h5. Standard WebObjects Framework
27 -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.
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)
28 28  
29 -{{code value="none"}}
126 +* (((
127 +===== Standard WebObjects Framework =====
30 30  
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"}}
31 31  cd /my/project/
32 32  ant build
134 +{{/code}} By default, the built framework will be put in a
33 33  
136 +{{code language="none"}}
137 +dist
34 34  {{/code}}
35 35  
36 -By default, the built framework will be put in a ##dist## directory in your project's root.
140 + directory in your project's root.
141 +)))
37 37  
38 -* h5. Project Wonder Frameworks
143 +* (((
144 +===== Project Wonder Frameworks =====
145 +
39 39  This assumes that you have already downloaded the Wonder source code. Make a note of the location of the Wonder directory.
40 -If you are building Project Wonder's frameworks you will use these commands instead:
147 + If you are building Project Wonder's frameworks you will use these commands instead:
41 41  
42 -{{code value="none"}}
43 -
149 +{{code 0="none"}}
44 44  cd /path/to/Wonder
45 45  ant frameworks
152 +{{/code}} By default, all the Wonder frameworks will be built to (
46 46  
154 +{{code language="none"}}
155 +~/Roots
47 47  {{/code}}
48 48  
49 -By default, all the Wonder frameworks will be built to (##/Roots##) (in your home directory).
158 +) (in your home directory).
159 +)))
50 50  
51 -=== Eclipse/WOLips ===
52 -
53 -* h5. Standard WebObjects Framework
54 -
55 -* h5. Project Wonder Frameworks
56 -**You can not build projects from Wonder this way.** You must either use the command line or Hudson/Jenkins methods
57 -
58 -=== Hudson/Jenkins ===
59 -
60 -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 directly.
61 -
62 62  = Customizing the Build =
63 63  
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 +
64 64  = Installing =
65 65  
66 66  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.
... ... @@ -67,18 +67,18 @@
67 67  
68 68  ===== Install the frameworks =====
69 69  
70 -{{code value="none"}}
171 +{{code 0="none"}}
71 71  sudo ant frameworks.install
72 72  {{/code}}
73 73  
74 -This copies the built frameworks from ##/Roots## to the runtime Frameworks directory:
175 +This copies the built frameworks from {{code language="none"}}~/Roots{{/code}} to the runtime Frameworks directory:
75 75  
76 -* Mac OS X: ##/Library/Framworks/##
77 -* Linux: ##/Local/Library/Frameworks##
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}}
78 78  
79 79  You can combine the build and install steps by simply executing this Ant command:
80 80  
81 -{{code value="none"}}
182 +{{code 0="none"}}
82 82  sudo ant frameworks frameworks.install
83 83  {{/code}}
84 84  
... ... @@ -86,32 +86,38 @@
86 86  
87 87  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.
88 88  
89 -1. h5. Navigate to the original Wonder source directory that you created above during initial source installation
190 +1. (((
191 +===== Navigate to the original Wonder source directory that you created above during initial source installation =====
90 90  
91 -{{code value="none"}}
193 +{{code 0="none"}}
92 92  cd /path/to/WonderSource
93 93  {{/code}}
196 +)))
197 +1. (((
198 +===== Pull the changes you do not have and merge them with your local repository =====
94 94  
95 -1. h5. Pull the changes you do not have and merge them with your local repository
96 -
97 -{{code value="none"}}
200 +{{code 0="none"}}
98 98  git pull
99 99  {{/code}}
203 +)))
204 +1. (((
205 +===== Build the frameworks. =====
100 100  
101 -1. h5. Build the frameworks.
102 -
103 -{{code value="none"}}
207 +{{code 0="none"}}
104 104  ant frameworks
105 105  {{/code}}
210 +)))
211 +1. (((
212 +===== Navigate to the Roots directory that was automatically created by the initial Source installation procedure above =====
106 106  
107 -1. h5. Navigate to the Roots directory that was automatically created by the initial Source installation procedure above
108 -
109 -{{code value="none"}}
214 +{{code 0="none"}}
110 110  cd ~/Roots/
111 111  {{/code}}
217 +)))
218 +1. (((
219 +===== Delete all installed frameworks whose names match the built frameworks in this Roots build folder =====
112 112  
113 -1. h5. Delete all installed frameworks whose names match the built frameworks in this Roots build folder
114 -
115 -{{code value="none"}}
221 +{{code 0="none"}}
116 116  for FRAMEWORK in `echo *.framework`; do sudo rm -r /Library/Frameworks/${FRAMEWORK}; done
117 117  {{/code}}
224 +)))