Clean stdio output and enable ReadyToRun publish
This commit is contained in:
@@ -25,6 +25,12 @@ Publish one runtime:
|
|||||||
|
|
||||||
The script writes binaries under `artifacts/publish/<rid>/`.
|
The script writes binaries under `artifacts/publish/<rid>/`.
|
||||||
|
|
||||||
|
ReadyToRun is enabled by default to improve startup:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
PUBLISH_READY_TO_RUN=false ./scripts/publish.sh linux-x64
|
||||||
|
```
|
||||||
|
|
||||||
Trimming is disabled by default because the MCP SDK discovers tools through reflection. To experiment with trimming after validating tool discovery in the published binary:
|
Trimming is disabled by default because the MCP SDK discovers tools through reflection. To experiment with trimming after validating tool discovery in the published binary:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|||||||
PROJECT="$ROOT_DIR/src/McpSsh.Server/McpSsh.Server.csproj"
|
PROJECT="$ROOT_DIR/src/McpSsh.Server/McpSsh.Server.csproj"
|
||||||
CONFIGURATION="${CONFIGURATION:-Release}"
|
CONFIGURATION="${CONFIGURATION:-Release}"
|
||||||
PUBLISH_TRIMMED="${PUBLISH_TRIMMED:-false}"
|
PUBLISH_TRIMMED="${PUBLISH_TRIMMED:-false}"
|
||||||
|
PUBLISH_READY_TO_RUN="${PUBLISH_READY_TO_RUN:-true}"
|
||||||
|
|
||||||
if [[ $# -gt 0 ]]; then
|
if [[ $# -gt 0 ]]; then
|
||||||
RIDS=("$@")
|
RIDS=("$@")
|
||||||
@@ -21,5 +22,6 @@ for rid in "${RIDS[@]}"; do
|
|||||||
-o "$output" \
|
-o "$output" \
|
||||||
-p:PublishSingleFile=true \
|
-p:PublishSingleFile=true \
|
||||||
-p:PublishTrimmed="$PUBLISH_TRIMMED" \
|
-p:PublishTrimmed="$PUBLISH_TRIMMED" \
|
||||||
|
-p:PublishReadyToRun="$PUBLISH_READY_TO_RUN" \
|
||||||
-p:EnableCompressionInSingleFile=true
|
-p:EnableCompressionInSingleFile=true
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -9,10 +9,7 @@ using Microsoft.Extensions.Logging;
|
|||||||
|
|
||||||
var builder = Host.CreateApplicationBuilder(args);
|
var builder = Host.CreateApplicationBuilder(args);
|
||||||
|
|
||||||
builder.Logging.AddConsole(options =>
|
builder.Logging.ClearProviders();
|
||||||
{
|
|
||||||
options.LogToStandardErrorThreshold = LogLevel.Trace;
|
|
||||||
});
|
|
||||||
|
|
||||||
builder.Services.AddSingleton<ISystemClock, SystemClock>();
|
builder.Services.AddSingleton<ISystemClock, SystemClock>();
|
||||||
builder.Services.AddSingleton<IFileSystem, LocalFileSystem>();
|
builder.Services.AddSingleton<IFileSystem, LocalFileSystem>();
|
||||||
|
|||||||
Reference in New Issue
Block a user