From aad48ac8f504c192ea41eaad32e5f807730bb9b4 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 19 Oct 2023 21:03:17 +0200 Subject: [PATCH] update build scripts --- .gitignore | 2 +- start-arm-build.sh => arm64-build.sh | 4 ++-- src/Tests/Tests.csproj | 6 +++--- .../CollectorConfiguration.cs | 1 + src/Ve.Direct.InfluxDB.Collector/Program.cs | 2 +- .../Ve.Direct.InfluxDB.Collector.csproj | 4 ++-- win-build.ps1 | 16 ++++++++++++++++ start-x64-build.sh => x64-build.sh | 2 +- 8 files changed, 27 insertions(+), 10 deletions(-) rename start-arm-build.sh => arm64-build.sh (86%) create mode 100644 win-build.ps1 rename start-x64-build.sh => x64-build.sh (94%) diff --git a/.gitignore b/.gitignore index dfcfd56..32a1b10 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,7 @@ x64/ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ -bld/ +build/ [Bb]in/ [Oo]bj/ [Ll]og/ diff --git a/start-arm-build.sh b/arm64-build.sh similarity index 86% rename from start-arm-build.sh rename to arm64-build.sh index 2a32947..b927714 100644 --- a/start-arm-build.sh +++ b/arm64-build.sh @@ -1,11 +1,11 @@ #! /bin/sh dotnet publish ./src/Ve.Direct.InfluxDB.Collector/Ve.Direct.InfluxDB.Collector.csproj \ - --runtime linux-arm \ + --runtime linux-arm64 \ --self-contained false \ -c Release \ -v minimal \ -f net7.0 \ - -o ./arm-build \ + -o ./build \ -p:PublishReadyToRun=false \ -p:PublishSingleFile=true \ -p:CopyOutputSymbolsToPublishDirectory=false \ diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj index 2da64a2..1f446aa 100644 --- a/src/Tests/Tests.csproj +++ b/src/Tests/Tests.csproj @@ -7,9 +7,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Ve.Direct.InfluxDB.Collector/CollectorConfiguration.cs b/src/Ve.Direct.InfluxDB.Collector/CollectorConfiguration.cs index e011619..274a3ea 100644 --- a/src/Ve.Direct.InfluxDB.Collector/CollectorConfiguration.cs +++ b/src/Ve.Direct.InfluxDB.Collector/CollectorConfiguration.cs @@ -45,6 +45,7 @@ public CollectorConfiguration(CommandLineApplication app) this.interval.DefaultValue = 30; + // NOSONAR this.influxDbUrl.DefaultValue = "http://192.168.0.220:8086"; this.influxDbBucket.DefaultValue = "solar"; this.influxDbOrg.DefaultValue = "home"; diff --git a/src/Ve.Direct.InfluxDB.Collector/Program.cs b/src/Ve.Direct.InfluxDB.Collector/Program.cs index 29e3af8..a81ad64 100644 --- a/src/Ve.Direct.InfluxDB.Collector/Program.cs +++ b/src/Ve.Direct.InfluxDB.Collector/Program.cs @@ -16,7 +16,7 @@ public static int Main(string[] args) app.HelpOption(); app.OnExecuteAsync(async cancellationToken => { - ConsoleLogger.Init(config.DebugOutput, "2.3.5"); + ConsoleLogger.Init(config.DebugOutput, "2.3.6"); ConsoleLogger.Debug($"Current output setting: {config.Output}"); try diff --git a/src/Ve.Direct.InfluxDB.Collector/Ve.Direct.InfluxDB.Collector.csproj b/src/Ve.Direct.InfluxDB.Collector/Ve.Direct.InfluxDB.Collector.csproj index 822148f..ab40775 100644 --- a/src/Ve.Direct.InfluxDB.Collector/Ve.Direct.InfluxDB.Collector.csproj +++ b/src/Ve.Direct.InfluxDB.Collector/Ve.Direct.InfluxDB.Collector.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/win-build.ps1 b/win-build.ps1 new file mode 100644 index 0000000..5082d92 --- /dev/null +++ b/win-build.ps1 @@ -0,0 +1,16 @@ +$Version = Get-Date -Format "yyyy-MM-dd" # 2020-11-1 +$VersionDot = $Version -replace '-','.' + +# Dotnet restore and build +dotnet publish "$PSScriptRoot\src\Ve.Direct.InfluxDB.Collector\Ve.Direct.InfluxDB.Collector.csproj" ` + --runtime win-x64 ` + --self-contained false ` + -c Release ` + -v minimal ` + -o ./build ` + -f net7.0 ` + -p:PublishReadyToRun=false ` + -p:PublishSingleFile=true ` + -p:CopyOutputSymbolsToPublishDirectory=false ` + -p:Version=$VersionDot ` + --nologo diff --git a/start-x64-build.sh b/x64-build.sh similarity index 94% rename from start-x64-build.sh rename to x64-build.sh index eeaafd5..86f7e41 100644 --- a/start-x64-build.sh +++ b/x64-build.sh @@ -5,7 +5,7 @@ dotnet publish ./src/Ve.Direct.InfluxDB.Collector/Ve.Direct.InfluxDB.Collector.c -c Release \ -v minimal \ -f net7.0 \ - -o ./x64-build \ + -o ./build \ -p:PublishReadyToRun=false \ -p:PublishSingleFile=true \ -p:CopyOutputSymbolsToPublishDirectory=false \