Debugging Extensions

Bob B's Avatar

Bob B

18 Jun, 2020 02:28 AM

Does anyone have any tips or suggestions for the best way to debug an extension. I'm new to all of this and right now I'm relying on try/catch to put up a message box with the error. but then I have to eidit the code, compile and try again. Is there a better way?

  1. 1 Posted by Bob B on 18 Jun, 2020 05:50 PM

    Bob B's Avatar

    I found this post that was very helpful. Has anyone been able to get extensions to build in IDEA without using the command line?

    https://infinitekind.tenderapp.com/discussions/moneydance-development/824-debugging-moneydance-extensions-in-eclipse

  2. 2 Posted by hleofxquotes on 21 Jun, 2020 04:57 PM

    hleofxquotes's Avatar

    Hi Bob B,

    In the past, I've worked on MD extension using Eclipse. I will describe my setup and hopefully, that will give you some starting points.

    The big picture: I created two projects

    • project1: has just the jar files of MD
    • project2: is my extension. project2 depends on project1
    • I then created an "empty" extension file (*.mxt). This is a normal extension package BUT I include no Java class in them. The reason I do this: so that when I start MD within Eclipse, MD will use the class in my project2 instead of the class in the embedded mxt file. Think of the mxt (with its meta data) as just a "glue" to allow MD to bring in the extension code.

    Other things I've done to make developing extension less painful

    • I create a set of Maven dependencies for MD since my dev env is Maven centric (and it will make tracking/switching various MD release much cleaner: just a change the version declaration instead of messing around with a bunch of jar files)
    • I put in a "hack" so that my dev instance (one started within Eclipse) will default in "current directory" for all of its configuration files so that during developing/testing I don't mess around with my actual/day-to-day MD files.

    With above setup, I was able

    • to do all developing tasks in Eclipse (no command line)
    • can create unit testings (via junit)
    • do nightly build (via maven)

    Hope this will give you some starting points. I don't use MD anymore, only popping in here infrequently.

    Good luck,

    See also: https://bitbucket.org/hleofxquotesteam/dist-md-chacha/wiki/Home

  3. 3 Posted by Bob B on 24 Jun, 2020 05:15 PM

    Bob B's Avatar

    Thanks for the great tips.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac