public final class Extension
extends java.lang.Object
spine Gradle DSL extension.
Configures the project as a Java or/and a JavaScript project based on Spine.
| Modifier and Type | Method and Description |
|---|---|
void |
assembleModel()
Marks this project as a project that contains the Protobuf model definition.
|
JavaExtension |
enableJava()
Marks this project as a Java project and configures the Java code generation.
|
void |
enableJava(org.gradle.api.Action<JavaExtension> configuration)
Marks this project as a Java project and configures the Java code generation.
|
void |
enableJava(groovy.lang.Closure configuration)
Marks this project as a Java project and configures the Java code generation.
|
JavaScriptExtension |
enableJavaScript()
Marks this project as a JavaScript project and configures the JavaScript code generation.
|
boolean |
getForceDependencies()
Returns
true if the dependency enforcement is enabled for the current project. |
void |
setForceDependencies(boolean forceDependencies)
Enables or disables the dependency enforcement for the current project.
|
java.lang.String |
version()
Obtains the version of the framework.
|
public java.lang.String version()
In a Gradle plugin, reference spine.version() in order to obtain the current Spine
version.
public void enableJava(groovy.lang.Closure configuration)
configuration - Groovy style configurationenableJava()public void enableJava(org.gradle.api.Action<JavaExtension> configuration)
configuration - Java/Kotlin style configurationenableJava()@CanIgnoreReturnValue public JavaExtension enableJava()
Enables the Java code generation from Protobuf. If the spine-model-compiler plugin
is not applied to this project, applies it immediately. Also adds the
io.spine:spine-testlib
@CanIgnoreReturnValue public JavaScriptExtension enableJavaScript()
Enables the JS code generation from Protobuf. If the spine-proto-js-plugin is
not applied to this project, applies it immediately.
public void assembleModel()
Enables the protobuf and java plugins. Also adds the generated source
sets.
public boolean getForceDependencies()
true if the dependency enforcement is enabled for the current project.
If the option is enabled, certain dependencies will be forced to resolve to the versions needed by the Spine Bootstrap plugin.
public void setForceDependencies(boolean forceDependencies)
In Spine Bootstrap plugin, for some elements, it's necessary to have the particular
dependency no lower than version X in the project.
Set this field to true to ensure the "correct" dependency version is used
regardless of project environment.
In Gradle build script may be used as follows:
spine {
forceDependencies = true
}