Package app.spellscroll.task
Class SpellscrollInitUiTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
app.spellscroll.task.SpellscrollInitUiTask
- 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="One-time scaffolding task that creates project files")
public abstract class SpellscrollInitUiTask
extends org.gradle.api.DefaultTask
Gradle task that scaffolds a new Spellscroll UI module at the configured directory.
This is a one-time setup task. It fetches the latest @spellscroll/ui-sdk
version from the npm registry and generates three files:
package.json— npm project with@spellscroll/ui-sdkdependency andbuild/servescripts.spellscroll.config.js— esbuild configuration (entry point, output paths, dev server port 3001).src/main.jsx— starter React component usinguseSpellscrollMessaging().
Each file is skipped individually if it already exists, making the task safe to re-run. Caching is disabled because the task performs network I/O and writes project files that should only be generated once.
Run with:
./gradlew spellscrollInitUi
-
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>Human-readable plugin name used to derive the React component name and the npm package name inpackage.json.abstract org.gradle.api.provider.Property<String>Path to the directory where the UI module will be scaffolded.voidinitUi()Entry point: fetches the latest@spellscroll/ui-sdkversion, then writes the three scaffold files intogetUiModuleDir().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
-
SpellscrollInitUiTask
public SpellscrollInitUiTask()
-
-
Method Details
-
getUiModuleDir
Path to the directory where the UI module will be scaffolded. The directory is created if it does not exist.- Returns:
- the UI module directory property
-
getPluginName
Human-readable plugin name used to derive the React component name and the npm package name inpackage.json.- Returns:
- the plugin name property
-
initUi
Entry point: fetches the latest@spellscroll/ui-sdkversion, then writes the three scaffold files intogetUiModuleDir().- Throws:
IOException- if a scaffold file cannot be writtenInterruptedException- if the current thread is interrupted during the npm registry request
-