Skip to content

Commit

Permalink
Merge pull request #98 from niklaslundberg/develop
Browse files Browse the repository at this point in the history
0.26.0
  • Loading branch information
niklaslundberg committed Nov 15, 2023
2 parents ed3c9d4 + ffb6cf4 commit d3eb606
Show file tree
Hide file tree
Showing 38 changed files with 2,180 additions and 2,028 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: |
6.0.x
7.0.x
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: 8.0.x
cache: true
cache-dependency-path: tests/Arbor.Tooler.Tests.Integration
- name: install-tools
run: |
dotnet tool install --global Arbor.Tooler.GlobalTool --version "*-*"
dotnet tool install --global Arbor.Build.Bootstrapper --version "*-*"
- name: build
shell: cmd
env:
Arbor.Build.NuGet.PackageUpload.Server.ApiKey: ${{ secrets.myget }}
Arbor.Build.NuGet.PackageUpload.Server.Uri: "https://www.myget.org/F/arbor/api/v2/package"
Arbor.Build.NuGet.PackageUpload.Server.Uri: "https://www.myget.org/F/arbor/api/v3/index.json"
Arbor.Build.NuGet.PackageUpload.Enabled: "true"
Arbor.Build.NuGet.PackageUpload.ForceUploadEnabled: "true"
run: build\build.bat
run: |
build\build.bat
8 changes: 6 additions & 2 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ jobs:
java-version: '11' # The OpenJDK version to make available on the path
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: |
6.0.x
7.0.x
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: 8.0.x
cache: true
cache-dependency-path: tests/Arbor.Tooler.Tests.Integration
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.0",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<PackAsTool>true</PackAsTool>
<PackageId>Arbor.Tooler.GlobalTool</PackageId>
<AssemblyName>dotnet-arbor-tooler</AssemblyName>
Expand All @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
63 changes: 31 additions & 32 deletions src/Arbor.Tooler.ConsoleClient/CommandExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,45 @@
using System.Collections.Generic;
using System.Linq;

namespace Arbor.Tooler.ConsoleClient
namespace Arbor.Tooler.ConsoleClient;

internal static class CommandExtensions
{
internal static class CommandExtensions
public const string List = "list";
public const string PackageId = "-package-id";
public const string Source = "-source";
public const string Config = "-config";
public const string Take = "-take";
public const string DownloadDirectory = "-outputdirectory";
public const string ExeVersion = "-exe-version";
public const string Force = "--force";
public const string AllowPreRelease = "--pre-release";

public static string? GetCommandLineValue(this IEnumerable<string> keys, string key)
{
public const string List = "list";
public const string PackageId = "-package-id";
public const string Source = "-source";
public const string Config = "-config";
public const string Take = "-take";
public const string DownloadDirectory = "-outputdirectory";
public const string ExeVersion = "-exe-version";
public const string Force = "--force";
public const string AllowPreRelease = "--pre-release";

public static string? GetCommandLineValue(this IEnumerable<string> keys, string key)
{
string? foundPair = keys.SingleOrDefault(k => k.StartsWith($"{key}=", StringComparison.OrdinalIgnoreCase));
string? foundPair = keys.SingleOrDefault(k => k.StartsWith($"{key}=", StringComparison.OrdinalIgnoreCase));

if (foundPair is null)
{
return default;
}
if (foundPair is null)
{
return default;
}

int separatorIndex = foundPair.IndexOf('=', StringComparison.Ordinal);
int separatorIndex = foundPair.IndexOf('=', StringComparison.Ordinal);

if (separatorIndex < 0)
{
return default;
}
if (separatorIndex < 0)
{
return default;
}

int valueStart = separatorIndex + 1;
int valueStart = separatorIndex + 1;

if (foundPair.Length < valueStart)
{
return default;
}
if (foundPair.Length < valueStart)
{
return default;
}

string commandLineValue = foundPair[valueStart..];
string commandLineValue = foundPair[valueStart..];

return commandLineValue;
}
return commandLineValue;
}
}
13 changes: 6 additions & 7 deletions src/Arbor.Tooler.ConsoleClient/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System.Threading.Tasks;

namespace Arbor.Tooler.ConsoleClient
namespace Arbor.Tooler.ConsoleClient;

internal static class Program
{
internal static class Program
private static async Task<int> Main(string[] args)
{
private static async Task<int> Main(string[] args)
{
using var toolerConsole = ToolerConsole.Create(args);
return await toolerConsole.RunAsync().ConfigureAwait(false);
}
using var toolerConsole = ToolerConsole.Create(args);
return await toolerConsole.RunAsync().ConfigureAwait(false);
}
}
Loading

0 comments on commit d3eb606

Please sign in to comment.