Last modified by Pascal Robert on 2013/12/18 02:55

From version 46.1
edited by Steve Peery
on 2012/10/23 23:30
Change comment: There is no comment for this version
To version 48.1
edited by D Tim Cummings
on 2013/12/18 02:55
Change comment: Migrated to Confluence 5.3

Summary

Details

Page properties
Parent
... ... @@ -1,0 +1,1 @@
1 +Building a WebObjects Project
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.speery
1 +XWiki.timcu
Tags
... ... @@ -1,0 +1,1 @@
1 +build
Content
... ... @@ -2,39 +2,85 @@
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}}
6 6  
6 +
7 +{{toc maxLevel="3"/}}
8 +
7 7  = Before You Build =
8 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>>WO:Installing WebObjects 5.4 on Snow Leopard]].
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]].
10 10  
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.
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.
12 12  
13 13  Where Ant looks for this property is different for each method of building a Framework:
14 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.
17 +1. (((
18 +====== WOJenkins Jobs ======
28 28  
29 -{{note title="Can"}}
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 ======
30 30  
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"}}
31 31  If Ant can't find the WebObjects frameworks, you will get compiler errors like this:
32 -{noformat}
77 +
78 +{{noformat}}
33 33  [wocompile] /MyProjects/MyFramework/Sources/com/mycompany/myapp/myclass:10:
34 34   package com.webobjects.appserver does not exist
35 35  [wocompile] import com.webobjects.appserver.WOContext;
36 -{noformat}
37 37  
83 +{{/noformat}}
38 38  {{/note}}
39 39  
40 40  = Building =
... ... @@ -45,55 +45,69 @@
45 45  
46 46  === Eclipse/WOLips ===
47 47  
48 -* h5. Standard WebObjects Framework
94 +* (((
95 +===== Standard WebObjects Framework =====
96 +
49 49  Right-Click on your project in Eclipse and select **WOLips Ant Tools > Install**
50 -[[image:WOLipsAntInstall.png||border="1"]]
98 + [[image:attach:WOLipsAntInstall.png]]
51 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 52  
53 53  {{note title="BUILD FAILED"}}
54 -
55 55  If Ant can't write to the WebObjects frameworks directory, you will get an error like this:
56 -{noformat}
103 +
104 +{{noformat}}
57 57  Directory /Library/WebObjects/Versions/WebObjects543/Library/Frameworks/YourFramework.framework
58 58  creation was not successful for an unknown reason.
59 -{noformat}
60 -Give write access to the directory with these commands in Terminal:
61 -sudo chmod 757 /Library/WebObjects/Versions/WebObjects543/Library/Frameworks/
62 -sudo chmod 757 /Library/WebObjects/Versions/WebObjects543/Library/WebObjects/Applications
63 63  
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
64 64  {{/note}}
114 +)))
65 65  
66 -* h5. Project Wonder Frameworks
116 +* (((
117 +===== Project Wonder Frameworks =====
118 +
67 67  **You can not build projects from Wonder this way.** You must either use the command line or Hudson/Jenkins methods
120 +)))
68 68  
69 69  === Command Line / Terminal ===
70 70  
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)
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)
72 72  
73 -* h5. Standard WebObjects Framework
126 +* (((
127 +===== Standard WebObjects Framework =====
128 +
74 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 75  
76 -{{code value="none"}}
77 -
131 +{{code 0="none"}}
78 78  cd /my/project/
79 79  ant build
80 80  
81 81  {{/code}}
82 82  
83 -By default, the built framework will be put in a ##dist## directory in your project's root.
137 +By default, the built framework will be put in a {{code language="none"}}dist{{/code}} directory in your project's root.
138 +)))
84 84  
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:
140 +* (((
141 +===== Project Wonder Frameworks =====
88 88  
89 -{{code value="none"}}
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.
90 90  
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"}}
91 91  cd /path/to/Wonder
92 92  ant frameworks
93 93  
94 94  {{/code}}
95 95  
96 -By default, all the Wonder frameworks will be built to (##/Roots##) (in your home directory).
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 +)))
97 97  
98 98  = Customizing the Build =
99 99  
... ... @@ -105,19 +105,21 @@
105 105  
106 106  ===== Install the frameworks =====
107 107  
108 -{{code value="none"}}
109 -sudo ant frameworks.install
168 +{{code 0="none"}}
169 +sudo ant -Duser.home=$HOME frameworks.install
110 110  {{/code}}
111 111  
112 -This copies the built frameworks from ##/Roots## to the runtime Frameworks directory:
172 +This copies the built frameworks from {{code language="none"}}~/Roots{{/code}} to the runtime Frameworks directory:
113 113  
114 -* Mac OS X: ##/Library/Frameworks/## or ##/Library/WebObjects/Versions/WebObjects543/Library/Frameworks/##
115 -* Linux: ##/Local/Library/Frameworks##
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}}
116 116  
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 +
117 117  You can combine the build and install steps by simply executing this Ant command:
118 118  
119 -{{code value="none"}}
120 -sudo ant frameworks frameworks.install
181 +{{code 0="none"}}
182 +sudo ant -Duser.home=$HOME frameworks frameworks.install
121 121  {{/code}}
122 122  
123 123  === Upgrading ===
... ... @@ -124,32 +124,38 @@
124 124  
125 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 126  
127 -1. h5. Navigate to the original Wonder source directory that you created above during initial source installation
189 +1. (((
190 +===== Navigate to the original Wonder source directory that you created above during initial source installation =====
128 128  
129 -{{code value="none"}}
192 +{{code 0="none"}}
130 130  cd /path/to/WonderSource
131 131  {{/code}}
195 +)))
196 +1. (((
197 +===== Pull the changes you do not have and merge them with your local repository =====
132 132  
133 -1. h5. Pull the changes you do not have and merge them with your local repository
134 -
135 -{{code value="none"}}
199 +{{code 0="none"}}
136 136  git pull
137 137  {{/code}}
202 +)))
203 +1. (((
204 +===== Build the frameworks. =====
138 138  
139 -1. h5. Build the frameworks.
140 -
141 -{{code value="none"}}
206 +{{code 0="none"}}
142 142  ant frameworks
143 143  {{/code}}
209 +)))
210 +1. (((
211 +===== Navigate to the Roots directory that was automatically created by the initial Source installation procedure above =====
144 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"}}
213 +{{code 0="none"}}
148 148  cd ~/Roots/
149 149  {{/code}}
216 +)))
217 +1. (((
218 +===== Delete all installed frameworks whose names match the built frameworks in this Roots build folder =====
150 150  
151 -1. h5. Delete all installed frameworks whose names match the built frameworks in this Roots build folder
152 -
153 -{{code value="none"}}
220 +{{code 0="none"}}
154 154  for FRAMEWORK in `echo *.framework`; do sudo rm -r /Library/Frameworks/${FRAMEWORK}; done
155 155  {{/code}}
223 +)))
WOLipsAntInstall.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +18.2 KB
Content