AppSurface Search
API Reference

Tasks

Type

RunTailwindBuildTask

Source

Runs the Tailwind CLI during an MSBuild build and reports stable ASTW### diagnostics.

Remarks

The task is loaded by ForgeTrust.AppSurface.Web.Tailwind.targets for build-time CSS generation. It prefers an explicit TailwindCliPath when supplied; otherwise it resolves the runtime package for the current build host RID. Build mode intentionally does not search PATH, because command-line shells and CI agents often expose different paths than MSBuild nodes. Developer watch mode may use PATH, but reproducible builds should use the packaged runtime or an explicit local binary.

Method

Cancel

void Cancel() Source

Requests cancellation of the running Tailwind child process.

Remarks

MSBuild calls this method when the build is canceled. Execute observes the cancellation token, terminates the child process through the process runner, emits ASTW007, and returns false. Calling this method before Execute starts is a no-op.

Method

Execute

bool Execute() Source

Resolves the Tailwind executable, runs tailwindcss -i ... -o ... --minify, and reports success to MSBuild.

Returns

true when Tailwind exits with code 0; otherwise false after logging an ASTW### diagnostic. Non-zero exits include the last 8192 characters of stdout and stderr to avoid unbounded MSBuild memory growth while preserving the useful tail of the failure output.

Property

ProjectDirectory

string ProjectDirectory { get; set; } Source

Gets or sets the project directory used as the Tailwind working directory.

Remarks

Required. Relative InputPath, OutputPath, and TailwindCliPath values are resolved from this directory. MSBuild passes $(MSBuildProjectDirectory).

Property

InputPath

string InputPath { get; set; } Source

Gets or sets the Tailwind input CSS path.

Remarks

Required. The value is passed to Tailwind as -i and is interpreted relative to ProjectDirectory unless it is rooted. The imported targets validate that input and output paths do not resolve to the same file before this task runs.

Property

OutputPath

string OutputPath { get; set; } Source

Gets or sets the generated Tailwind output CSS path.

Remarks

Required. The value is passed to Tailwind as -o and is interpreted relative to ProjectDirectory unless it is rooted. Outputs under wwwroot are registered by the targets file as static web assets.

Property

TailwindCliPath

string? TailwindCliPath { get; set; } Source

Gets or sets an optional explicit Tailwind CLI path used instead of the packaged runtime.

Remarks

Optional. Use this escape hatch when a project must pin a custom standalone Tailwind binary or a local shim. Relative values resolve from ProjectDirectory. When set, the file must exist or the task emits ASTW003; when unset, TailwindVersion is required so the runtime package candidate paths can be constructed.

Property

TailwindVersion

string? TailwindVersion { get; set; } Source

Gets or sets the resolved Tailwind version from tailwind.version.

Remarks

Required when TailwindCliPath is not supplied. The targets file normally reads this value from the package tailwind.version file. Missing values emit ASTW002 because packaged runtime lookup includes the Tailwind version in source-tree candidate paths.

Property

TargetsDirectory

string TargetsDirectory { get; set; } Source

Gets or sets the directory containing ForgeTrust.AppSurface.Web.Tailwind.targets.

Remarks

Required. The task uses this directory to find package-local runtimes, sibling runtime packages in the NuGet global-packages layout, and source-tree runtime outputs. MSBuild passes $(MSBuildThisFileDirectory), which includes a trailing separator.

Property

Configuration

string? Configuration { get; set; } Source

Gets or sets the current build configuration used for source-tree runtime probing.

Remarks

Optional. Defaults to Debug when blank. Package consumers normally do not depend on this property; it exists so repository/source-tree imports can locate runtime outputs under runtimes/obj.

Property

TargetFramework

string? TargetFramework { get; set; } Source

Gets or sets the current project target framework used for source-tree runtime probing.

Remarks

Optional. Defaults to net10.0 when blank. This is the consuming project's framework, not the framework used to load the MSBuild task assembly.

Property

TailwindDownloadCacheRoot

string? TailwindDownloadCacheRoot { get; set; } Source

Gets or sets the shared source-tree Tailwind download cache root.

Remarks

Optional. The imported targets default this to a user-level cache such as $XDG_CACHE_HOME/forgetrust/appsurface/tailwind or $HOME/.cache/forgetrust/appsurface/tailwind. The task probes this cache so source-tree builds can reuse runtime-project downloads across Git worktrees instead of copying every Tailwind executable under each worktree's obj directory.

Property

TailwindTargetRid

string? TailwindTargetRid { get; set; } Source

Gets or sets an optional Tailwind RID override for tests.

Remarks

Optional. Production builds should leave this blank so TailwindRuntimeMap.GetCurrentRid can resolve the host RID. Tests set this value to exercise unsupported RIDs and package probing branches.