-
Notifications
You must be signed in to change notification settings - Fork 3
Class Compiler
Koder has a built in class compiler. Any files in your 'src' directory that Koder thinks are classes can be compiled and loaded into ScriptMaster automatically. Koder considers any files that end in ".java" or "class.groovy" to be classes.
##Why The reason for this is to reduce the number of compiles and project shifting you have to do when you want to use classes to encapsulate logic so you can use it in many ScriptMaster functions.
The normal way of doing this is to build your classes and compile them into Jars then load them into ScriptMaster and write some simple wrapper scripts to that use your class. This certainly works but what happens when you have a bug in your class? You have to go back to the project that contains the code for the class, fix the bug, compile the jar, load it into ScriptMaster, test to make sure it works there. Screw that! Way too many steps.
##The Koder Way With Koder, you write everything for your ScriptMaster Project in a single project. You can write your classes right in the 'src' directory along with groovy scripts that describe the FileMaker functions. There is no need to write, debug and compile your classes in a separate project.
When you run the class compiler, by clicking the Compile Classes button, Koder searches your src directory for Java Classes and for any Groovy files that end in "class.groovy", and compile them into a Jar file which is automatically loaded into ScriptMaster.
##Special Requirements For the Class Compiler. In order for the Class Compiler to work you need to have Groovy installed on your computer and you need to have the java build tools installed. These are NOT required to run ScriptMaster, or any plugins compiled with ScriptMaster. These are only required to develop with Koder.
I use HomeBrew to manage my Groovy install for the Mac. The Apple Java Install appears to have everything else you need.
if you are using and IDE to develop Groovy then you probably have everything. But you still might get an error when you compile classes. This seems to be due to some issue with which Java Runtime Environment is getting used. Make sure you have both a JRE and a JDK installed and that they match. You will also need to copy the tools.jar file from your JDK directory to your JRE directory. On my test computer this looked like this.
C:\Program Files\Java\jdk1.7.0_04\lib\tools.jar
to
C:\Program Files\Java\jre7\lib\tools.jar