Skip to content

Commit cdc9c83

Browse files
committed
Add well-known MSBuild constants to Typed namespace
- Add BeforeBuild and BeforeRebuild targets - Add MSBuild runtime/version properties - Add SolutionDir/Path, Nullable, SqlServerVersion properties - Add new MsBuildTasks static class with common tasks - Enables strongly-typed MSBuild names across all packages
1 parent dcc4a83 commit cdc9c83

File tree

1 file changed

+175
-0
lines changed

1 file changed

+175
-0
lines changed

src/JD.MSBuild.Fluent/Typed/MsBuildNames.cs

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,22 @@ public static class MsBuildTargets
306306
/// <inheritdoc />
307307
public string Name => "ResolveAssemblyReferences";
308308
}
309+
/// <summary>
310+
/// BeforeBuild target.
311+
/// </summary>
312+
public readonly struct BeforeBuild : IMsBuildTargetName
313+
{
314+
/// <inheritdoc />
315+
public string Name => "BeforeBuild";
316+
}
317+
/// <summary>
318+
/// BeforeRebuild target.
319+
/// </summary>
320+
public readonly struct BeforeRebuild : IMsBuildTargetName
321+
{
322+
/// <inheritdoc />
323+
public string Name => "BeforeRebuild";
324+
}
309325
}
310326

311327
/// <summary>
@@ -433,6 +449,165 @@ public static class MsBuildProperties
433449
/// <inheritdoc />
434450
public string Name => "PackageVersion";
435451
}
452+
/// <summary>
453+
/// MSBuildRuntimeType property.
454+
/// </summary>
455+
public readonly struct MSBuildRuntimeType : IMsBuildPropertyName
456+
{
457+
/// <inheritdoc />
458+
public string Name => "MSBuildRuntimeType";
459+
}
460+
/// <summary>
461+
/// MSBuildVersion property.
462+
/// </summary>
463+
public readonly struct MSBuildVersion : IMsBuildPropertyName
464+
{
465+
/// <inheritdoc />
466+
public string Name => "MSBuildVersion";
467+
}
468+
/// <summary>
469+
/// MSBuildProjectFile property.
470+
/// </summary>
471+
public readonly struct MSBuildProjectFile : IMsBuildPropertyName
472+
{
473+
/// <inheritdoc />
474+
public string Name => "MSBuildProjectFile";
475+
}
476+
/// <summary>
477+
/// MSBuildThisFile property.
478+
/// </summary>
479+
public readonly struct MSBuildThisFile : IMsBuildPropertyName
480+
{
481+
/// <inheritdoc />
482+
public string Name => "MSBuildThisFile";
483+
}
484+
/// <summary>
485+
/// SolutionDir property.
486+
/// </summary>
487+
public readonly struct SolutionDir : IMsBuildPropertyName
488+
{
489+
/// <inheritdoc />
490+
public string Name => "SolutionDir";
491+
}
492+
/// <summary>
493+
/// SolutionPath property.
494+
/// </summary>
495+
public readonly struct SolutionPath : IMsBuildPropertyName
496+
{
497+
/// <inheritdoc />
498+
public string Name => "SolutionPath";
499+
}
500+
/// <summary>
501+
/// Nullable property.
502+
/// </summary>
503+
public readonly struct Nullable : IMsBuildPropertyName
504+
{
505+
/// <inheritdoc />
506+
public string Name => "Nullable";
507+
}
508+
/// <summary>
509+
/// SqlServerVersion property (MSBuild.Sdk.SqlProj, Microsoft.Build.Sql).
510+
/// </summary>
511+
public readonly struct SqlServerVersion : IMsBuildPropertyName
512+
{
513+
/// <inheritdoc />
514+
public string Name => "SqlServerVersion";
515+
}
516+
/// <summary>
517+
/// DSP property (SQL project).
518+
/// </summary>
519+
public readonly struct DSP : IMsBuildPropertyName
520+
{
521+
/// <inheritdoc />
522+
public string Name => "DSP";
523+
}
524+
}
525+
526+
/// <summary>
527+
/// Common MSBuild task names.
528+
/// </summary>
529+
public static class MsBuildTasks
530+
{
531+
/// <summary>
532+
/// Message task.
533+
/// </summary>
534+
public readonly struct Message : IMsBuildTaskName
535+
{
536+
/// <inheritdoc />
537+
public string Name => "Message";
538+
}
539+
/// <summary>
540+
/// Error task.
541+
/// </summary>
542+
public readonly struct Error : IMsBuildTaskName
543+
{
544+
/// <inheritdoc />
545+
public string Name => "Error";
546+
}
547+
/// <summary>
548+
/// Warning task.
549+
/// </summary>
550+
public readonly struct Warning : IMsBuildTaskName
551+
{
552+
/// <inheritdoc />
553+
public string Name => "Warning";
554+
}
555+
/// <summary>
556+
/// Copy task.
557+
/// </summary>
558+
public readonly struct Copy : IMsBuildTaskName
559+
{
560+
/// <inheritdoc />
561+
public string Name => "Copy";
562+
}
563+
/// <summary>
564+
/// MakeDir task.
565+
/// </summary>
566+
public readonly struct MakeDir : IMsBuildTaskName
567+
{
568+
/// <inheritdoc />
569+
public string Name => "MakeDir";
570+
}
571+
/// <summary>
572+
/// Delete task.
573+
/// </summary>
574+
public readonly struct Delete : IMsBuildTaskName
575+
{
576+
/// <inheritdoc />
577+
public string Name => "Delete";
578+
}
579+
/// <summary>
580+
/// Touch task.
581+
/// </summary>
582+
public readonly struct Touch : IMsBuildTaskName
583+
{
584+
/// <inheritdoc />
585+
public string Name => "Touch";
586+
}
587+
/// <summary>
588+
/// Exec task.
589+
/// </summary>
590+
public readonly struct Exec : IMsBuildTaskName
591+
{
592+
/// <inheritdoc />
593+
public string Name => "Exec";
594+
}
595+
/// <summary>
596+
/// MSBuild task.
597+
/// </summary>
598+
public readonly struct MSBuild : IMsBuildTaskName
599+
{
600+
/// <inheritdoc />
601+
public string Name => "MSBuild";
602+
}
603+
/// <summary>
604+
/// CallTarget task.
605+
/// </summary>
606+
public readonly struct CallTarget : IMsBuildTaskName
607+
{
608+
/// <inheritdoc />
609+
public string Name => "CallTarget";
610+
}
436611
}
437612

438613
/// <summary>

0 commit comments

Comments
 (0)