Re: how to get the classpath to be set by XCode for added libs

Lachlan Deck <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hi there,

On 03/09/2006, at 8:40 AM, Chad Leigh wrote:

> I have not done any serious WO programming since 4.5, but I have  
> been doing hosting of java based WO since. I am helping someone now  
> and this person has an app that uses mysql. He has the mysql  
> connector jar and we are trying to get XCode to reference that in  
> the UNIXClassPath.txt file as HOMEROOT/Library/Java/ 
> mysql_connector.jar

The jar's called mysql-connector-java.jar isn't it?

> From what this person said, he added it as a lib to XCode and  
> rebuilt the app after moving the .jar to ~/Library/Java on his OS X  
> dev machine.
>
> What do we need to do so that XCode automatically makes the above  
> HOMEROOT entry in the UNIXClassPath.txt file.  If I make it by hand  
> the machine works fine so I know that is OK -- we just want it to  
> happen every time the app is rebuilt.

Xcode doesn't provide options for specifying search paths (e.g., ~/ 
Library/Java/file.jar:/Library/Java/file.jar:/System....). You could  
create an additional script-phase for the build process that can run  
last to rewrite the rule. Have a look at woaFrameworkMerge.pl (From  
project wonder) that can do this automatically. I've got a Run script  
phase that simply does 'perl ../scripts/woaFrameworkMerger.pl "$ 
{WRAPPER_DIR}"'. It bundles custom frameworks into the app/Frameworks  
and rewrites the classpath appropriately.

Perhaps easier (in this instance), if desired: you could put the jar  
in ${NEXTROOT}/Library/WebObjects/Extensions/ and not link it into  
the app. It'll be found automatically by the WO runtime. Just upgrade  
the jar when you upgrade mysql.

with regards,
--

Lachlan Deck
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.