Re: FMPP SourceFile Classpath

Daniel Dekany <[email protected]> Wed, 28 Oct 2009 15:43:41 +0100
Newsgroups gmane.comp.text.fmpp
Message-ID <[email protected]>
Wednesday, October 28, 2009, 2:39:00 AM, Daniel Dekany wrote:

> Wednesday, October 28, 2009, 1:01:26 AM, Shelley, Ryan wrote:
>
>> Is it possible to supply a classpath to the sources and
>> inheritConfiguration directives within a FMPP configuration file?
>
> No, that's a Java concern. You have to set up the Java environment
> *before* calling FMPP.

Which is not at all trivial to do for those who are not wrestled in
Java... so, here is the recipe:

(a) Easy but dirty solution: Just drop the jar into $FMPP_HOME/lib,
and it will automatically see it, but only when you are using the
$FMPP_HOME/bin/fmpp shell script for running the FMPP projects. This
has global effect in the sense that all FMPP projects that are run
with $FMPP_HOME/bin/fmpp will see the extra jars added there.

(b) The clean solution: Create a "lib" sub-directory in your FMPP
*project* directory, and drop the extra jar into there. Then, in the
same directory you should create a bash script (or .bat, on Windows)
that runs FMPP with your own custom class-path:

  On Linux/UN*X:

    java -cp ./lib/yourExtra1.jar:./lib/yourExtra2.jar:$FMPP_HOME/lib/fmpp.jar fmpp.tools.CommandLine

  On Windows:

    java -cp .\lib\yourExtra1.jar;.\lib\yourExtra2.jar;%FMPP_HOME%\lib\fmpp.jar fmpp.tools.CommandLine

Note that the scrip assumes that the working directory is already your
project directory (you may need to "cd" into it as the first step in
the script). Also it assumes that you have an FMPP_HOME environment
variable; if you don't have it, not a problem, just replace it with a
concrete path in the above scripts (or better, define the environment
variable locally in the scrip).

Yeah, someday I should invest into writing a native launcher app. that
does all the Java setup magic automatically... /-:

>> Thanks!
>>  
>> -Ryan 

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference