Add API to get version information (#2309)

This commit is contained in:
Fangjun Kuang
2025-06-25 00:22:21 +08:00
committed by GitHub
parent 7f2145539d
commit bda427f4b2
169 changed files with 1480 additions and 12 deletions

View File

@@ -0,0 +1,16 @@
// Copyright (c) 2025 Xiaomi Corporation
using SherpaOnnx;
class VersionTestDemo
{
static void Main(string[] args)
{
var version = VersionInfo.Version;
var gitSha1 = VersionInfo.GitSha1;
var gitDate = VersionInfo.GitDate;
Console.WriteLine("sherpa-onnx version: {0}", version);
Console.WriteLine("sherpa-onnx gitSha1: {0}", gitSha1);
Console.WriteLine("sherpa-onnx gitDate: {0}", gitDate);
}
}

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -ex
dotnet run

View File

@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>version_test</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
</ItemGroup>
</Project>