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

From version 26.1
edited by David Avendasora
on 2011/04/25 17:20
Change comment: There is no comment for this version
To version 27.1
edited by David Avendasora
on 2011/04/25 17:55
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Building a WO Framework with Ant
1 +Building and Installing a WO Framework with Ant
Content
... ... @@ -1,0 +1,117 @@
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 +
7 += Building =
8 +
9 +{{note title="Requires WebObjects"}}
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}}
14 +
15 +Otherwise you will get compiler errors like this:
16 +{noformat}
17 +[wocompile] /MyProjects/MyFramework/Sources/com/mycompany/myapp/myclass:10:
18 + package com.webobjects.appserver does not exist
19 +[wocompile] import com.webobjects.appserver.WOContext;
20 +{noformat}
21 +
22 +{{/note}}
23 +
24 +=== Command Line / Terminal ===
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.
28 +
29 +{{code value="none"}}
30 +
31 +cd /my/project/
32 +ant build
33 +
34 +{{/code}}
35 +
36 +By default, the built framework will be put in a ##dist## directory in your project's root.
37 +
38 +* h5. Project Wonder Frameworks
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:
41 +
42 +{{code value="none"}}
43 +
44 +cd /path/to/Wonder
45 +ant frameworks
46 +
47 +{{/code}}
48 +
49 +By default, all the Wonder frameworks will be built to (##/Roots##) (in your home directory).
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 += Customizing the Build =
63 +
64 += Installing =
65 +
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 +
68 +===== Install the frameworks =====
69 +
70 +{{code value="none"}}
71 +sudo ant frameworks.install
72 +{{/code}}
73 +
74 +This copies the built frameworks from ##/Roots## to the runtime Frameworks directory:
75 +
76 +* Mac OS X: ##/Library/Framworks/##
77 +* Linux: ##/Local/Library/Frameworks##
78 +
79 +You can combine the build and install steps by simply executing this Ant command:
80 +
81 +{{code value="none"}}
82 +sudo ant frameworks frameworks.install
83 +{{/code}}
84 +
85 +=== Upgrading ===
86 +
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 +
89 +1. h5. Navigate to the original Wonder source directory that you created above during initial source installation
90 +
91 +{{code value="none"}}
92 +cd /path/to/WonderSource
93 +{{/code}}
94 +
95 +1. h5. Pull the changes you do not have and merge them with your local repository
96 +
97 +{{code value="none"}}
98 +git pull
99 +{{/code}}
100 +
101 +1. h5. Build the frameworks.
102 +
103 +{{code value="none"}}
104 +ant frameworks
105 +{{/code}}
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"}}
110 +cd ~/Roots/
111 +{{/code}}
112 +
113 +1. h5. Delete all installed frameworks whose names match the built frameworks in this Roots build folder
114 +
115 +{{code value="none"}}
116 +for FRAMEWORK in `echo *.framework`; do sudo rm -r /Library/Frameworks/${FRAMEWORK}; done
117 +{{/code}}