B4J Question Feature or Bug? CustomBuildAction and calling another Jar

tchart

Well-Known Member
Licensed User
Longtime User
Not sure if this is a feature or bug but I'd like to know so I can depend on it or look for another method.

I have a CustomBuildAction that calls another Jar (to do some work) during the build. The other Jar references File.DirApp in its code.

What I have noticed is that File.DirApp (in the other Jar being called) appears to be the directory of the B4J project I am working in and not the other Jar I am calling.

So to clarify, I am in a B4J project for ABC. The CustomBuildAction calls XYZ.JAR with no parameters. If I output File.DirApp from XYZ.jar during the CustomBuildAction it is showing the directory for ABC.

Is this a bug or a feature? The behaviour is desirable but I just want to make sure it is correct.
 

Roycefer

Well-Known Member
Licensed User
Longtime User
In general, File.DirApp will be the working directory of the command that started the jar. It sounds like your CustomBuildAction probably calls XYZ.jar directly without changing the working directory. Therefore, the working directory (and File.DirApp) will be the Objects folder for ABC.jar.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Thanks @Roycefer thats a good explanation! Like I said, if the behaviour is expected then that is good as it is a bonus for me.
 
Upvote 0
Top