Package app.spellscroll.task
Class SpellscrollDevTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
app.spellscroll.task.SpellscrollDevTask
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
@DisableCachingByDefault(because="Launches an interactive application process")
public abstract class SpellscrollDevTask
extends org.gradle.api.DefaultTask
Gradle task that launches the Spellscroll application with the plugin loaded in dev mode.
Builds the command:
Spellscroll[.exe/.app] --plugindir <build/libs> --dev-plugin <pluginId> [--ignore-default-plugins-dir]
Gradle blocks until the Spellscroll process exits. Stopping the Gradle task (e.g. Ctrl+C) force-kills the child process. Subprocess stdout and stderr are merged and forwarded to the Gradle console via a daemon thread.
This task automatically depends on jar when the java plugin is present,
ensuring the plugin JAR is up-to-date before launch. Caching is disabled because the task
produces no outputs — it runs an interactive application.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.provider.Property<String>Absolute path to the Gradlebuild/libsdirectory, passed to Spellscroll via--plugindir.abstract org.gradle.api.provider.Property<Boolean>Whentrue, appends--ignore-default-plugins-dirto the Spellscroll command, preventing it from loading plugins from its default directory.abstract org.gradle.api.provider.Property<String>The plugin identifier passed to Spellscroll via--dev-plugin.abstract org.gradle.api.provider.Property<String>Path to the Spellscroll installation directory.voidlaunch()Resolves the Spellscroll executable, builds the launch command, and starts the process.Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
SpellscrollDevTask
public SpellscrollDevTask()
-
-
Method Details
-
getSpellscrollInstallDir
Path to the Spellscroll installation directory. The executable is resolved relative to this directory.- Returns:
- the Spellscroll install directory property
-
getPluginId
The plugin identifier passed to Spellscroll via--dev-plugin.- Returns:
- the plugin ID property
-
getIgnoreDefaultPluginsDir
Whentrue, appends--ignore-default-plugins-dirto the Spellscroll command, preventing it from loading plugins from its default directory.- Returns:
- the ignore-default-plugins-dir flag property
-
getBuildLibsDir
Absolute path to the Gradlebuild/libsdirectory, passed to Spellscroll via--plugindir. Marked@Internalbecause it is derived from the build directory and should not influence task up-to-date checks.- Returns:
- the build libs directory property
-
launch
Resolves the Spellscroll executable, builds the launch command, and starts the process.A daemon thread reads the subprocess output and forwards it to the console. The task blocks until the process exits. On
InterruptedException, the process is force-killed before re-throwing.- Throws:
IOException- if the process cannot be startedInterruptedException- if the current thread is interrupted while waiting for the processorg.gradle.api.GradleException- if the Spellscroll executable is not found
-