Skip to content

aegoroff/solv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,070 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crates.io downloads CI codecov Minimum Stable Rust Version

solv

Microsoft Visual Studio SOLution Validation console tool and parsing library written in Rust.

The repository contains two crates:

  • solv — the command-line tool that validates and analyzes Visual Studio solution (.sln) files.
  • solp — the underlying parsing library that solv is built on. It can be used independently to parse .sln files from your own Rust code.

Features

  • Validate Visual Studio solutions and detect common problems (missing projects, duplicates, invalid configurations, dangling project references, etc.).
  • Show detailed information about solutions and their projects.
  • Inspect NuGet packages referenced by a solution and find version mismatches.
  • Convert a solution to JSON for further processing.
  • Scan a single .sln file, read from standard input, or recursively scan a directory.
  • Generate shell auto-completion scripts.

Install the pre-compiled binary

homebrew (only on macOS and Linux for now):

Add my tap (do it once):

brew tap aegoroff/tap

And then install solv:

brew install solv

Update solv if already installed:

brew upgrade solv

scoop:

scoop bucket add aegoroff https://github.com/aegoroff/scoop-bucket.git
scoop install solv

AUR (Arch Linux User Repository):

install binary package:

 yay -S solv-bin

or if yay reports that package not found force updating repo info

yay -Syyu solv-bin

install using cargo so builiding on target machine:

 yay -S solv

or if yay reports that package not found force updating repo info

yay -Syyu solv

manually:

Download the pre-compiled binaries from the releases and copy to the desired location. RPM and DEB packages are available to install under RedHat or Debian based Linux distros.

install deb package on Arch Linux:

  1. Install debtap from AUR using yay:
 yay -S debtap
  1. Create equivalent package using debtap:
 sudo debtap -u
 debtap solv_x.x.x_amd64.deb
  1. Install using pacman:
sudo pacman -U solv-x.x.x-1-x86_64.pkg.tar.zst

Install from source

With a recent Rust toolchain installed you can build and install solv from crates.io:

cargo install solv

Usage

solv is a subcommand-based CLI. Run solv --help to see a list of subcommands, or solv <subcommand> --help for details on a specific one.

solv <SUBCOMMAND> [OPTIONS] [PATH]

Available subcommands:

Subcommand Alias Description
validate va Validates solutions within a directory or a single file
info i Show information about found solutions (projects, configurations, versions, ...)
nuget nu Show NuGet packages used in solutions and detect version mismatches
json j Convert solution(s) into JSON
completion Generate the autocompletion script for the specified shell
bugreport Collect information about the system and environment for bug reports

Common options accepted by validate, info, nuget and json:

Option Description
-e, --ext <EXTENSION> Visual Studio solution extension (default: sln)
-r, --recursively Scan the directory recursively (default: false)
--showerrors Output solution parsing errors while scanning directories (default: false)
-t, --time Show scanning time when scanning a directory (default: false)

The PATH argument can be either a path to a single .sln file or to a directory. For the info and json subcommands, if PATH is omitted the solution is read from standard input.

Examples

Validate a single solution file:

solv validate path/to/MySolution.sln

Recursively validate all solutions in a directory, showing only the ones with problems:

solv validate -r -p path/to/sources

Show information about a solution:

solv info path/to/MySolution.sln

Find NuGet package version mismatches and fail (non-zero exit code) if any are found:

solv nuget -r -m -f path/to/sources

Convert a solution to pretty-printed JSON:

solv json -p path/to/MySolution.sln

Read a solution from standard input and convert it to JSON:

cat path/to/MySolution.sln | solv json

Generate a shell completion script (example for bash):

solv completion bash > /etc/bash_completion.d/solv

About

Microsoft Visual Studio solution validator and parsing library written in Rust

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages