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 package-pinned standalone CLI into the verified cache 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 verified host cache or an explicit local binary.

Method

Cancel

void Cancel()

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()

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 verified host-cache resolution.

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 and the release manifest identify the single verified cache entry for the build host.

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 the verified cache identity includes the Tailwind version.

Property

TailwindReleaseManifestPath

string? TailwindReleaseManifestPath { get; set; } Source

Gets or sets the packed or source-tree tailwind.release.json path.

Remarks

Required when no explicit TailwindCliPath is supplied. The manifest provides the package-pinned version, release URL, host binary names, and expected digests used to verify the one acquired host executable.

Property

TargetsDirectory

string TargetsDirectory { get; set; } Source

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

Remarks

Retained for MSBuild target compatibility. The host-scoped resolver does not probe package-local, sibling, or source-tree native binaries; MSBuild continues to pass $(MSBuildThisFileDirectory) .

Property

Configuration

string? Configuration { get; set; } Source

Gets or sets the current build configuration.

Remarks

Retained for target compatibility. Host-scoped CLI resolution does not use this value.

Property

TargetFramework

string? TargetFramework { get; set; } Source

Gets or sets the current project target framework.

Remarks

Retained for target compatibility. Host-scoped CLI resolution does not use this value.

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 verified host CLI downloads across Git worktrees instead of copying every 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-RID branches.