Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "coverlet .NET 10.0)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0-bookworm",
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "10.0.100",
"additionalVersions": ["6.0.428", "8.0.414", "9.0.307"]
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// "portsAttributes": {
// "5001": {
// "protocol": "https"
// }
// }

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "dotnet restore",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.vscode-dotnet-runtime",
"GitHub.vscode-pull-request-github",
"ms-dotnettools.csharp",
"ms-dotnettools.dotnet-interactive-vscode",
"ms-dotnettools.csdevkit",
"ms-vscode.powershell",
"ms-azure-devops.azure-pipelines",
"GitHub.copilot-chat",
"GitHub.copilot",
"mhutchie.git-graph",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-german",
"streetsidesoftware.code-spell-checker-english",
"fernandoescolar.vscode-solution-explorer"]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
5 changes: 5 additions & 0 deletions eng/azure-pipelines-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ steps:
version: 8.0.414
displayName: Install .NET Core SDK 8.0.412

- task: UseDotNet@2
inputs:
version: 9.0.307
displayName: Install .NET Core SDK 9.0.307

- task: UseDotNet@2
inputs:
useGlobalJson: true
Expand Down
7 changes: 6 additions & 1 deletion eng/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ steps:
- task: UseDotNet@2
inputs:
version: 8.0.412
displayName: Install .NET Core SDK 8.0.8.0.414
displayName: Install .NET Core SDK 8.0.414

- task: UseDotNet@2
inputs:
version: 9.0.307
displayName: Install .NET Core SDK 9.0.307

- task: UseDotNet@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "9.0.307"
"version": "10.0.100"
}
}
74 changes: 74 additions & 0 deletions scripts/build-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash

# Build Script for Coverlet
# ------------------------
# This script provides a complete build environment setup and cleanup for Coverlet development.
# It's designed to support fast branch switching by:
# - Cleaning all temporary build artifacts
# - Removing cached NuGet packages
# - Rebuilding all projects and tests
# - Generating new binlogs for debugging
#
# Key features:
# - Cleans TestResults, bin, obj folders for clean builds
# - Removes cached NuGet packages to prevent version conflicts
# - Builds and packs all Coverlet projects
# - Generates binlogs for build diagnostics
# - Supports CI builds with ContinuousIntegrationBuild=true
#
# Usage: ./scripts/build-all.sh
#
# Note: Run this script after switching branches to ensure a clean development environment

# Cleanup temp folders and files
echo "Please cleanup temp folder!"
dotnet build-server shutdown
rm -f coverage.cobertura.xml
rm -f coverage.json
rm -f coverage.net8.0.json
rm -f test/coverlet.integration.determisticbuild/*.binlog
rm -rf artifacts

# Clean nuget packages
rm -rf ~/.nuget/packages/coverlet.msbuild/V1.0.0
rm -rf ~/.nuget/packages/coverlet.collector/V1.0.0
find . -type d \( -name "TestResults" -o -name "bin" -o -name "obj" \) -exec rm -rf {} +
find ~/.nuget/packages -type d \( -name "coverlet.msbuild" -o -name "coverlet.collector" -o -name "coverlet.console" \) -name "8.0.0-preview*" -exec rm -rf {} +

# Build and pack projects
dotnet pack -c Debug src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj /p:ContinuousIntegrationBuild=true
dotnet pack -c Debug src/coverlet.collector/coverlet.collector.csproj /p:ContinuousIntegrationBuild=true
dotnet build -bl:build.binlog /p:ContinuousIntegrationBuild=true

# Create binlog for tests
dotnet build test/coverlet.collector.tests/coverlet.collector.tests.csproj -bl:build.collector.tests.binlog /p:ContinuousIntegrationBuild=true
dotnet build test/coverlet.core.coverage.tests/coverlet.core.coverage.tests.csproj -bl:build.core.coverage.tests.binlog /p:ContinuousIntegrationBuild=true
dotnet build test/coverlet.core.tests/coverlet.core.tests.csproj -bl:build.coverlet.core.tests.binlog /p:ContinuousIntegrationBuild=true

# Create nuget packages
dotnet pack -c Debug src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj /p:ContinuousIntegrationBuild=true
dotnet pack -c Debug src/coverlet.collector/coverlet.collector.csproj /p:ContinuousIntegrationBuild=true
dotnet pack -c Debug src/coverlet.console/coverlet.console.csproj /p:ContinuousIntegrationBuild=true
dotnet pack -c Debug src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj /p:ContinuousIntegrationBuild=true
dotnet pack src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj /p:ContinuousIntegrationBuild=true
dotnet pack src/coverlet.collector/coverlet.collector.csproj /p:ContinuousIntegrationBuild=true
dotnet pack src/coverlet.console/coverlet.console.csproj /p:ContinuousIntegrationBuild=true
dotnet pack src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj /p:ContinuousIntegrationBuild=true

dotnet build-server shutdown

# Commented out sections converted to shell script comments
: <<'END_COMMENT'

dotnet test test/coverlet.collector.tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*" --results-directory:"./artifacts/Reports" -c debug --no-build -bl:test.collector.binlog --diag:"artifacts/log/debug/coverlet.collector.test.diag.log;tracelevel=verbose"
dotnet test test/coverlet.core.tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*" -c debug --no-build -bl:test.core.binlog
dotnet test test/coverlet.core.coverage.tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*" -c debug --no-build -bl:test.core.coverage.binlog
dotnet test test/coverlet.msbuild.tasks.tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*" -c debug --no-build -bl:test.msbuild.binlog
dotnet test test/coverlet.integration.tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*" -c debug --no-build -bl:test.integration.binlog

reportgenerator -reports:"**/*.opencover.xml" -targetdir:"artifacts/reports" -reporttypes:"HtmlInline_AzurePipelines_Dark;Cobertura" -assemblyfilters:"-xunit;-coverlet.testsubject;-Coverlet.Tests.ProjectSample.*;-coverlet.core.tests.samples.netstandard;-coverlet.tests.utils;-coverlet.tests.xunit.extensions;-coverletsamplelib.integration.template;-testgen_*"

dotnet test test/coverlet.core.remote.tests/coverlet.core.remote.tests.csproj -c Debug /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --diag:"artifacts/log/debug/coverlet.core.remote.test.diag.log;tracelevel=verbose"

find . -name *.trx && find . -name *.opencover.xml
END_COMMENT
File renamed without changes.
Loading