Changes for page Building and Installing a Framework with Ant
Last modified by Markus Ruggiero on 2025/10/24 16:16
From version 29.1
edited by David Avendasora
on 2011/04/25 17:37
on 2011/04/25 17:37
Change comment:
There is no comment for this version
To version 18.1
edited by D Tim Cummings
on 2013/12/18 02:39
on 2013/12/18 02:39
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -Building and Installing a WOFramework with Ant1 +Building and Installing a Framework with Ant - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. avendasora1 +XWiki.timcu - Content
-
... ... @@ -1,75 +1,183 @@ 1 -= Building = 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}} 2 2 3 -{{note title="Requires WebObjects"}} 4 4 5 -These build instructions require the WebObjects frameworks to already be installed in the normal location: 6 -* Mac OS X: {{/System/Library/Framworks/}} 7 -* Linux: {{/Library/Frameworks}} 8 8 9 -Otherwise you will get compiler errors like this: 10 -{noformat} 11 -[wocompile] /Wonder/WonderGit/WonderSource/Frameworks/Core/JavaWOExtensions/Sources/com/webobjects/woextensions/JSAlertPanel.java:10: 12 - package com.webobjects.appserver does not exist 7 +{{toc maxLevel="3"/}} 8 + 9 += Before You Build = 10 + 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]]. 12 + 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. 14 + 15 +Where Ant looks for this property is different for each method of building a Framework: 16 + 17 +1. ((( 18 +====== WOJenkins Jobs ====== 19 + 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 ====== 25 + 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"}} 76 +If Ant can't find the WebObjects frameworks, you will get compiler errors like this: 77 + 78 +{{noformat}} 79 +[wocompile] /MyProjects/MyFramework/Sources/com/mycompany/myapp/myclass:10: 80 + package com.webobjects.appserver does not exist 13 13 [wocompile] import com.webobjects.appserver.WOContext; 14 -{noformat} 15 15 83 +{{/noformat}} 16 16 {{/note}} 17 17 86 += Building = 87 + 88 +=== WOJenkins === 89 + 90 +Using Jenkins is the recommended way to build a Framework and WOJenkins makes the process almost as easy as building from within Eclipse/WOLips. 91 + 92 +=== Eclipse/WOLips === 93 + 94 +* ((( 95 +===== Standard WebObjects Framework ===== 96 + 97 +Right-Click on your project in Eclipse and select **WOLips Ant Tools > Install** 98 + [[image:attach:WOLipsAntInstall.png]] 99 +This will build and install the framework in the location defined in the WOLips preferences, overwriting any previously installed version of the framework. 100 + 101 +{{note title="BUILD FAILED"}} 102 +If Ant can't write to the WebObjects frameworks directory, you will get an error like this: 103 + 104 +{{noformat}} 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 + 18 18 === Command Line / Terminal === 19 19 20 -* h5. Standard WebObjects Framework 21 -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) 22 22 23 -{{code value="none"}} 126 +* ((( 127 +===== Standard WebObjects Framework ===== 24 24 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"}} 25 25 cd /my/project/ 26 26 ant build 27 27 28 28 {{/code}} 29 29 30 -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 +))) 31 31 32 -* h5. **Project Wonder Frameworks33 - Ifyou are buildingProject Wonder'sframeworksyou will use these commands instead:**140 +* ((( 141 +===== Project Wonder Frameworks ===== 34 34 35 - {{codevalue="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. 36 36 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"}} 37 37 cd /path/to/Wonder 38 38 ant frameworks 39 39 40 40 {{/code}} 41 41 42 -By default, all the Wonder frameworks will be built to (##/Roots##) directory 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 +))) 43 43 44 -= ==Eclipse/WOLips===158 += Customizing the Build = 45 45 46 - ===Hudson/Jenkins===160 +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. 47 47 48 -In general, it isrecommendedthat 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.162 += Installing = 49 49 50 -{{tip title="Pro Tip"}} 51 -If you use Hudson/Jenkins to build your WebObjects applications, then you do not need to actually build or install the Project Wonder frameworks on your development machine, just having the individual Wonder source code projects open in your eclipse workspace is sufficient. Your Hudson/Jenkins server will need the built frameworks installed. See the [Hudson/Jenkins Page|WO:Installing and Using the Hudson build server] for more information. 52 -{{/tip}} 164 +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. 53 53 54 -=== Installing === 55 - 56 -Assuming you already cloned and installed Wonder from source using the method outlined above, you can use the following procedure pull the latest changes into your local repository. 57 - 58 58 ===== Install the frameworks ===== 59 59 60 -{{code value="none"}}61 -sudo ant frameworks.install 168 +{{code 0="none"}} 169 +sudo ant -Duser.home=$HOME frameworks.install 62 62 {{/code}} 63 63 64 -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: 65 65 66 -* Mac OS X: ##/Library/Framworks/##67 -* 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}} 68 68 69 69 You can combine the build and install steps by simply executing this Ant command: 70 70 71 -{{code value="none"}}72 -sudo ant frameworks frameworks.install 179 +{{code 0="none"}} 180 +sudo ant -Duser.home=$HOME frameworks frameworks.install 73 73 {{/code}} 74 74 75 75 === Upgrading === ... ... @@ -76,32 +76,38 @@ 76 76 77 77 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. 78 78 79 -1. h5. Navigate to the original Wonder source directory that you created above during initial source installation 187 +1. ((( 188 +===== Navigate to the original Wonder source directory that you created above during initial source installation ===== 80 80 81 -{{code value="none"}}190 +{{code 0="none"}} 82 82 cd /path/to/WonderSource 83 83 {{/code}} 193 +))) 194 +1. ((( 195 +===== Pull the changes you do not have and merge them with your local repository ===== 84 84 85 -1. h5. Pull the changes you do not have and merge them with your local repository 86 - 87 -{{code value="none"}} 197 +{{code 0="none"}} 88 88 git pull 89 89 {{/code}} 200 +))) 201 +1. ((( 202 +===== Build the frameworks. ===== 90 90 91 -1. h5. Build the frameworks. 92 - 93 -{{code value="none"}} 204 +{{code 0="none"}} 94 94 ant frameworks 95 95 {{/code}} 207 +))) 208 +1. ((( 209 +===== Navigate to the Roots directory that was automatically created by the initial Source installation procedure above ===== 96 96 97 -1. h5. Navigate to the Roots directory that was automatically created by the initial Source installation procedure above 98 - 99 -{{code value="none"}} 211 +{{code 0="none"}} 100 100 cd ~/Roots/ 101 101 {{/code}} 214 +))) 215 +1. ((( 216 +===== Delete all installed frameworks whose names match the built frameworks in this Roots build folder ===== 102 102 103 -1. h5. Delete all installed frameworks whose names match the built frameworks in this Roots build folder 104 - 105 -{{code value="none"}} 218 +{{code 0="none"}} 106 106 for FRAMEWORK in `echo *.framework`; do sudo rm -r /Library/Frameworks/${FRAMEWORK}; done 107 107 {{/code}} 221 +)))