Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to .net 5 #911

Merged
merged 10 commits into from
Nov 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ jobs:

- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 3.1.301

- name: Build
run: dotnet build --configuration ${{ matrix.configuration }}
Expand All @@ -71,13 +69,13 @@ jobs:
if: ${{ matrix.publishLanguageServer == 'true' }}
with:
name: Bicep.LangServer
path: ./src/Bicep.LangServer/bin/${{ matrix.configuration }}/netcoreapp3.1/publish/*
path: ./src/Bicep.LangServer/bin/${{ matrix.configuration }}/net5.0/publish/*

- name: Upload Bicep
uses: actions/upload-artifact@v2
with:
name: bicep-${{ matrix.configuration }}-${{ matrix.rid }}
path: ./src/Bicep.Cli/bin/${{ matrix.configuration }}/netcoreapp3.1/${{ matrix.rid }}/publish/*
path: ./src/Bicep.Cli/bin/${{ matrix.configuration }}/net5.0/${{ matrix.rid }}/publish/*
if-no-files-found: error

- name: Upload Code Coverage
Expand All @@ -98,8 +96,6 @@ jobs:

- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 3.1.301

- name: Download Bicep CLI
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -187,8 +183,6 @@ jobs:

- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 3.1.301

- name: Setup Node.js
uses: actions/[email protected]
Expand Down
37 changes: 23 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,26 @@ pool:
vmImage: 'ubuntu-latest'

steps:
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
noCache: true
verbosityRestore: 'Normal'
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
failOnAlert: true
- task: UseDotNet@2
displayName: Setup .NET Core
continueOnError: true
inputs:
packageType: 'sdk'
useGlobalJson: true
performMultiLevelLookup: true

- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
noCache: true
verbosityRestore: 'Normal'

- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
failOnAlert: true
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
},
"sdk": {
"allowPrerelease": false,
"version": "3.1.301",
"version": "5.0.100",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Bicep.Cli.UnitTests/Bicep.Cli.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/Bicep.Cli/Bicep.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>bicep</AssemblyName>
<StartupObject>Bicep.Cli.Program</StartupObject>
<!-- .net 5 by default does not package up the native dependencies -->
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Bicep.Core.Samples/Bicep.Core.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Bicep.Core.UnitTests/Bicep.Core.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -11,7 +11,7 @@
<PackageReference Include="JsonDiffPatch.Net" Version="2.2.0" />
<PackageReference Include="DiffPlex" Version="1.6.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.3" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.1.0" />
<PackageReference Include="Moq" Version="4.15.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
Expand All @@ -20,7 +20,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Management.Automation" Version="7.0.3" />
<PackageReference Include="System.Management.Automation" Version="7.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Bicep.Core.UnitTests/Utils/FileHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static string GetResultFilePath(TestContext testContext, string fileName)
{
string filePath = Path.Combine(testContext.TestRunResultsDirectory, testContext.TestName, fileName);

Directory.CreateDirectory(Path.GetDirectoryName(filePath));
Directory.CreateDirectory(Path.GetDirectoryName(filePath) ?? throw new AssertFailedException($"There is no directory path for file '{filePath}'."));
testContext.AddResultFile(filePath);

return filePath;
Expand Down Expand Up @@ -45,7 +45,7 @@ public static string SaveEmbeddedResourcesWithPathPrefix(TestContext testContext
}

var filePath = Path.Combine(outputDirectory, relativePath);
var directoryPath = Path.GetDirectoryName(filePath);
var directoryPath = Path.GetDirectoryName(filePath) ?? throw new AssertFailedException($"There is no directory path for file '{filePath}'.");
Directory.CreateDirectory(directoryPath);

var fileStream = File.Create(filePath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using Bicep.Core;
using Bicep.Core.Extensions;
using Bicep.Core.Navigation;
using Bicep.Core.Parser;
using Bicep.Core.SemanticModel;
Expand Down Expand Up @@ -46,7 +47,7 @@ public void DeclarationSnippetsShouldBeValid()
snippetCompletions.Should().OnlyContain(c => LanguageConstants.DeclarationKeywords.Contains(c.Label));
snippetCompletions.Should().OnlyContain(c => c.Documentation!.HasMarkupContent && c.Documentation.MarkupContent!.Kind == MarkupKind.Markdown);

var snippetsByDetail = snippetCompletions.ToDictionary(c => c.Detail);
var snippetsByDetail = snippetCompletions.Where(c => c.Detail != null).ToImmutableDictionaryExcludingNull(c => c.Detail, StringComparer.Ordinal);

var replacementsByDetail = new Dictionary<string, IList<string>>
{
Expand Down
2 changes: 1 addition & 1 deletion src/Bicep.LangServer/Bicep.LangServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Bicep.LanguageServer</RootNamespace>
</PropertyGroup>

Expand Down
7 changes: 3 additions & 4 deletions src/Bicep.Wasm/Bicep.Wasm.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
</ItemGroup>

Expand Down
4 changes: 3 additions & 1 deletion src/Bicep.Wasm/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
Expand All @@ -16,7 +18,7 @@ public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);

var jsRuntime = builder.Services.BuildServiceProvider().GetService<IJSRuntime>();
var jsRuntime = builder.Services.BuildServiceProvider().GetService<IJSRuntime>() ?? throw new InvalidOperationException("Unable to obtain JS runtime.");
await jsRuntime.InvokeAsync<object>("BicepInitialize", DotNetObjectReference.Create(new Interop(jsRuntime)));

await builder.Build().RunAsync();
Expand Down
2 changes: 1 addition & 1 deletion src/playground/src/lspInterop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function initializeInterop(self): Promise<boolean> {
resolve(true);
}

const test = require('../../Bicep.Wasm/bin/Release/netstandard2.1/wwwroot/_framework/blazor.webassembly.js');
const test = require('../../Bicep.Wasm/bin/Release/net5.0/wwwroot/_framework/blazor.webassembly.js');
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/playground/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
plugins: [
new CopyPlugin({
patterns: [
{ from: '../Bicep.Wasm/bin/Release/netstandard2.1/wwwroot/_framework', to: './_framework/' },
{ from: '../Bicep.Wasm/bin/Release/net5.0/wwwroot/_framework', to: './_framework/' },
],
}),
new HtmlWebpackPlugin({
Expand Down
2 changes: 1 addition & 1 deletion src/vscode-bicep/src/language/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "vscode-azureextensionui";
import { ErrorAction, Message, CloseAction } from "vscode-languageclient/node";

const dotnetRuntimeVersion = "3.1";
const dotnetRuntimeVersion = "5.0";
const packagedServerPath = "bicepLanguageServer/Bicep.LangServer.dll";
const extensionId = "ms-azuretools.vscode-bicep";

Expand Down