Add API to get version information (#2309)
This commit is contained in:
16
dotnet-examples/version-test/Program.cs
Normal file
16
dotnet-examples/version-test/Program.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
5
dotnet-examples/version-test/run.sh
Executable file
5
dotnet-examples/version-test/run.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
dotnet run
|
||||
15
dotnet-examples/version-test/version-test.csproj
Normal file
15
dotnet-examples/version-test/version-test.csproj
Normal 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>
|
||||
Reference in New Issue
Block a user