diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4b01c2..e2109e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,5 +32,10 @@ jobs: - name: Build run: dotnet build --no-restore --configuration Release + - name: Pack + run: | + dotnet pack nuget/Microsoft.Accordant.Package.csproj --no-build --no-restore --configuration Release + dotnet pack Microsoft.Accordant.Cli/Microsoft.Accordant.Cli.csproj --no-build --no-restore --configuration Release + - name: Test run: dotnet test --no-build --configuration Release --verbosity normal diff --git a/Accordant.Choose/Accordant.Choose.csproj b/Accordant.Choose/Accordant.Choose.csproj index b5ba547..2f0244d 100644 --- a/Accordant.Choose/Accordant.Choose.csproj +++ b/Accordant.Choose/Accordant.Choose.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net8.0;net10.0 latest Library ../bin diff --git a/Accordant.Invariant/Accordant.Invariant.csproj b/Accordant.Invariant/Accordant.Invariant.csproj index ab79541..234f7ec 100644 --- a/Accordant.Invariant/Accordant.Invariant.csproj +++ b/Accordant.Invariant/Accordant.Invariant.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net8.0;net10.0 latest Library ../bin diff --git a/Accordant.Operations.Http/Accordant.Operations.Http.csproj b/Accordant.Operations.Http/Accordant.Operations.Http.csproj index f75d481..bbcc3c4 100644 --- a/Accordant.Operations.Http/Accordant.Operations.Http.csproj +++ b/Accordant.Operations.Http/Accordant.Operations.Http.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net8.0;net10.0 latest Library ../bin diff --git a/Accordant.Operations/Accordant.Operations.csproj b/Accordant.Operations/Accordant.Operations.csproj index 24a2bfd..3759c04 100644 --- a/Accordant.Operations/Accordant.Operations.csproj +++ b/Accordant.Operations/Accordant.Operations.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net8.0;net10.0 latest Library ../bin diff --git a/Accordant.slnx b/Accordant.slnx index 3afd4cf..584fe1d 100644 --- a/Accordant.slnx +++ b/Accordant.slnx @@ -23,4 +23,5 @@ + diff --git a/Accordant/Accordant.csproj b/Accordant/Accordant.csproj index 327bc13..fa71f82 100644 --- a/Accordant/Accordant.csproj +++ b/Accordant/Accordant.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net8.0;net10.0 latest Library ../bin diff --git a/Directory.Packages.props b/Directory.Packages.props index e86106c..2edd047 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -14,7 +14,12 @@ - - + + + + + + + \ No newline at end of file diff --git a/Microsoft.Accordant.Cli/DotnetToolSettings.xml b/Microsoft.Accordant.Cli/DotnetToolSettings.xml deleted file mode 100644 index 135493c..0000000 --- a/Microsoft.Accordant.Cli/DotnetToolSettings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Microsoft.Accordant.Cli/Microsoft.Accordant.Cli.csproj b/Microsoft.Accordant.Cli/Microsoft.Accordant.Cli.csproj index b48480b..be8d0b6 100644 --- a/Microsoft.Accordant.Cli/Microsoft.Accordant.Cli.csproj +++ b/Microsoft.Accordant.Cli/Microsoft.Accordant.Cli.csproj @@ -7,9 +7,14 @@ enable enable Microsoft.Accordant - - - false + true + true + accordant + Microsoft.Accordant.Cli + docs\readme.md + icon.png + CLI tool for scaffolding Accordant model-based testing projects + accordant cli scaffolding testing model-based @@ -26,9 +31,8 @@ - - Always - + + diff --git a/Scripts/Install-AccordantCli.ps1 b/Scripts/Install-AccordantCli.ps1 index 87555ed..6fcc9a5 100644 --- a/Scripts/Install-AccordantCli.ps1 +++ b/Scripts/Install-AccordantCli.ps1 @@ -1,6 +1,5 @@ # Install-AccordantCli.ps1 # Installs (or reinstalls) the Microsoft.Accordant.Cli tool locally for development -# Uses the nuspec file from nuget/ folder param( [switch]$Global = $true @@ -10,12 +9,9 @@ $ErrorActionPreference = "Stop" $toolName = "Microsoft.Accordant.Cli" $projectPath = (Resolve-Path "$PSScriptRoot\..\Microsoft.Accordant.Cli\Microsoft.Accordant.Cli.csproj").Path -$nuspecPath = (Resolve-Path "$PSScriptRoot\..\nuget\Microsoft.Accordant.Cli.nuspec").Path $nupkgPath = "$PSScriptRoot\..\bin\packages" -# Extract version from nuspec -[xml]$nuspec = Get-Content $nuspecPath -$version = $nuspec.package.metadata.version +$version = dotnet msbuild $projectPath -getProperty:Version -nologo Write-Host "=== Accordant CLI Installer ===" -ForegroundColor Cyan Write-Host "" @@ -48,24 +44,16 @@ if (-not (Test-Path $nupkgPath)) { # Convert to absolute path for dotnet tool install $nupkgPath = (Resolve-Path $nupkgPath).Path -# Pack using nuspec (catches target framework mismatches) Write-Host "" -Write-Host "Packing with nuspec (validates target framework coverage)..." -ForegroundColor Yellow +Write-Host "Packing..." -ForegroundColor Yellow # Remove any existing nupkg to avoid file locking issues Remove-Item "$nupkgPath\$toolName.*.nupkg" -Force -ErrorAction SilentlyContinue -# Use nuget pack with the nuspec file -$nugetExe = Get-Command nuget -ErrorAction SilentlyContinue -if ($nugetExe) { - nuget pack $nuspecPath -OutputDirectory $nupkgPath -} else { - # Fallback: use dotnet pack with nuspec - dotnet pack $projectPath -c Release -o $nupkgPath -p:NuspecFile=$nuspecPath /m:1 -} +dotnet pack $projectPath -c Release -o $nupkgPath --no-build if ($LASTEXITCODE -ne 0) { - Write-Host "Pack failed! Check if nuspec matches csproj TargetFrameworks." -ForegroundColor Red + Write-Host "Pack failed!" -ForegroundColor Red exit 1 } diff --git a/Scripts/create-nuget-packages.ps1 b/Scripts/create-nuget-packages.ps1 index a2e84f7..37bbe0b 100644 --- a/Scripts/create-nuget-packages.ps1 +++ b/Scripts/create-nuget-packages.ps1 @@ -3,35 +3,20 @@ Import-Module $PSScriptRoot/common.psm1 -Force -$nuget = "nuget" - -# Check that NuGet.exe is installed. -if (-not (Get-Command $nuget -errorAction SilentlyContinue)) { - Write-Comment -text "Please install the latest NuGet.exe from https://www.nuget.org/downloads and add it to the PATH environment variable." -color "yellow" - exit 1 -} +$dotnet = "dotnet" Write-Comment -prefix "." -text "Creating the Accordant NuGet packages" -color "yellow" -$version = "0.1.5" - -# Setup the command line options for nuget pack. -$cmd_options = "-OutputDirectory $PSScriptRoot/../bin/packages -Version $version" -$cmd_options = "$cmd_options -Symbols -SymbolPackageFormat snupkg" - Write-Comment -prefix "..." -text "Creating the 'Microsoft.Accordant' package" -$command = "pack $PSScriptRoot/../nuget/Microsoft.Accordant.nuspec $cmd_options" +$command = "pack $PSScriptRoot/../nuget/Microsoft.Accordant.Package.csproj --configuration Release --output $PSScriptRoot/../bin/packages --no-restore" $error_msg = "Failed to create the Microsoft.Accordant NuGet package" -Invoke-ToolCommand -tool $nuget -cmd $command -error_msg $error_msg - -# Tool packages don't need symbols -$tool_cmd_options = "-OutputDirectory $PSScriptRoot/../bin/packages -Version $version" +Invoke-ToolCommand -tool $dotnet -cmd $command -error_msg $error_msg Write-Comment -prefix "..." -text "Creating the 'Microsoft.Accordant.Cli' package (dotnet tool)" -$command = "pack $PSScriptRoot/../nuget/Microsoft.Accordant.Cli.nuspec $tool_cmd_options" +$command = "pack $PSScriptRoot/../Microsoft.Accordant.Cli/Microsoft.Accordant.Cli.csproj --configuration Release --output $PSScriptRoot/../bin/packages --no-restore" $error_msg = "Failed to create the Microsoft.Accordant.Cli NuGet package" -Invoke-ToolCommand -tool $nuget -cmd $command -error_msg $error_msg +Invoke-ToolCommand -tool $dotnet -cmd $command -error_msg $error_msg Write-Comment -prefix "." -text "Successfully created the Accordant NuGet packages" -color "green" diff --git a/Tests/Accordant.Operations.Tests/Accordant.Operations.Tests.csproj b/Tests/Accordant.Operations.Tests/Accordant.Operations.Tests.csproj index 0f81647..5f316aa 100644 --- a/Tests/Accordant.Operations.Tests/Accordant.Operations.Tests.csproj +++ b/Tests/Accordant.Operations.Tests/Accordant.Operations.Tests.csproj @@ -1,7 +1,7 @@ - net9.0 + net8.0;net10.0 latest Library diff --git a/nuget/Microsoft.Accordant.Cli.nuspec b/nuget/Microsoft.Accordant.Cli.nuspec deleted file mode 100644 index ffb6fe5..0000000 --- a/nuget/Microsoft.Accordant.Cli.nuspec +++ /dev/null @@ -1,33 +0,0 @@ - - - - Microsoft.Accordant.Cli - 0.1.7 - Microsoft - false - MIT - https://github.com/microsoft/accordant - - docs\readme.md - icon.png - CLI tool for scaffolding Accordant model-based testing projects - © Microsoft Corporation. All rights reserved. - accordant cli scaffolding testing model-based - - - - - - - - - - - - - - - - - - diff --git a/nuget/Microsoft.Accordant.Package.csproj b/nuget/Microsoft.Accordant.Package.csproj new file mode 100644 index 0000000..1556fbe --- /dev/null +++ b/nuget/Microsoft.Accordant.Package.csproj @@ -0,0 +1,55 @@ + + + + netstandard2.0;net8.0;net10.0 + Microsoft.Accordant + true + false + true + snupkg + docs\readme.md + icon.png + Accordant is a model-based testing framework for .NET. Define state specifications, operations, and expected outcomes, then let Accordant automatically generate and execute comprehensive test cases covering all state transitions. + accordant model-based testing state specifications fuzzing automated-testing + $(TargetsForTfmSpecificContentInPackage);AddAccordantAssembliesToPackage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nuget/Microsoft.Accordant.nuspec b/nuget/Microsoft.Accordant.nuspec deleted file mode 100644 index 268ba71..0000000 --- a/nuget/Microsoft.Accordant.nuspec +++ /dev/null @@ -1,40 +0,0 @@ - - - - Microsoft.Accordant - 0.1.7 - Microsoft - false - MIT - https://github.com/microsoft/accordant - - docs\readme.md - icon.png - Accordant is a model-based testing framework for .NET. Define state specifications, operations, and expected outcomes, then let Accordant automatically generate and execute comprehensive test cases covering all state transitions. - © Microsoft Corporation. All rights reserved. - accordant model-based testing state specifications fuzzing automated-testing - - - - - - - - - - - - - - - - - - - - - - - - -