Gradle plugin for the State Machine Compiler (SMC) that makes it easier to use in a gradle project
The SMC project is hosted on sourceforge here: http://smc.sourceforge.net/. It serves to generate state machine code for you via supplying a DSL. Please see the website for more information.
Normally, use of SMC involves:
- Downloading the zip
- Unzipping it and extracting the Smc.jar to a directory in which you will run and the statemap.jar inot a directory that will link to your application code
- Writing your state machine in the SMC DSL
- Running the Smc.jar with some arguments to create your generated source and/or documentation artifacts into your source
- Compiling/assembling/running your project
This process is overly-manual when you have tools like gradle that are extensible enough to do those steps for you. Furthermore, the source you would actually like to control is the DSL--not the generated code. Therefore, smc-gradle-plugin does the following for you:
- Downloads the zip if necessary (you can configure this to not happen)
- Extracts only the necessary files from the zip, including either the Smc.jar or statemap.jar or both
- Inspects your source for .sm (by default) files.
- For each .sm file, it generates the state machine source in the appropriate generated directory and optionally, generates the state machine table and graphviz dot file
- Adds the generated source directory to the appropriate source set
- Android
- Java (maybe)
- Groovy (maybe)