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

Commit 3b57af7

Browse files
committed
1 parent 5dcd548 commit 3b57af7

File tree

12 files changed

+125
-43
lines changed

12 files changed

+125
-43
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "depedencies/localstack-dotnet-client"]
22
path = depedencies/localstack-dotnet-client
33
url = https://github.com/localstack-dotnet/localstack-dotnet-client.git
4-
branch = v0.8.0.163
4+
branch = v1.0.0
23 KB
Loading

assets/localstack-dotnet.png

21.2 KB
Loading

build.cake

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
2-
using System.Diagnostics;
32
using System.Text.RegularExpressions;
3+
using System.Diagnostics;
44

55
var target = Argument("target", "default");
66
var configuration = Argument("config", "Release");
@@ -10,7 +10,8 @@ var artifactOutput = "./artifacts";
1010
var testResults = "results.trx";
1111
string projectPath = "./src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj";
1212

13-
Task("default")
13+
14+
Task("Default")
1415
.IsDependentOn("init")
1516
.IsDependentOn("tests");
1617

@@ -22,15 +23,21 @@ Task("init")
2223
Arguments = "--info"
2324
});
2425

25-
StartProcess("git", new ProcessSettings {
26-
Arguments = "submodule update --init --recursive"
27-
});
28-
2926
if(IsRunningOnUnix())
3027
{
3128
StartProcess("git", new ProcessSettings {
3229
Arguments = "config --global core.autocrlf true"
3330
});
31+
32+
StartProcess("git", new ProcessSettings {
33+
Arguments = "submodule update --init --recursive"
34+
});
35+
36+
StartProcess("mono", new ProcessSettings {
37+
Arguments = "--version"
38+
});
39+
40+
InstallXUnitNugetPackage();
3441
}
3542
});
3643

@@ -66,13 +73,18 @@ Task("tests")
6673
foreach(string targetFramework in testProj.TargetFrameworks)
6774
{
6875
Warning($"Running {targetFramework.ToUpper()} tests for {testProj.AssemblyName}");
69-
70-
string testFilePrefix = targetFramework.Replace(".","-");
71-
7276
settings.Framework = targetFramework;
73-
settings.ArgumentCustomization = args => args.Append($" --logger \"trx;LogFileName={testFilePrefix}_{testResults}\"");
7477

75-
DotNetCoreTest(testProjectPath, settings);
78+
if(IsRunningOnUnix() && targetFramework == "net461")
79+
{
80+
RunXunitUsingMono(targetFramework, $"{testProj.DirectoryPath}/bin/{configuration}/{targetFramework}/{testProj.AssemblyName}.dll");
81+
}
82+
else
83+
{
84+
string testFilePrefix = targetFramework.Replace(".","-");
85+
settings.ArgumentCustomization = args => args.Append($" --logger \"trx;LogFileName={testFilePrefix}_{testResults}\"");
86+
DotNetCoreTest(testProjectPath, settings);
87+
}
7688
}
7789
}
7890
});
@@ -109,6 +121,28 @@ RunTarget(target);
109121
/*
110122
/ HELPER METHODS
111123
*/
124+
private void InstallXUnitNugetPackage()
125+
{
126+
NuGetInstallSettings nugetInstallSettings = new NuGetInstallSettings();
127+
nugetInstallSettings.Version = "2.4.1";
128+
nugetInstallSettings.Verbosity = NuGetVerbosity.Normal;
129+
nugetInstallSettings.OutputDirectory = "testrunner";
130+
nugetInstallSettings.WorkingDirectory = ".";
131+
132+
NuGetInstall("xunit.runner.console", nugetInstallSettings);
133+
}
134+
135+
private void RunXunitUsingMono(string targetFramework, string assemblyPath)
136+
{
137+
int exitCode = StartProcess("mono", new ProcessSettings {
138+
Arguments = $"./testrunner/xunit.runner.console.2.4.1/tools/{targetFramework}/xunit.console.exe {assemblyPath}"
139+
});
140+
141+
if(exitCode != 0)
142+
{
143+
throw new InvalidOperationException($"Exit code: {exitCode}");
144+
}
145+
}
112146

113147
private IList<TestProjMetadata> GetProjMetadata()
114148
{

build/azure-pipelines.artifact.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,45 @@ trigger:
44
- master
55
- releases/*
66
- feature/*
7+
paths:
8+
exclude:
9+
- README.md
10+
- CONTRIBUTING.md
11+
- LICENSE
712
pr: none
813
pool:
9-
name: Hosted Ubuntu 1604
14+
vmImage: ubuntu-18.04
15+
variables:
16+
Version.MajorMinor: 0.8.1
17+
Version.Revision: $[counter(variables['Version.MajorMinor'], 0)]
1018
steps:
1119
- bash: "sudo apt install nuget && mkdir ./testrunner && sudo chmod -R 777 ./testrunner && ls"
1220
displayName: "Init Task"
1321

22+
- task: UseDotNet@2
23+
displayName: ".NET Core 3.1.x"
24+
inputs:
25+
version: "3.1.x"
26+
packageType: sdk
27+
1428
- task: Bash@3
1529
displayName: "Compile & Tests"
1630
inputs:
1731
targetType: filePath
1832
filePath: ./build.sh
1933

20-
- bash: chmod +x ./build.sh && sudo ./build.sh --target=get-version --buildnumber=$BUILD_ID
34+
- bash: echo $(Version.Revision) && chmod +x ./build.sh && sudo ./build.sh --target=get-version --buildnumber=$BUILD_ID
2135
displayName: "Package Version"
2236
env:
23-
BUILD_ID: $(Build.BuildId)
37+
BUILD_ID: $(Version.Revision)
2438

2539
- bash: chmod +x ./build.sh && sudo ./build.sh --target=nuget-pack --buildnumber=$BUILD_ID
2640
displayName: "Nuget Pack"
2741
env:
28-
BUILD_ID: $(Build.BuildId)
42+
BUILD_ID: $(Version.Revision)
2943

3044
- task: PublishBuildArtifacts@1
3145
displayName: "Publish Artifact: LocalStack.AwsLocal"
3246
inputs:
3347
PathtoPublish: artifacts/
34-
ArtifactName: LocalStack.AwsLocal
48+
ArtifactName: LocalStack.AwsLocal

build/azure-pipelines.macos.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,32 @@ trigger:
33
include:
44
- "*"
55
paths:
6-
include:
7-
- "*"
86
exclude:
9-
- "**/*.md"
7+
- README.md
8+
- CONTRIBUTING.md
9+
- LICENSE
1010
pr:
1111
branches:
1212
include:
1313
- "*"
14+
schedules:
15+
- cron: "0 12 * * 0"
16+
displayName: Weekly Sunday build
17+
branches:
18+
include:
19+
- master
20+
always: true
1421
pool:
15-
name: Hosted macOS
22+
vmImage: macOS-10.14
1623
steps:
24+
- task: UseDotNet@2
25+
displayName: ".NET Core 3.1.x"
26+
inputs:
27+
version: "3.1.x"
28+
packageType: sdk
29+
1730
- task: Bash@3
18-
displayName: 'Compile & Tests'
31+
displayName: "Compile & Tests"
1932
inputs:
2033
targetType: filePath
2134
filePath: ./build.sh

build/azure-pipelines.ubuntu.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,33 @@ trigger:
33
include:
44
- "*"
55
paths:
6-
include:
7-
- "*"
86
exclude:
9-
- "**/*.md"
7+
- README.md
8+
- CONTRIBUTING.md
9+
- LICENSE
1010
pr:
1111
branches:
1212
include:
1313
- "*"
14+
schedules:
15+
- cron: "0 12 * * 0"
16+
displayName: Weekly Sunday build
17+
branches:
18+
include:
19+
- master
20+
always: true
1421
pool:
15-
name: Hosted Ubuntu 1604
22+
vmImage: ubuntu-18.04
1623
steps:
1724
- bash: "sudo apt install nuget && mkdir ./testrunner && sudo chmod -R 777 ./testrunner && ls"
1825
displayName: "Init Task"
1926

27+
- task: UseDotNet@2
28+
displayName: ".NET Core 3.1.x"
29+
inputs:
30+
version: "3.1.x"
31+
packageType: sdk
32+
2033
- task: Bash@3
2134
displayName: "Compile & Tests"
2235
inputs:

build/azure-pipelines.windows.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,23 @@ trigger:
33
include:
44
- "*"
55
paths:
6-
include:
7-
- "*"
86
exclude:
9-
- "**/*.md"
7+
- README.md
8+
- CONTRIBUTING.md
9+
- LICENSE
1010
pr:
1111
branches:
1212
include:
1313
- "*"
14+
schedules:
15+
- cron: "0 12 * * 0"
16+
displayName: Weekly Sunday build
17+
branches:
18+
include:
19+
- master
20+
always: true
1421
pool:
15-
name: Hosted VS2017
22+
vmImage: windows-2019
1623
steps:
1724
- task: PowerShell@2
1825
displayName: "Compile & Tests"

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<Authors>LocalStack.NET, Deniz İrgin</Authors>
44
<Company>LocalStack.NET</Company>
55
<Owners>LocalStack.NET</Owners>
6-
<PackageIconUrl>https://raw.githubusercontent.com/localstack-dotnet/localstack-dotnet-client/master/assets/localstack-dotnet-square.png</PackageIconUrl>
76
<PackageProjectUrl>https://github.com/localstack-dotnet/localstack-awscli-local</PackageProjectUrl>
7+
<PackageIcon>localstack-dotnet-square.png</PackageIcon>
88
<Version>0.8.0</Version>
99
</PropertyGroup>
1010
</Project>

src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj

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

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
77
<AssemblyName>LocalStack.AwsLocal</AssemblyName>
88
<RootNamespace>LocalStack.AwsLocal</RootNamespace>
@@ -18,7 +18,7 @@
1818
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
1919
</PropertyGroup>
2020

21-
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
21+
<Target Name="PreBuild" AfterTargets="PreBuildEvent">
2222
<ItemGroup>
2323
<LicenseFile Include="../../LICENSE" />
2424
</ItemGroup>
@@ -29,6 +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=""/>
3233
</ItemGroup>
3334

3435
<ItemGroup>

0 commit comments

Comments
 (0)