Skip to content

Vite for Gradleopensavvy.gradle.vite.base.tasksViteExec

ViteExec

@CacheableTask
abstract class ViteExec @Inject
 constructor(process: ExecOperations) : DefaultTask

Executes a Vite command in the context of this project.

For example, to run vite build:

tasks.register("viteBuild", ViteExec::class) {
    command.set("build")
    workingDirectory.set(project.layout.buildDirectory.dir("foo").asFile.toString())

    nodePath.set("…path to your Node installation…")
    vitePath.set("…path to your Vite installation…")
}

Constructors

ViteExec

@Inject
constructor(process: ExecOperations)

Properties

arguments

@get:
Input
abstract val arguments: ListProperty<String>

Arguments passed to command.

command

@get:
Input
@get:
Optional
abstract val command: Property<String>

The Vite command to execute, for example run or build.

config

abstract val config: ViteConfig

The Vite configuration.

configurationFile

@get:
InputFile
@get:
PathSensitive
(value = PathSensitivity.RELATIVE)abstract val configurationFile: RegularFileProperty

The path to the vite.config.js file.

enabled

@get:
Internal
var enabled: Boolean

hasCustomActions

impliesSubProjects

nodePath

@get:
Internal
abstract val nodePath: RegularFileProperty

The path to the Node executable.

state

val state: TaskStateInternal

timeout

val timeout: Property<Duration>

vitePath

@get:
InputFile
@get:
PathSensitive
(value = PathSensitivity.RELATIVE)abstract val vitePath: RegularFileProperty

The path to the Vite executable.

workingDirectory

@get:
Input
abstract val workingDirectory: Property<String>

The directory in which the command will be executed.

Functions

acceptServiceReferences

open override fun acceptServiceReferences(serviceReferences: MutableSet<ServiceReferenceSpec>)

appendParallelSafeAction

open override fun appendParallelSafeAction(action: Action<in Task>)

compareTo

open operator override fun compareTo(other: Task): Int

config

fun config(block: ViteConfig.() -> Unit): ViteConfig

configure

open override fun configure(closure: Closure<Any>): Task

dependsOn

open override fun dependsOn(vararg paths: Any): Task

doFirst

open override fun doFirst(action: Closure<Any>): Task
open override fun doFirst(action: Action<in Task>): Task
open override fun doFirst(actionName: String, action: Action<in Task>): Task

doLast

open override fun doLast(action: Closure<Any>): Task
open override fun doLast(action: Action<in Task>): Task
open override fun doLast(actionName: String, action: Action<in Task>): Task

doNotTrackState

open override fun doNotTrackState(reasonNotToTrackState: String)

execute

fun execute()

finalizedBy

open override fun finalizedBy(vararg paths: Any): Task

getActions

open override fun getActions(): MutableList<Action<in Task>>

getAnt

open override fun getAnt(): AntBuilder

getAsDynamicObject

@Internal
open override fun getAsDynamicObject(): DynamicObject

getConvention

@Internal
open override fun getConvention(): Convention

getDependsOn

open override fun getDependsOn(): MutableSet<Any>

getDescription

open override fun getDescription(): String?

getDestroyables

open override fun getDestroyables(): TaskDestroyables

getDidWork

open override fun getDidWork(): Boolean

getExtensions

open override fun getExtensions(): ExtensionContainer

getFinalizedBy

open override fun getFinalizedBy(): TaskDependency

getGroup

open override fun getGroup(): String?

getIdentityPath

open override fun getIdentityPath(): Path

getInputs

open override fun getInputs(): TaskInputsInternal

getLifecycleDependencies

@Internal
open override fun getLifecycleDependencies(): TaskDependencyInternal

getLocalState

open override fun getLocalState(): TaskLocalState

getLogger

open override fun getLogger(): Logger

getLogging

open override fun getLogging(): LoggingManager

getMustRunAfter

open override fun getMustRunAfter(): TaskDependency

getName

open override fun getName(): String

getOnlyIf

open override fun getOnlyIf(): Spec<in TaskInternal>

getOutputs

open override fun getOutputs(): TaskOutputsInternal

getPath

open override fun getPath(): String

getProject

open override fun getProject(): Project

getReasonNotToTrackState

open override fun getReasonNotToTrackState(): Optional<String>

getReasonTaskIsIncompatibleWithConfigurationCache

getRequiredServices

open override fun getRequiredServices(): TaskRequiredServices

getSharedResources

open override fun getSharedResources(): MutableList<ResourceLock>

getShouldRunAfter

open override fun getShouldRunAfter(): TaskDependency

getStandardOutputCapture

open override fun getStandardOutputCapture(): StandardOutputCapture

getTaskActions

open override fun getTaskActions(): MutableList<InputChangesAwareTaskAction>

getTaskDependencies

open override fun getTaskDependencies(): TaskDependencyInternal

getTaskIdentity

open override fun getTaskIdentity(): TaskIdentity<*>

getTemporaryDir

open override fun getTemporaryDir(): File

getTemporaryDirFactory

open override fun getTemporaryDirFactory(): Factory<File>

hasProperty

open override fun hasProperty(propertyName: String): Boolean

hasTaskActions

open override fun hasTaskActions(): Boolean

isCompatibleWithConfigurationCache

mustRunAfter

open override fun mustRunAfter(vararg paths: Any): Task

notCompatibleWithConfigurationCache

open override fun notCompatibleWithConfigurationCache(reason: String)

onlyIf

open override fun onlyIf(onlyIfClosure: Closure<Any>)
open override fun onlyIf(spec: Spec<in Task>)
open override fun onlyIf(onlyIfReason: String, spec: Spec<in Task>)

prependParallelSafeAction

open override fun prependParallelSafeAction(action: Action<in Task>)

property

open override fun property(propertyName: String): Any?

setActions

open override fun setActions(replacements: MutableList<Action<in Task>>)

setDependsOn

open override fun setDependsOn(dependsOn: MutableIterable<*>)

setDescription

open override fun setDescription(description: String?)

setDidWork

open override fun setDidWork(didWork: Boolean)

setFinalizedBy

open override fun setFinalizedBy(finalizedByTasks: MutableIterable<*>)

setGroup

open override fun setGroup(group: String?)

setMustRunAfter

open override fun setMustRunAfter(mustRunAfterTasks: MutableIterable<*>)

setOnlyIf

open override fun setOnlyIf(onlyIfClosure: Closure<Any>)
open override fun setOnlyIf(spec: Spec<in Task>)
open override fun setOnlyIf(onlyIfReason: String, spec: Spec<in Task>)

setProperty

open override fun setProperty(name: String, value: Any)

setShouldRunAfter

open override fun setShouldRunAfter(shouldRunAfterTasks: MutableIterable<*>)

shouldRunAfter

open override fun shouldRunAfter(vararg paths: Any): TaskDependency

usesService

open override fun usesService(service: Provider<out BuildService<*>>)