Building with Ant

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

Moderators: dorpond, trevor, Azhrei

smaudet2
Cave Troll
Posts: 70
Joined: Sun Mar 01, 2015 12:57 am

Building with Ant

Post by smaudet2 »

This is intended as a guide for people who don't want to use Eclipse, but would prefer using a modern IDE like Netbeans/IntelliJ, or another build system such as a CI, or just the command line and a decent text editor.

NOTE: THIS IS A WORK IN PROGRESS

NOTE2: This is for the svn build (1.3). This is mainly to help you get up and running if you need to quickly patch something and using 1.4 isn't an option for some reason (like 1.4 doesn't exist yet).

There is a github work in progress here, although please note that the project isn't finished being ported.

https://github.com/RPTools/

Build environment.

Before you even start, you may want to setup your environment a bit.

On windows, I recommend creating a bin directory in %userprofile% and sticking a reference to ant in there. You then need to add your ~/bin to your %PATH%. On Linux, I do the same thing. Update your .bashrc with e.g.:

export ANT_HOME=/opt/ant
export PATH=$ANT_HOME/bin:$PATH

I also recommend that you create some development directory, and you create a folder 'rptools' under that. When you run the commands below, be sure to run them from within that directory (e.g. ./devel/rptools/). This is not necessary, but it will keep things cleaner and saner for yourself.

1) Getting the source.
2) Getting Ant
3) Loading the (fixed) build files
4) Building
5) Creating the distribution
6) Testing

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Building with Ant

Post by RPTroll »

I need to go delete my last post. :)

Here's what Az said about building the tools from SVN. Not sure how it applies to GIT.
Most tools are pretty simple. If you’re using Eclipse, just right-click on the build.xml and choose Build > Java Application (at least, I think that’s the option; or something like it).

MapTool has a much more complicated process because it gets updated a lot and has the Web Start integration (because of Web Start, each build has to separately record the libraries that are needed in a text file so that the JNLP can have the correct resources listed in it). Then all that information needs to be uploaded to the rptools.net web site in a manner that old stuff doesn’t get overwritten (the current version has its information in maptool-development.txt but older versions use their version number, as in maptool-1.3.b91.txt).

Note that the build.xml for MapTool tries to accomplish as much as it can in an automated manner. But building the DMG for Mac OS can only be done on a Mac (although building the .app is possible on Windows with Oracle’s JarBundler). And building the DMG requires an AppleScript to set some of the DMG characteristics.

I have a text file that lists each of the steps that are involved and the tools I used to do the build. Since Craig was somehow able to make sense of that mess when I sent it to him (for 1.3.b91) I guess it’s at least partially understandable…?

That same text file references some scripts I have for doing a lot of the stuff. For example, a script called buildDMG takes the .app and adds some supporting files and creates the DMG.

I think CharTool has a different build process as well because of the library that defines how characters are built for different game systems. But the only tools I’ve ever built are MT and TT (and I had problems getting TT to build last time I tried).

All of that stuff that I have should be uploaded to a legacy/ section of the Github site, I suppose, so that others have access to it. I just changed the JarBundler XML configuration to use the MapTool launcher so I will at least get that uploaded (since the version Craig has will be out of date with respect to running MT instead of the launcher).
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Building with Ant

Post by Jagged »

smaudet2 wrote:This is intended as a guide for people who don't want to use Eclipse, but would prefer using a modern IDE like Netbeans/IntelliJ
Ha!

smaudet2
Cave Troll
Posts: 70
Joined: Sun Mar 01, 2015 12:57 am

Re: Building with Ant

Post by smaudet2 »

I've used Eclipse in past - and it is responsible for a good chunk of my IDE hate. Clunky, bloated, and plagued with version/plugin issues.

That being said, IntelliJ got me back on board with using an IDE for Java, which is pretty big since I'd pretty much sworn them off. If you've not tried it I seriously suggest it. Its heads and heels over the (lack of) competition.

Anyways I don't really want to turn this into an IDE wars thread. Go take your 'ha' elsewhere, its not welcome in this thread. :)

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Building with Ant

Post by Jagged »

He says after posting an IDE wars post! :roll:

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Re: Building with Ant

Post by Craig »

RPTroll wrote:I need to go delete my last post. :)

Here's what Az said about building the tools from SVN. Not sure how it applies to GIT.
In the build-resources directory there is a README.md file which contains instructions for building.
You can view it online using following link (and of course you get it when you check out the source)
https://github.com/RPTools/maptool/blob ... /README.md

No IDE requirements.

smaudet2
Cave Troll
Posts: 70
Joined: Sun Mar 01, 2015 12:57 am

Re: Building with Ant

Post by smaudet2 »

Craig wrote:
RPTroll wrote:I need to go delete my last post. :)

Here's what Az said about building the tools from SVN. Not sure how it applies to GIT.
In the build-resources directory there is a README.md file which contains instructions for building.
You can view it online using following link (and of course you get it when you check out the source)
https://github.com/RPTools/maptool/blob ... /README.md

No IDE requirements.
It says as much in the OP that this post was/is for the svn. I also noticed later another ant build thread on here...but neither thread is stickied ATM.

smaudet2
Cave Troll
Posts: 70
Joined: Sun Mar 01, 2015 12:57 am

Re: Building with Ant

Post by smaudet2 »

Btw I'm reviving this thread...

I know there's a gradle build (meh) and new stuff, but no dicetool in git, and the current dicetool sucks donkey balls.

I'll repost if/when I figure this dicetool build out. There were several problems, understanding them is probably important for getting something into the WIP git repository.

EDIT: Well, I fixed dicetool. Didn't fix the ant build, I know I had something nicer setup before that could pull in a bunch of ivy files...I'm guessing that's what I linked to in the server headless build elsewhere. Going to take a break for a bit, get a coffee... then see why the new 1.4 stuff isn't all in git/how that works (or doesn't).

EDIT2: Gradle's not that bad - heck, building the old ant project with gradle could be a fun (if perhaps pointless) task, it would keep the old codebase more maintainable that what it is today. There *is* a git repository for the old svn-style code, so its totally a thing that could be done (and I have it downloaded to my computer). Of course, not sure if its being maintained...

EDIT3: It works! Brand spanking clean & new, (well, there's plenty of room for improvement): https://github.com/RPTools/dicetool/pull/1
Gradle 3.4.1 looks like its come a LONG way from the 2.x era, it looks a lot more like a simple maven build, which is kinda sweet. It does most of the ugly packaging you guys are doing by hand for you (yay), seriously the other projects could do with a retrofit to remove some of the extra junk on their gradle builds.

Note, that this is NOT a fix for the old svn stuff. I think it would still be a great project for somebody trying to learn ant/gradle to go integrate the old ant codebase (1.3X) with gradle.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Building with Ant

Post by JamzTheMan »

Welcome aboard. Feel free to submit pr's for the 1.4.1-dev branch. We should be starting 1.4.3 dev soonish...

Be interested in seeing what the gradle changes would be...
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

smaudet2
Cave Troll
Posts: 70
Joined: Sun Mar 01, 2015 12:57 am

Re: Building with Ant

Post by smaudet2 »

Sure, if I do gradle changes I'd want to do them to the dev branch...just a heads up that the PR I have won't be going to any dev branch because there isn't one.

...not sure yet but I get the suspicion that you forget there is more than just maptool in your arsenal...you have something like 10 different repositories, when all is said and done, and that's only git. svn + git nets you 12, your extra undocumented dependency nets you 13, and since TokenTool didn't build right/there was nothing to pull one of your deps from, I'm guessing it may be as high as 20...

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Building with Ant

Post by JamzTheMan »

There are the other "tools" but I'm not sure how much the others get used. TokenTool is still popular but the others haven't had active development in years...

I proposed that we combined rplib into MapTool repo as a sub project and roll most of the tokentool functionality into MapTool (as it would be nice to change/edit tokens on the fly inside MapTool). But I'm not the owner of the repo/project, just a contributor that customizes MT for my own use and submits those changes back to the powers to be. So these are just my thoughts.

And FYI, just request a dev-branch for TokenTool if you want. Or submit to master, it doesn't matter as much. The current changes I have in progress for TT is a complete rewrite anyway so not worrying about merging down the line.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

smaudet2
Cave Troll
Posts: 70
Joined: Sun Mar 01, 2015 12:57 am

Re: Building with Ant

Post by smaudet2 »

JamzTheMan wrote:There are the other "tools" but I'm not sure how much the others get used. TokenTool is still popular but the others haven't had active development in years...

I proposed that we combined rplib into MapTool repo as a sub project and roll most of the tokentool functionality into MapTool (as it would be nice to change/edit tokens on the fly inside MapTool). But I'm not the owner of the repo/project, just a contributor that customizes MT for my own use and submits those changes back to the powers to be. So these are just my thoughts.

And FYI, just request a dev-branch for TokenTool if you want. Or submit to master, it doesn't matter as much. The current changes I have in progress for TT is a complete rewrite anyway so not worrying about merging down the line.
[s]Are you able to see the PR?[/s]

[s]DiceTool, not TokenTool (I actually recently used it while GMing). You speak as if you can't see it, why I ask...[/s]

Nvm I realized what you meant, sorry! It doesn't appear you have strike-through.

There are several features I wanted to add to it.

I'm also a bit of the opposite mind - small tools are easier to understand and grok than large tools, esp. if they share common syntax etc. You can spend a bunch of time trying to make the MapTool program easier to use for newcomers...or you can cut the cruft and launch some basic tools. I am not going to launch the whole of MapTool and dig through the many menus, configure them to show me mostly just the dice, if all I want to use is DiceTool (I may want to use it eventually but for now it fits my needs fairly well).

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Building with Ant

Post by jfrazierjr »

smaudet2 wrote:
JamzTheMan wrote:There are the other "tools" but I'm not sure how much the others get used. TokenTool is still popular but the others haven't had active development in years...

I proposed that we combined rplib into MapTool repo as a sub project and roll most of the tokentool functionality into MapTool (as it would be nice to change/edit tokens on the fly inside MapTool). But I'm not the owner of the repo/project, just a contributor that customizes MT for my own use and submits those changes back to the powers to be. So these are just my thoughts.

And FYI, just request a dev-branch for TokenTool if you want. Or submit to master, it doesn't matter as much. The current changes I have in progress for TT is a complete rewrite anyway so not worrying about merging down the line.
[s]Are you able to see the PR?[/s]

[s]DiceTool, not TokenTool (I actually recently used it while GMing). You speak as if you can't see it, why I ask...[/s]

Nvm I realized what you meant, sorry! It doesn't appear you have strike-through.

There are several features I wanted to add to it.

I'm also a bit of the opposite mind - small tools are easier to understand and grok than large tools, esp. if they share common syntax etc. You can spend a bunch of time trying to make the MapTool program easier to use for newcomers...or you can cut the cruft and launch some basic tools. I am not going to launch the whole of MapTool and dig through the many menus, configure them to show me mostly just the dice, if all I want to use is DiceTool (I may want to use it eventually but for now it fits my needs fairly well).
I had a plan to rebuild Dicetool a few years ago. I got started and had about 1/3rd of the back end coding changes done on top of the new Parser instead of the existing JEP math engine, but life puked on me and I stopped playing RPG's for 3-4 years. I had also planned to port the UI to JavaFX, but never got beyond some initial trial mock ups of the main window.

My main goal and one of the things I worked with Craig on (who re-wrote the parser) is to have each and every role returned by the parser and let the calling application deal with the formatting and possible accumulation of sums IF NEEDED(the parser still does this, but it also returns each step in the process so that you the originating application can show those steps in detail if you so choose. The origirinal parser took an expression and returned a string (or int, I don't remember). The new one returns a ResultSet object(or something like it) which contains a field to hold the same value as the original parser would as well as an hashmap of each sub-expression. or at least that was my ideas. This could also allow for named groups of evaluations(similar to how regex groups can be named) for output to the DiceTool "row" along with the evaluated value.

At least that was the plan. I hope to get back to this some day.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Building with Ant

Post by JamzTheMan »

What does dice tool offer that countless other choices don't? (honest question)

I roll all real dice so never use em but if I did need one, I think I would just download an android app or an online app, especially one with graphics/3d dice. If I were playing online, I'd want my dice in chat so the VTT I'm using would have it, or slack, or the forum, or what ever else.

I just can't imagine (and I may be totally wrong), but are we getting a lot of downloads still for a java swing based dice roller?
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Building with Ant

Post by Full Bleed »

I don't use dice tool. Precisely because it never seamlessly integrated into Maptool... and there is nothing MT couldn't do for my games.

I think I downloaded Dice Tool nearly a decade ago... and then failed to see the point of it.

Fantasy Grounds still has the best VTT dice roller out there. If a new version of MT's dice roller built on FX can't measure up, I don't see why anyone would bother. Maybe I just don't play the types of games that need what Dice Tool does over what MT already does.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Post Reply

Return to “Developer Notes”