Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Commit c22c547

Browse files
committed
fix command line argument issue for json arguments
add .netcore2.1 support
1 parent 899a3cf commit c22c547

File tree

8 files changed

+114
-4
lines changed

8 files changed

+114
-4
lines changed

.vscode/launch.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (console)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/src/LocalStack.AwsLocal/bin/Debug/netcoreapp3.1/LocalStack.AwsLocal.dll",
14+
"args": [
15+
"sns",
16+
"publish",
17+
"--topic-arn",
18+
"arn:aws:sns:eu-central-1:000000000000:sentinel-live-jobupdate",
19+
"--message",
20+
" '{ \"JobId\": 5, \"JobStatusId\" : 9, \"Environment\": \"Development\" }'"
21+
],
22+
"cwd": "${workspaceFolder}/src/LocalStack.AwsLocal",
23+
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
24+
"console": "internalConsole",
25+
"stopAtEntry": false
26+
},
27+
{
28+
"name": ".NET Core Attach",
29+
"type": "coreclr",
30+
"request": "attach",
31+
"processId": "${command:pickProcess}"
32+
}
33+
]
34+
}

.vscode/tasks.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"${workspaceFolder}/src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj",
36+
"/property:GenerateFullPaths=true",
37+
"/consoleloggerparameters:NoSummary"
38+
],
39+
"problemMatcher": "$msCompile"
40+
}
41+
]
42+
}

build/azure-pipelines.artifact.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ steps:
2525
version: "3.1.x"
2626
packageType: sdk
2727

28+
- task: UseDotNet@2
29+
displayName: ".NET Core 2.1.x"
30+
inputs:
31+
version: "2.1.x"
32+
packageType: sdk
33+
2834
- task: Bash@3
2935
displayName: "Compile & Tests"
3036
inputs:

build/azure-pipelines.macos.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ steps:
2727
version: "3.1.x"
2828
packageType: sdk
2929

30+
- task: UseDotNet@2
31+
displayName: ".NET Core 2.1.x"
32+
inputs:
33+
version: "2.1.x"
34+
packageType: sdk
35+
3036
- task: Bash@3
3137
displayName: "Compile & Tests"
3238
inputs:

build/azure-pipelines.ubuntu.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ steps:
3030
version: "3.1.x"
3131
packageType: sdk
3232

33+
- task: UseDotNet@2
34+
displayName: ".NET Core 2.1.x"
35+
inputs:
36+
version: "2.1.x"
37+
packageType: sdk
38+
3339
- task: Bash@3
3440
displayName: "Compile & Tests"
3541
inputs:

src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
66
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
77
<AssemblyName>LocalStack.AwsLocal</AssemblyName>
88
<RootNamespace>LocalStack.AwsLocal</RootNamespace>
@@ -29,7 +29,7 @@
2929
<None Include="LICENSE.txt" Pack="true" PackagePath="">
3030
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3131
</None>
32-
<None Include="../../assets/localstack-dotnet-square.png" Pack="true" PackagePath=""/>
32+
<None Include="../../assets/localstack-dotnet-square.png" Pack="true" PackagePath="" />
3333
</ItemGroup>
3434

3535
<ItemGroup>
@@ -46,4 +46,12 @@
4646

4747
<None Include="..\..\depedencies\README.md" Link="Depedencies\README.md" />
4848
</ItemGroup>
49+
50+
<ItemGroup>
51+
<Folder Include="Depedencies\CommandLineApi\" />
52+
</ItemGroup>
53+
54+
<ItemGroup>
55+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20214.1" />
56+
</ItemGroup>
4957
</Project>

src/LocalStack.AwsLocal/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
using LocalStack.Client;
22
using System;
3+
using System.CommandLine;
4+
using System.CommandLine.Parsing;
5+
using System.Diagnostics;
6+
using System.Linq;
37

48
namespace LocalStack.AwsLocal
59
{
@@ -9,10 +13,14 @@ internal static class Program
913

1014
private static void Main(string[] args)
1115
{
16+
var rootCommand = new RootCommand();
17+
ParseResult parseResult = rootCommand.Parse(args);
18+
var parsedArgs = parseResult.Tokens.Select(token => token.Value).ToArray();
19+
1220
var processHelper = new ProcessHelper();
1321
var config = new Config(LocalStackHost);
1422

15-
var commandDispatcher = new CommandDispatcher(processHelper, config, args);
23+
var commandDispatcher = new CommandDispatcher(processHelper, config, parsedArgs);
1624

1725
commandDispatcher.Run();
1826
}

tests/LocalStack.AwsLocal.Tests/LocalStack.AwsLocal.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
55

66
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
77
<LangVersion>latest</LangVersion>

0 commit comments

Comments
 (0)