Bean Scripting Framework in MapTool

Progress reports and musings from the developers on the current gaming tools.

Moderators: dorpond, trevor, Azhrei

Post Reply
User avatar
joshsziegler
Cave Troll
Posts: 38
Joined: Mon May 17, 2010 10:04 pm

Bean Scripting Framework in MapTool

Post by joshsziegler »

So I'm new to MT, but I'm looking at making some minor tweaks for my own use and noticed you have the BSF included in your build notes. I pulled down the source from SF and see the .jar but I'm not seeing exactly where you are using it. Is it used in MapTool at this point? Also, I noticed you're using v2.3, is there any push towards 3.x?

Update: Nevermind. I found what I was looking for.... really shouldn't be posting when I'm half-asleep. But the other question remains, are we moving towards 3.x?

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Bean Scripting Framework in MapTool

Post by Azhrei »

joshsziegler wrote:But the other question remains, are we moving towards 3.x?
I believe the BSF is only used for the build process as ANT requires it for executing the Pack200 ANT task.

There isn't a huge need for it (AFAICS) since LiveConnect supports Javascript code interfacing with Java objects out of the box. And there is no plan to support anything other than JS as an official scripting language.

User avatar
joshsziegler
Cave Troll
Posts: 38
Joined: Mon May 17, 2010 10:04 pm

Re: Bean Scripting Framework in MapTool

Post by joshsziegler »

Hmm, I'm not familiar with LiveConnect or Pack200 (though I did do the obligatory Google search). Looking through the source, it looks like you use Rhino for the embedded JavaScript which in turn uses BSF's API for JAVA scripting language support. Again, I'm not a Java Dev, so I could be wrong here. But if I'm right, it looks like BSF 3.x moved to the now standard (in Java) JSR-233 standard for Java scripting support in 1.6.x onward.

So while I'm curious because want to plug in another language for a "because I can" kind of personal side project, it also might make sense to move to 3.x if that API represents a the future of Java scripting support. Especially if MT is early in its implementation of JS, now would be the time to make the change to BSF 3.x. Even if the community is only looking to support JS, I would personally be leery about using an API/lib that might be deprecated later on. Just a thought...


Update: Bah, it looks like I am wrong. Rhino has been included in JRE 1.6R2 and so I assume it doesn't require BSF to be manually included.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Bean Scripting Framework in MapTool

Post by Azhrei »

joshsziegler wrote:So while I'm curious because want to plug in another language for a "because I can" kind of personal side project,
That would be cool. And we'd be interested in hearing about your progress and successes in that regard.
Update: Bah, it looks like I am wrong. Rhino has been included in JRE 1.6R2 and so I assume it doesn't require BSF to be manually included.
Correct. That's why the BSF library is only in the common.build directory and not under the MapTool/lib directory (i.e. it's not used by MapTool).

And actually, Rhino goes back further than that, to the late 1.5 releases and it is what pushed 1.6 to include the javax.script package as part of the env. (Well, it wasn't Rhino specifically, but the goal of having a scripting language built in and at the time Rhino was the engine of choice.)

Post Reply

Return to “Developer Notes”