User Tools

Site Tools


devel:plugin:setup

Project setup for a plugin

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):

build.gradle
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).

    1. In your command-line interface, run the $./gradlew idea command to generate the IntelliJ IDEA project for the newly created plugin.
    2. Open up your IDEA and then open the workcraft.ipr file to load the project.
    3. Once completed, make sure that the project can be built and ran.
    1. In your command-line interface, run the $./gradlew eclipse command to generate the Eclipse project for the newly created plugin.
    2. Open up your Eclipse and ensure that you have selected workcraft as the current workspace directory, when prompted to select a workspace directory.
    3. Import the project as necessary via File→Import…
    4. Once completed, make sure that the project can be built and ran (using the steps provided on Eclipse integration).

If everything has went smoothly, you are now ready to begin plugin development.