For each of the exercises, you will need to create a new project directory whose name starts with an _
(underscore) and ends with Plugin
, e.g. _ExamplePlugin
. Note that directories starting with an underscore are automatically ignored both by Git and the distribution builder script, therefore this is a good way to add experimental plugins into your Workcraft build without it becoming part of the main Workcraft build.
In the root of the project directory, create a build.gradle
file that specifies the project's dependencies. In most cases, simple plugins will only depend on the Workcraft framework (i.e. the WorkcraftCore
project):
dependencies { compile project(':WorkcraftCore') }
The package for any Workcraft plugin should start with org.workcraft.plugins
followed by its name, e.g. example
. Therefore in the plugin's project root directory, create the following directory structure as appropriate, e.g. src/org/workcraft/plugins/example
.
To complete the project set up, go to the root directory of the Workcraft build and follow either step below depending on your development IDE (where more information can be found in Build Workcraft from sources).
$./gradlew idea
command to generate the IntelliJ IDEA project for the newly created plugin.workcraft.ipr
file to load the project.$./gradlew eclipse
command to generate the Eclipse project for the newly created plugin.workcraft
as the current workspace directory, when prompted to select a workspace directory. If everything has went smoothly, you are now ready to begin plugin development.