Infinite Kind - Development Kit

This is a toolkit that will assist in the creation of java/kotlin and python extensions for the Moneydance personal finance application.
Extensions can be compiled, packaged, and signed using the bundled GRADLE build tool.

The Gradle build tool is open source, developed by Gradle Inc, and released under the Apache License 2.0

The Moneydance Developers Kit includes:
- gradle wrapper (gradlew) build tools and build script and settings
  - the "gradle" folder containing gradle wrapper's license and files.
  - at project root, the "build.gradle" script, "settings.gradle", "gradle.properties", and the "gradlew" / "gradlew.bat" executable files.
- the "userconfig" folder which contains the "user.properties" file (for you to edit and store your own properties)
- "lib" folder and jar files to compile and build an extension, and working sample source code for a new extension.
- API documentation for Moneydance can be found in the "Developer" section of http://infinitekind.com/moneydance

Note: The complete Moneydance Open Source repository can be obtained by cloning: https://github.com/TheInfiniteKind/moneydance_open.git
      But this is optional and not required for this standalone development kit unless you have more advanced requirements

INITIAL STEPS
1. from project's root folder execute "./gradlew --version" to verify that gradle 9.x is operating correctly

2. create/edit "/userconfig/" using a plain text editor and set "extprivkeypass=" to a passphrase of your choice

3. Before building your extension, you will first need to generate a key pair.  This can be done by running "./gradlew genKeys" from the root folder.  You will be prompted for a passphrase that is used to encrypt the private key file.  Your new keys will be stored within the "userconfig" folder in the "priv_key" and "pub_key" files.

USAGE:
Once your keys have been generated, you are ready to compile an extension. The "build.gradle" file has been set up to compile and build the sample extension with ID "myextension".  The source code for this sample extension can be found under: src/com/moneydance/modules/features/myextension/

To compile and package the sample extension, run "./gradlew myextension" from the root folder. After the extension is compiled and built, assuming you have setup your "extprivkeypass" and generated your key files, then these will be used to sign the extension and place the new extension file in the "dist" folder with the name "myextension.mxt". Please feel free to modify the source to the "myextension" extension to build your own extensions.

If you would like to share your extension with others and would prefer they not see the unrecognized-signature warning when loading the extension then you can send your source code to support@moneydance.com where we will inspect the source code for security problems, compile the extension, and sign it with the official moneydance key.  If you like, we can then also put the extension into the list of available extensions for all Moneydance users to see.

TO CREATE YOUR OWN EXTENSION
To create your own extension that is separate from the sample extension you must first come up with a unique ID for your extension. An extension ID is all lower case and alphanumeric.  For this example, let's say your new extension ID is "newextension".  You would take the following steps to set up the development environment for the new extension:

1) Copy the files from: src/com/moneydance/modules/features/myextension/
                    to: src/com/moneydance/modules/features/newextension/

               or from: python_scripts/mypythonextension/
                    to: python_scripts/newpythonextension/

2) Edit the new java source files to change the package names from com.moneydance.modules.features.myextension to com.moneydance.modules.features.newextension
   >> when loading an extension, Moneydance looks for the class: com.moneydance.modules.features.{extensionid}.Main

  or for python, edit the script file names/content accordingly, and also update script_info.dict file.

  For all extension types the meta_info.dict also needs updating

3) Add a "newextension" target to the "build.gradle" file.  This can be done easily by duplicating the java/kotlin "myextension" or python "mypythonextension" task in the "build.gradle" file.

  for java/kotlin, add registerFeature("extensionid")
  for python,      add registerPythonModule("extensionid")

4) At this point you can run "./gradlew newextension" from the root folder and your new extension will be built and placed in the "dist" directory.

NOTES:
- This DevKit's build scripts use Gradle Wrapper 9.x
- Kotlin is the recommended language for new extensions.
- Java is equally supported if preferred, and Java and Kotlin can be mixed within the same extension.
- Whether written in Kotlin or Java, extensions run on Moneydance's bundled JVM.
- The minimum JDK version is 17; JDK 25 is recommended. Java source, target and release levels should be locked to 17.
- When using Kotlin, use at least the 1.9.x Kotlin plugin with the language and API versions locked to 1.9.
- Kotlin plugin 2.3.21 is the latest release that supports Kotlin language/API version 1.9.
- Compile against the bundled kotlin-stdlib 1.9.x jar to match the Kotlin language/API version.
- When using this DevKit's bundled Gradle build, the recommended Java and Kotlin versions are configured automatically.
- These version recommendations provide the best chance of backwards compatibility with previous Moneydance releases.

To override the JDK used by your local Gradle wrapper, add the following to your Gradle user properties file:

  org.gradle.java.home=<path_to_jdk>/Contents/Home

  macOS/Linux: ~/.gradle/gradle.properties
  Windows:     %USERPROFILE%\.gradle\gradle.properties


FURTHER ASSISTANCE
If you would like further assistance, please contact support@infinitekind.com
We will be more than happy to answer any questions.

