Skip to content

Commit

Permalink
Dotnet 6 upgrade (#934)
Browse files Browse the repository at this point in the history
Upgrade to DotNet 6
Fix #924
  • Loading branch information
ivanmonteiro authored Feb 23, 2022
1 parent 3f626e8 commit 8049ec2
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-jwt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
architecture: 'x64' # defaults to 'x64'
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
dotnet-version: '6.0.200'
- name: git history
run: git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an>%Creset' --abbrev-commit
- name: PREPARE jhipster env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-microservice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: npm install -g npm@$(node -e "console.log(require('./generators/generator-dotnetcore-constants').NPM_VERSION);")
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
dotnet-version: '6.0.200'
- name: git history
run: git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an>%Creset' --abbrev-commit
- name: PREPARE jhipster env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-oauth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
run: npm install -g npm@$(node -e "console.log(require('./generators/generator-dotnetcore-constants').NPM_VERSION);")
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
dotnet-version: '6.0.200'
- name: git history
run: git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an>%Creset' --abbrev-commit
- name: PREPARE jhipster env
Expand Down
2 changes: 1 addition & 1 deletion docs/Features/fronts.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Blazor can run your client-side C# code directly in the browser, using WebAssemb

### Prerequisites

- [dotnet5.0](https://dotnet.microsoft.com/download/dotnet/5.0)
- [dotnet 6.0](https://dotnet.microsoft.com/download/dotnet/6.0)

### Generate your application

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

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

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

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
13 changes: 3 additions & 10 deletions generators/common/templates/dotnetcore/Dockerfile-Back.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
-%>
# Based on Microsoft's docker samples for dotnet core
# available at https://github.com/dotnet/dotnet-docker/tree/master/samples/aspnetapp
FROM mcr.microsoft.com/dotnet/sdk:5.0-focal AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
# First install nodejs - required to build generated client app
WORKDIR /app
RUN apt-get update -yq && apt-get install -yq curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && \
apt-get install -yq nodejs && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -35,18 +35,11 @@ WORKDIR src/<%= mainProjectDir %>
RUN dotnet publish "<%= pascalizedBaseName %>.csproj" -c Release -o /app/out

# Final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine AS runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal AS runtime
WORKDIR /app
EXPOSE 80
COPY --from=build /app/out .

ENV ASPNETCORE_ENVIRONMENT=Production

# See: https://github.com/dotnet/announcements/issues/20
# Uncomment to enable globalization APIs (or delete)
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
RUN apk add --no-cache icu-libs
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8

ENTRYPOINT ["dotnet", "<%= kebabCasedBaseName %>.dll"]
4 changes: 2 additions & 2 deletions generators/common/templates/dotnetcore/Dockerfile-Front.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Based on Microsoft's docker samples for dotnet core
# available at https://github.com/dotnet/dotnet-docker/tree/master/samples/aspnetapp
FROM mcr.microsoft.com/dotnet/sdk:5.0-focal AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build

WORKDIR /app

Expand All @@ -24,4 +24,4 @@ WORKDIR /usr/share/nginx/html
COPY --from=build /app/out/wwwroot .
COPY ./nginx.conf /etc/nginx/nginx.conf
ARG ServerUrl="https://localhost:8080"
RUN sed -i "/ServerUrl/c\ "\"ServerUrl"\" : "\"$ServerUrl"\"," appsettings.json
RUN sed -i "/ServerUrl/c\ "\"ServerUrl"\" : "\"$ServerUrl"\"," appsettings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<AspNetCorePackageVersion>5.0.0</AspNetCorePackageVersion>
<AspNetCorePackageVersion>6.0.2</AspNetCorePackageVersion>
<EntityFrameworkPackageVersion>5.0.8</EntityFrameworkPackageVersion>
<JHipsterNetPackageVersion>1.0.7</JHipsterNetPackageVersion>
</PropertyGroup>
Expand All @@ -16,7 +16,7 @@
<PackageReference Update="Microsoft.AspNetCore.Components.WebAssembly" Version="$(AspNetCorePackageVersion)" />
<PackageReference Update="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(AspNetCorePackageVersion)" />
<PackageReference Update="Microsoft.Web.LibraryManager.Build" Version="2.1.113" />
<PackageReference Update="System.Net.Http.Json" Version="$(AspNetCorePackageVersion)" />
<PackageReference Update="System.Net.Http.Json" Version="6.0.0" />
<PackageReference Update="Toolbelt.Blazor.HttpClientInterceptor" Version="9.1.0" />
<PackageReference Update="AutoFixture" Version="4.17.0" />
Expand Down Expand Up @@ -121,7 +121,7 @@
<PackageReference Update="Oracle.ManagedDataAccess.Core" Version="3.21.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Tools" Version="$(EntityFrameworkPackageVersion)" />
<%_ break;
} _%>
} _%>
<PackageReference Update="coverlet.msbuild" Version="3.1.0"/>
<PackageReference Update="FakeItEasy" Version="7.1.0" />
<PackageReference Update="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetCorePackageVersion)" />
Expand All @@ -134,6 +134,6 @@
<PackageReference Update="xunit.runner.console" Version="2.4.1"/>
<PackageReference Update="FluentAssertions" Version="5.10.3" />
<PackageReference Update="FluentAssertions.AspNetCore.Mvc" Version="3.2.0" />
<PackageReference Update="FluentAssertions.Json" Version="5.5.0" />
<PackageReference Update="FluentAssertions.Json" Version="5.5.0" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PropertyGroup>
<AssemblyName><%= dasherizedBaseName %></AssemblyName>
<Version>0.0.1</Version>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace><%= namespace %></RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace><%= namespace %>.Test</RootNamespace>
</PropertyGroup>
Expand Down
7 changes: 4 additions & 3 deletions test-integration/scripts/09-verify-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ source $(dirname $0)/01-init-env.sh
#-------------------------------------------------------------------------------
# Run FORMATTING
#-------------------------------------------------------------------------------
dotnet tool install -g dotnet-format
dotnet format --check
# Commented lines below due to error in dotnet format tool - see https://github.com/dotnet/format/issues/1519
#dotnet tool install -g dotnet-format
#dotnet format --verify-no-changes

if [[ $? -ne 0 ]]; then
echo "${RED}FAILED FORMATTING"
exit 1
fi
fi

0 comments on commit 8049ec2

Please sign in to comment.