#436 How can I build a jar with specific package using BuildPod and jstub?

cjbaldoza Tue 20 Jan 2009

Hi, I have this in my build.fan

'using build

 class Build : BuildPod
  {
    override Void setup()
   {
    podName     = "sample"
    version     = Version("1.0")
    description = "Sample Fan Pod"
    depends     = ["sys 1.0"]
    srcDirs     = [`foo/bar/`]	

   }
  }'

Executing this will create a sample.pod. I can now convert this to jar file using jstub. I would like to have a package convention same with my srcDirs (e.g fan.sample.foo.bar). Is this possible?

Thanks!

brian Tue 20 Jan 2009

would like to have a package convention same with my srcDirs (e.g fan.sample.foo.bar)

Sorry, nothing like that is available today - everything is hardcoded to be fan.pod.Type, and the runtime is pretty hardwired to do linking using that convention. My vision for that is to eventually generate some kind of facade interfaces/classes which might also do a bit of translation (like using ints instead of longs).

So I guess you have jstub working to generate normal Java files? Just remember that Fan reflection won't work with that setup unless you also deploy the pod files (reflection is needed for -> dynamic invoke). Eventually we can still that meta-data in the jar file itself and load as Java resource.

cjbaldoza Thu 22 Jan 2009

Thanks Brian for the reply and don't worry with the package convention and the current implementation was ok with our setup.

The jstub is working great but I'm just wondering if there is an equivalent command for linux.

brian Thu 22 Jan 2009

Try this: copy the fant script and change the tool name to Jstub:

#!/bin/bash
. "${0%/*}/fanlaunch" 
fanlaunch Jstub "$@"

Login or Signup to reply.