Skip to content
Open
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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Accordant.Choose/Accordant.Choose.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
<OutputPath>../bin</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Accordant.Invariant/Accordant.Invariant.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
<OutputPath>../bin</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Accordant.Operations.Http/Accordant.Operations.Http.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
<OutputPath>../bin</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Accordant.Operations/Accordant.Operations.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
<OutputPath>../bin</OutputPath>
Expand Down
1 change: 1 addition & 0 deletions Accordant.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
<Project Path="Accordant.Operations/Accordant.Operations.csproj" />
<Project Path="Accordant.SourceGenerator/Accordant.SourceGenerator.csproj" />
<Project Path="Accordant/Accordant.csproj" />
<Project Path="nuget/Microsoft.Accordant.Package.csproj" />
</Solution>
2 changes: 1 addition & 1 deletion Accordant/Accordant.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
<OutputPath>../bin</OutputPath>
Expand Down
9 changes: 7 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
<PackageVersion Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.IO.Hashing" Version="9.0.7" />
<PackageVersion Include="System.Text.Json" Version="10.0.3" />
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageVersion Update="System.Collections.Immutable" Version="10.0.0" />
<PackageVersion Update="System.IO.Hashing" Version="10.0.3" />
<PackageVersion Update="System.Text.Json" Version="10.0.3" />
</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions Microsoft.Accordant.Cli/DotnetToolSettings.xml

This file was deleted.

16 changes: 10 additions & 6 deletions Microsoft.Accordant.Cli/Microsoft.Accordant.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Microsoft.Accordant</RootNamespace>

<!-- Tool is packaged via Scripts/NuGet/Microsoft.Accordant.Cli.nuspec -->
<IsPackable>false</IsPackable>
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<ToolCommandName>accordant</ToolCommandName>
<PackageId>Microsoft.Accordant.Cli</PackageId>
<PackageReadmeFile>docs\readme.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<Description>CLI tool for scaffolding Accordant model-based testing projects</Description>
<PackageTags>accordant cli scaffolding testing model-based</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand All @@ -26,9 +31,8 @@
</ItemGroup>

<ItemGroup>
<None Update="DotnetToolSettings.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\nuget\README.md" Pack="true" PackagePath="docs\readme.md" />
<None Include="..\nuget\icon.png" Pack="true" PackagePath="icon.png" />
</ItemGroup>

</Project>
20 changes: 4 additions & 16 deletions Scripts/Install-AccordantCli.ps1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 ""
Expand Down Expand Up @@ -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
}

Expand Down
25 changes: 5 additions & 20 deletions Scripts/create-nuget-packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
</PropertyGroup>
Expand Down
33 changes: 0 additions & 33 deletions nuget/Microsoft.Accordant.Cli.nuspec

This file was deleted.

55 changes: 55 additions & 0 deletions nuget/Microsoft.Accordant.Package.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
<PackageId>Microsoft.Accordant</PackageId>
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageReadmeFile>docs\readme.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<Description>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.</Description>
<PackageTags>accordant model-based testing state specifications fuzzing automated-testing</PackageTags>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddAccordantAssembliesToPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Accordant\Accordant.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Accordant.Choose\Accordant.Choose.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Accordant.Invariant\Accordant.Invariant.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Accordant.Operations\Accordant.Operations.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Accordant.Operations.Http\Accordant.Operations.Http.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Accordant.SourceGenerator\Accordant.SourceGenerator.csproj"
PrivateAssets="all"
ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Collections.Immutable" />
<PackageReference Include="System.IO.Hashing" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="docs\readme.md" />
<None Include="icon.png" Pack="true" PackagePath="icon.png" />
<None Include="..\bin\netstandard2.0\Accordant.SourceGenerator.dll"
Pack="true"
PackagePath="analyzers\dotnet\cs"
Visible="false" />
</ItemGroup>

<Target Name="AddAccordantAssembliesToPackage"
Returns="@(TfmSpecificPackageFile)">
<ItemGroup>
<TfmSpecificPackageFile Include="..\bin\$(TargetFramework)\Accordant*.dll"
Exclude="..\bin\$(TargetFramework)\Accordant.SourceGenerator.dll"
PackagePath="lib\$(TargetFramework)" />
<TfmSpecificPackageFile Include="..\bin\$(TargetFramework)\Accordant*.pdb"
Exclude="..\bin\$(TargetFramework)\Accordant.SourceGenerator.pdb"
PackagePath="lib\$(TargetFramework)" />
</ItemGroup>
</Target>

</Project>
40 changes: 0 additions & 40 deletions nuget/Microsoft.Accordant.nuspec

This file was deleted.