Changes for page Embedding WOFrameworks
Last modified by Gavin Eadie on 2011/07/29 18:09
From version 54.1
edited by Ulrich Köster
on 2006/09/08 06:00
on 2006/09/08 06:00
Change comment:
There is no comment for this version
To version 57.1
edited by Kieran Kelleher
on 2008/09/04 12:55
on 2008/09/04 12:55
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. uli1 +XWiki.kieran - Content
-
... ... @@ -1,6 +1,111 @@ 1 +== Introduction == 2 + 3 +Below is outlined "simple embedding" concepts, however __full embedding__ **and** __split-installing__ are really recommended. This provides fully versioned self-contained bundles of both the application deployment bundle and the webserver deployment bundle. Read the docs on that technique for more **advantages**. This technique fully explained along with a ready-to-use ant build script is available at: 4 + 5 +[[Alternative Ant Build Script for Fully Embedded and Split Install Bundles]] 6 + 7 +== Simple Approach == 8 + 9 +This simple approach can be used to embed frameworks already **installed** on your development machine right into the app.woa bundle. 10 + 11 +Open your build.xml project file and change embed="false" to embed="true" for the appropriate directory paths in this section of the build.xml file inside the woapplication task 12 + 13 +{{code title="Default build.xml snippet"}} 14 + 15 +<frameworks root="${wo.wolocalroot}" embed="false"> 16 + <patternset> 17 + <includesfile name="woproject/ant.frameworks.wo.wolocalroot" /> 18 + </patternset> 19 +</frameworks> 20 +<frameworks root="${user.home}" embed="false"> 21 + <patternset> 22 + <includesfile name="woproject/ant.frameworks.user.home" /> 23 + </patternset> 24 +</frameworks> 25 +<frameworks root="${wo.wosystemroot}" embed="false"> 26 + <patternset> 27 + <includesfile name="woproject/ant.frameworks.wo.wosystemroot" /> 28 + </patternset> 29 +</frameworks> 30 + 31 +{{/code}} 32 + 33 +The most common choice is to embed locally installed WOnder and 3rd party frameworks that your app references by setting embed="true" on the wolocalroot frameworks dir as shown below: 34 + 35 +{{code title="Changes to build.xml to embed frameworks installed in /Library/Frameworks dir"}} 36 + 37 +<frameworks root="${wo.wolocalroot}" embed="true"> 38 + <patternset> 39 + <includesfile name="woproject/ant.frameworks.wo.wolocalroot" /> 40 + </patternset> 41 +</frameworks> 42 +<frameworks root="${user.home}" embed="false"> 43 + <patternset> 44 + <includesfile name="woproject/ant.frameworks.user.home" /> 45 + </patternset> 46 +</frameworks> 47 +<frameworks root="${wo.wosystemroot}" embed="false"> 48 + <patternset> 49 + <includesfile name="woproject/ant.frameworks.wo.wosystemroot" /> 50 + </patternset> 51 +</frameworks> 52 + 53 +{{/code}} 54 + 55 +The various dirs referenced in the build.xml from which you can select the embed option are: 56 + 57 +|= dir name |= Description 58 +| wo.wolocalroot | /Library/Frameworks/ 59 +\\Embedding these is most useful especially if you the codebase for these, like WOnder frameworks or your own, is frequently updated 60 +| user.home | /Library/Frameworks/ 61 +| wo.systemroot | /System/Library/Frameworks/ 62 +\\This is where Apple's WebObjects frameworks are installed and if your WebObjects version is consistent between your deployment and development platforms, then embedding these is not of much benefit. 63 + 64 +{{note title="Remember to..." bgColor="#FFFFCE"}} 65 + 66 +If you are working with framework source in your Eclipse workspace (which you should be\!), then it is critical that you build and install all frameworks before building the deployment bundles to ensure that the embedded frameworks are the same as the source you have been developing and testing with. See next subsection for one approcah to automating this. 67 + 68 +{{/note}} 69 + 70 +=== Pre-installing Workspace Frameworks Before Embedded Build === 71 + 72 +You could write a task to install the frameworks directly from the workspace, for example: 73 + 74 +{{code}} 75 + 76 + <!-- Install my own dependent frameworks in final local install location before embedding --> 77 + <target name="installMyFrameworks"> 78 + <ant dir="../WKDemography" target="install" inheritall="false" /> 79 + <ant dir="../WKEmailData" target="install" inheritall="false" /> 80 + <ant dir="../WKEOFExtensions" target="install" inheritall="false" /> 81 + <ant dir="../WKFoundation" target="install" inheritall="false" /> 82 + <ant dir="../WKPrototypes" target="install" inheritall="false" /> 83 + <ant dir="../WKRemoteClient" target="install" inheritall="false" /> 84 + <ant dir="../WKReports" target="install" inheritall="false" /> 85 + <ant dir="../WKWebObjects" target="install" inheritall="false" /> 86 + </target> 87 + 88 +{{/code}} 89 + 90 +... and then you could put a depends attribute on the build target to ensure the frameworks are installed before the embedded build task is executed: 91 + 92 +{{code}} 93 + 94 + <target name="build.woapp" depends="installMyFrameworks"> 95 + 96 +{{/code}} 97 + 98 +== Advanced Approach == 99 + 100 +**Caveat:** This example assumes that each framework you want to embed has an ant "build.xml" file with a "compileAndBuild" target. For frameworks you create yourself using WOLips, you will have this, but for a case where you are checking out individual Wonder framework projects from CVS, then you probably will not have such a build.xml file, so this approach is not quick to implement in that case unless you want to spend a lot of time working on ant build files to resolve the missing build.xml having a compileAndBuild target for those external projects. (KK 3/30/2007) 101 + 102 +---- 103 + 104 +See also [[FrameworkSet>>WOProject-FrameworkSet]] documentation. 105 + 1 1 Example for embedding WOFrameworks. 2 2 3 -It's an good ideaiscreate your own targets in the build.xml or even create your own build.xml (with a different name). This leaves the door open for an update of the default build.xml.108 +It's often a good idea to create your own targets in the build.xml or even create your own build.xml (with a different name). This leaves the door open for an update of the default build.xml. 4 4 5 5 Assume two projects: One named Foo( a framework) and the other named Uli (an application). The parent folder has another folder named packandgo. 6 6 ... ... @@ -11,7 +11,7 @@ 11 11 12 12 {{code}} 13 13 14 -<!-- package and go example--> 119 +<!-- package and go example--> 15 15 <frameworks root="../packageandgo/frameworks" embed="true"> 16 16 <include name="*.framework"/> 17 17 </frameworks> ... ... @@ -18,10 +18,11 @@ 18 18 19 19 {{/code}} 20 20 21 -2 compile target 126 +2 compile target 22 22 23 23 {{code}} 24 - 129 + 130 +<!-- package and go example--> 25 25 <fileset dir="../packageandgo/frameworks"> 26 26 <include name = "**/*.jar"/> 27 27 </fileset> ... ... @@ -28,8 +28,8 @@ 28 28 29 29 {{/code}} 30 30 31 - 32 - 33 33 The [[^build.xml]] from the packageandgo folder: 34 34 35 -Just invoke ant in the packageandgo folder and grap the App from applications folder within the packageandgo folder 139 +Just invoke ant in the packageandgo folder and grap the App from the applications folder within the packageandgo folder. 140 + 141 +[[image:FoldersAfterBuild.png]]