Class LionWebPlugin

java.lang.Object
io.lionweb.gradleplugin.LionWebPlugin
All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>

public class LionWebPlugin extends Object implements org.gradle.api.Plugin<org.gradle.api.Project>
The `LionWebPlugin` is a custom Gradle plugin for projects that utilize LionWeb for language engineering. It provides configurations, sensible defaults, and tasks for working with LionWeb language definitions and generating Java code representations of them.

The plugin performs the following responsibilities:

1. **Extension Registration**: - Registers an extension named `lionweb`. - Allows users to customize configurations such as: - Directory for LionWeb language definitions (`languagesDirectory`). - Directory for generated Java files (`generationDirectory`). - Target package name for generated Java classes (`packageName`). - Provides defaults if configurations are not explicitly defined: - `languagesDirectory` defaults to `src/main/lionweb` inside the project directory. - `generationDirectory` defaults to `build/generated-lionweb` inside the build directory.

2. **Task Registration**: - Adds a Gradle task named `generateLWLanguages`. - The task leverages the `GenerateLanguageTask` for processing LionWeb language files. - Configures the task with lazy connections from extension properties (`languagesDirectory`, `generationDirectory`, and `packageName`) to task inputs. - This task can generate Java code for LionWeb language definitions, streamlining the language engineering process.

The `LionWebPlugin` organizes the setup and execution of the LionWeb-based language engineering pipeline, making it easier to integrate with Gradle build systems.

  • Constructor Details

    • LionWebPlugin

      public LionWebPlugin()
  • Method Details

    • apply

      public void apply(org.gradle.api.Project project)
      Specified by:
      apply in interface org.gradle.api.Plugin<org.gradle.api.Project>