Skip to content

Commit

Permalink
Support Codespaces
Browse files Browse the repository at this point in the history
Add support for GitHub Codespaces.
  • Loading branch information
martincostello committed Aug 14, 2021
1 parent 0d6082a commit d8eeb99
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "C# (.NET)",
"extensions": [
"editorconfig.editorconfig",
"ms-dotnettools.csharp",
"ms-vscode.PowerShell"
],
"postCreateCommand": "./build.ps1 -SkipTests",
"remoteEnv": {
"PATH": "/root/.dotnet/tools:${containerWorkspaceFolder}/.dotnetcli:${containerEnv:PATH}"
}
}
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"editorconfig.editorconfig",
"ms-dotnettools.csharp"
"ms-dotnettools.csharp",
"ms-vscode.PowerShell"
]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"args": [
"test"
],
"cwd": "${workspaceRoot}/tests/AwsLambdaTestServer.Tests",
"cwd": "${workspaceFolder}/tests/AwsLambdaTestServer.Tests",
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
Expand Down
6 changes: 4 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="5.0.9" Condition=" '$(TargetFramework)' == 'net5.0' " />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="ReportGenerator" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
<PackageReference Include="coverlet.msbuild" PrivateAssets="All" />
<PackageReference Include="ReportGenerator" PrivateAssets="All" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ function DotNetPack {
function DotNetTest {
param([string]$Project)

$nugetPath = Join-Path ($env:USERPROFILE ?? "~") ".nuget\packages"
$nugetPath = $env:NUGET_PACKAGES ?? (Join-Path ($env:USERPROFILE ?? "~") ".nuget\packages")
$propsFile = Join-Path $solutionPath "Directory.Packages.props"
$reportGeneratorVersion = (Select-Xml -Path $propsFile -XPath "//PackageVersion[@Include='ReportGenerator']/@Version").Node.'#text'
$reportGeneratorPath = Join-Path $nugetPath "reportgenerator\$reportGeneratorVersion\tools\netcoreapp3.0\ReportGenerator.dll"
$reportGeneratorPath = Join-Path $nugetPath "reportgenerator\$reportGeneratorVersion\tools\net5.0\ReportGenerator.dll"

$coverageOutput = Join-Path "./tests/AwsLambdaTestServer.Tests" "coverage.*.cobertura.xml"
$reportOutput = Join-Path $OutputPath "coverage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<Description>Tests for MartinCostello.Testing.AwsLambdaTestServer.</Description>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);CA1062;CA1707;CA2007;CA2234;SA1600</NoWarn>
<RootNamespace>MartinCostello.Testing.AwsLambdaTestServer</RootNamespace>
<Summary>$(Description)</Summary>
Expand Down

0 comments on commit d8eeb99

Please sign in to comment.