Wiki source code of Building WOLips

Version 53.1 by Pascal Robert on 2011/09/18 11:01

Show last authors
1 {{warning}}
2 Since WOLips moved away to GitHub, this page needs some reworking. In the meantime, please adapt your build procedure to use Git instead of SVN.
3
4 {color:#333333}WOLips is now located GitHub at {color}{color:#006daf}[{color:#006daf}https://github.com/wolips/wolips/{color}|https://github.com/wolips/wolips/]{color}{color:#333333}. The SVN repository at objectstyle is now deprecated.{color}
5 {{/warning}}
6
7 {{tip title="Not Required!"}}
8 You do not have to build WOLips to use it. It is easily available via Eclipse's Software Update functionality. The update site is: [http://webobjects.mdimension.com/hudson/job/WOLips37Current/lastSuccessfulBuild/artifact/site/]
9 {{/tip}}
10
11 {{note}}
12
13 The following instructions about building WOLips are fine if you need to build a distribution of WOLips. However, they aren't so great if you're debugging WOLips. Instructions on how to do that are posted here [Debugging WOLips].
14
15 {{/note}}
16
17 Prior to building WOLips, you will want to get your dependencies installed properly. Check out the [[Installing WOLips]] page for information on the dependencies for WOLips.
18
19 {{color value="#000000"}}
20 {*}Prerequisites{*}
21 {{/color}}
22
23 ==== Install eGit or another Git client ====
24
25 See [[Getting Started With Git>>WO:Getting Started with Git]] for information on how to obtain a Git client.
26
27 ==== Install the m2eclipse plugin (Eclipse 3.5 instructions) ====
28
29 1. Help > Install New Software
30 1. Click "Add..."
31 11. Name = M2Eclipse
32 11. Location = [[http://m2eclipse.sonatype.org/update/]]
33 11. Click "OK"
34 1. Expand "Maven Integration"
35 1. Select "Maven Embedder"
36 1. Select "Maven Integration for Eclipse"
37 1. Click "Next>"
38 1. Click "Finish"
39
40 == Checking out and Building from the Commandline ==
41
42 1. Checkout the ##trunk/woproject## folder from Subversion
43 ##git clone## ##[[git://github.com/wolips/wolips.git]]## ##.##
44 1. ##cd woproject##
45 1. ##ant##
46 1. The first build will fail out telling you that it couldn't find ##wobuild.properties## ~-~- That's OK
47 1. Edit ##/Library/wobuild.properties##
48 1. Add a line: ##eclipse.home=/path/to/your/eclipse##
49 1. ant again and it should succeed this time
50 11. If you get the error ##'build.xml:73: taskdef A class needed by class org.apache.velocity.anakia.AnakiaTask cannot be found: org/jdom/JDOMException'##, you can do one of two things. You can build with ##Dno.docs=true## to skip the javadoc step, or (untested) you can drop ##jdom-b8.jar## from ##woproject/projects/lib## into your ##ANT//HOME/lib//##// folder.//
51 1. The build went into ##temp/dist##
52 1. Profit
53
54 == Checking out and Building inside of Eclipse for Deployment ==
55
56 1. Add the wolips Git repository [[https://github.com/wolips/wolips/]] in the Git Perspective's Repository View
57 1. Right-click (or equiv) on the ##build.xml## inside of the "woproject" project and Run As=>Ant Build ...
58 1. Switch to the Properties tab and check for the definition of eclipse.home in the Properties list
59 1. If ##eclipse.home## does not exist, uncheck "Use global properties" and then click "Add Property"
60 1. In the Add Property dialog, make the name ##eclipse.home##, click Add Variable, select ##eclipse//home//##// from the list, and click OK//
61 1. Click Apply to save your changes
62 1. Run
63 1. Once it is complete, you may need to right-click=>refresh your project and you will have a ##temp/dist## folder with the plugin site in it.
64
65 == Checking out and Building inside of Eclipse for Development (PDE) ==
66
67 1. Add the wolips Git repository [[https://github.com/wolips/wolips/]] in the Git Perspective's Repository View
68 1. You can select individual plugins you would like to work on by browsing to ##trunk/woproject/wolips/## in the Subversion repository and checking out the plugins you are interested in. To checkout complete sets of plugins, you could also use the [[Eclipse Team Project Set]].
69
70 == An approach to setting up the development and test environment for WOLips Plugin. ==
71
72 In order to do WOLips Plugin development you will need two eclipse environments: Development and Test.
73
74 1. Follow the Checking out and Building inside of Eclipse for Deployment in you primary Eclipse installation (i.e. /Application/eclipse) and workspace. This will be you development environment.
75 1. the ##temp/dist## folder is your Local Site for the Test Environment.
76 1. Create a second copy of "clean" Eclipse under /Users/<me>/Developer/eclipse (this could be any where). This will be your Test Environment.
77 1. In the test environment, follow the [[Installing WOLips]] instructions, using your ##temp/dist## directory as the Local Site. Install the plugins.
78 1. Use the Test environment to exercise/test the changes from your locally modified Plugin.
79
80 1. When you need to repeat the process, shut down the Test Environment, delete the org.objectstyle. files in the features and plugins directories under the /Users/<me>/Developer/eclipse directory. Change the source code in the primary environment and build. (Each build took 3 min 37 seconds on my Mac Book Pro 17"). Once the build is done, then reinstall the plugin in the Test Environment. The Local Site should still be selected.
81
82 == Building WOLips with Jenkins Continuous Build server ==
83
84 Hudson is a Java base continuous build server that allows you to build and test your project automatically. It can be easily configured to build WOLips in a few simple steps.
85
86 1. Add a new job with the following configuration
87 Project Name: WOLips
88 Git Repositories: [[https://github.com/wolips/wolips.git]]
89 Local module directory (optional): wolips
90 Use update: Checked
91 Poll SCM: 59 * ** * ** //(59 can be replaced with any number between 0 and 59)//
92 1. Add the following build tasks to the job
93
94 {{code title="Execute Shell"}}
95
96 echo build.version=3.4.${SVN_REVISION} > wolips/build.properties
97 echo eclipse.home=/usr/local/eclipse >> wolips/build.properties
98 echo user.home=${WORKSPACE} >> wolips/build.properties
99
100 {{/code}}
101
102 {{code title="Invoke Ant"}}
103
104 Targets: dist
105
106 {{/code}}
107
108 If you want to deploy the build to a web server to serve as an update site add a task that is something like this
109
110 {{code title="Execute Shell"}}
111
112 rm -fr /usr/local/www/apache22/data/wolips/*
113 /bin/cp -prv ${WORKSPACE}/wolips/temp/dist/ /usr/local/www/apache22/data/wolips/
114
115 {{/code}}
116
117 1. Copy eclipse with the necessary plugins installed to your build server. In this example it has been copied to /usr/local/eclipse
118 The currently required plugins for a deployment build are
119 1*. JProfiler ([[Update Site>>http://webobjects.mdimension.com/jprofiler6/]])
120 1*. m2Eclipse Maven ([[Update Site>>http://m2eclipse.sonatype.org/sites/m2e]])
121 1*. JRebel ([[Update Site>>http://www.zeroturnaround.com/update-site/]])
122
123 == Preparation for building WOLips on Windows operating systems (NT 5.0 and higher) ==
124
125 For building WOLips on Windows operating systems, some minor changes have to be made. Instead of following and solving the build errors, you may follow the steps described below.
126
127 1. Install the [[BuildingWOLips-Prerequisites>>||anchor="BuildingWOLips-Prerequisites"]]. Do also follow the [[BuildingWOLips-CheckingoutandBuildinginsideofEclipseforDeployment>>||anchor="BuildingWOLips-CheckingoutandBuildinginsideofEclipseforDeployment"]] section, but don't run the build until the changes described below have been made.
128 1. Set the VMs encoding to MacRoman
129 1*. Right click on ##build.xml## > Properties > JRE > VM arguments
130 1**. Dfile.encoding=MacRoman
131 1. Edit ##woproject/wolips/goodies/plugins/build.xml##
132 1*. Comment out the subsequent lines (mac goodies)
133 1**. <ant dir="org.objectstyle.wolips.goodies.core.mac" target="all" />
134 1**. <ant dir="org.objectstyle.wolips.goodies.ui.mac" target="all" />
135 1**. <ant dir="org.objectstyle.wolips.goodies.core.mac" target="dist" />
136 1**. <ant dir="org.objectstyle.wolips.goodies.ui.mac" target="dist" />
137 1. Edit ##woproject/wolips/features/build.xml##
138 1*. Comment out the subsequent lines (mac features)
139 1**. <ant dir="org.objectstyle.wolips.goodies.mac.feature" target="all" />
140 1**. <ant dir="org.objectstyle.wolips.goodies.mac.feature" target="dist" />
141 1. Edit ##woproject/wolips/build.xml## (you may skip this one if you've got JProfiler installed)
142 1*. Comment out the subsequent lines
143 1**. <ant dir="jprofiler" target="all" />
144 1**. <ant dir="jprofiler" target="dist" />
145 1. Run the build
146
147 == Installing from a Local Build ==
148
149 1. If you made changes locally, Eclipse will not automatically install your changed plugins if the version number is the same. You have two options - either uninstall WOLips or cheat and increment the WOLips build version prior to building your local copy. To uninstall WOLips, just delete all org.objectstyle features and plug ins from your eclipse folder. To increment the build server version, open buildserver.version in your projects folder and increment the last number. Note that you will now be "competing" with version numbers from the official build server, so the next official build will not install because you already used the next number, but sometimes it's a quick hack to force an update if you're lazy :-)
150 1. Assuming you now have your build versions under control, you should follow the instructions for [[Building WOLips]]
151 1. Launch Eclipse
152 1. Select the menu: Help->Software Updates.
153 1. Click on the 'Available Software' tab at the top of the window.
154 1. Click on the 'Add Site...' button. This will bring up a dialog box.
155 1. Click on the 'Local...' button on the dialog box.
156 1. Browse to and select your workspace/projects/temp/dist folder or your woproject/temp/dist folder (depending on whether you checked out in eclipse or command line). Check the box next to it.
157 1. If you updated the version number in your local copy (instead of uninstalling), you must now click on the 'Installed Software' tab at the top of the window and click on the 'Update...' button.
158 1. Then continue, and just keep selecting the "Yes"/"OK"/"Approve"/etc buttons