Skip to content

Add build.ps1 for multi-Roslyn Build/Test/Pack orchestration #208

@atifaziz

Description

@atifaziz

Objective

Create a repository-root build.ps1 script with parameter sets to standardize Build, Test, and Pack workflows across Roslyn variants.

Scope

  • Implement Build (default), Test, and Pack parameter sets.
  • Ensure script is directory-independent (Push-Location $PSScriptRoot / Pop-Location in finally).
  • Use strict error handling and propagate non-zero exit codes.

Files

  • build.ps1

Tasks

  • Create parameter sets:
    • Build (default) with -Configuration (default Release)
    • Test with -Configuration and -NoBuild
    • Pack with -Configuration and optional -VersionSuffix
  • Add Build flow:
    • Run dotnet build solution baseline.
    • Run dotnet build src/DocoptNet/DocoptNet.csproj -f netstandard2.0 -p:RoslynVersion=4.4.
  • Add Test flow:
    • Optionally run Build flow when -NoBuild is not set.
    • Run baseline tests with dotnet test --no-build when applicable.
    • Run Roslyn 4.4 tests via test project with -p:RoslynVersion=4.4.
  • Add Pack flow:
    • Always invoke Build flow first.
    • Run dotnet pack src/DocoptNet/DocoptNet.csproj --no-build.
    • Pass --version-suffix only when provided.
  • Enforce $ErrorActionPreference = 'Stop' and fail fast on $LASTEXITCODE.

Acceptance Criteria

  • dotnet pwsh ./build.ps1 completes baseline + Roslyn 4.4 build.
  • dotnet pwsh ./build.ps1 -Test runs test pass for both variants.
  • dotnet pwsh ./build.ps1 -Pack succeeds and returns non-zero on failures.
  • Script works from any current working directory.

Dependencies

Notes

  • Assume dotnet tool restore has already been run so dotnet pwsh is available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions