Skip to content

Commit

Permalink
Update to ASP.NET Core 3.1 (#49)
Browse files Browse the repository at this point in the history
* Update to ASP.NET Core 3.1

Update to ASP.NET Core 3.1.0.
Update NuGet packages to their latest versions.

* Fix-up build script

Apply various improvements from other repos, which should also fix the tests failing in AppVeyor.

* Update .travis.yml

Rely on build.sh to install .NET Core.

* Update build.sh

Do not install 2.2 to a custom directory.
Use the most recent release of the 2.2 SDK.

* Update build.sh

Swap SDK install order to try and fix the build.

* Install .NET 2.2 in AppVeyor

Install .NET Core 2.2 in AppVeyor to try and workaround the CI build issue causing BundleMinifier.Core to fail.

* Update Selenium.WebDriver.ChromeDriver

Update to the latest release of Selenium.WebDriver.ChromeDriver.
  • Loading branch information
martincostello authored Dec 13, 2019
1 parent 5ec6997 commit 4debe72
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 22 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
sudo: required
dist: xenial
language: csharp
mono: none

os:
- linux
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/src/ApplePayJS/bin/Debug/netcoreapp3.0/JustEat.ApplePayJS.dll",
"program": "${workspaceRoot}/src/ApplePayJS/bin/Debug/netcoreapp3.1/JustEat.ApplePayJS.dll",
"args": [],
"cwd": "${workspaceRoot}/src/ApplePayJS",
"stopAtEntry": false,
Expand Down
22 changes: 17 additions & 5 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ param(
[Parameter(Mandatory = $false)][string] $OutputPath = ""
)

# These make CI builds faster
$env:DOTNET_MULTILEVEL_LOOKUP = "0"
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "true"
$env:NUGET_XMLDOC_MODE = "skip"

$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"

$solutionPath = Split-Path $MyInvocation.MyCommand.Definition
$solutionFile = Join-Path $solutionPath "ApplePayJS.sln"
$sdkFile = Join-Path $solutionPath "global.json"

$dotnetVersion = (Get-Content $sdkFile | ConvertFrom-Json).sdk.version
$dotnetVersion = (Get-Content $sdkFile | Out-String | ConvertFrom-Json).sdk.version

if ($OutputPath -eq "") {
$OutputPath = Join-Path "$(Convert-Path "$PSScriptRoot")" "artifacts"
Expand All @@ -36,6 +42,7 @@ else {
}

if ($installDotNetSdk -eq $true) {

$env:DOTNET_INSTALL_DIR = Join-Path "$(Convert-Path "$PSScriptRoot")" ".dotnetcli"
$sdkPath = Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetVersion"

Expand All @@ -44,15 +51,20 @@ if ($installDotNetSdk -eq $true) {
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
}
$installScript = Join-Path $env:DOTNET_INSTALL_DIR "install.ps1"
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript -UseBasicParsing
& $installScript -Version "2.2.207" -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath
& $installScript -Version "$dotnetVersion" -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath
}

$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
$dotnet = Join-Path "$env:DOTNET_INSTALL_DIR" "dotnet.exe"
}
else {
$dotnet = "dotnet.exe"
$env:DOTNET_INSTALL_DIR = Split-Path -Path (Get-Command dotnet.exe).Path
}

$dotnet = Join-Path "$env:DOTNET_INSTALL_DIR" "dotnet.exe"

if (($installDotNetSdk -eq $true) -And ($null -eq $env:TF_BUILD)) {
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
}

Write-Host "Publishing solution..." -ForegroundColor Green
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl>
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>3.1.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
|:-:|:-:|:-:|
| **Build Status** | [![Build status](https://img.shields.io/travis/justeat/ApplePayJSSample/master.svg)](https://travis-ci.org/justeat/ApplePayJSSample) | [![Build status](https://img.shields.io/appveyor/ci/justeattech/applepayjssample/master.svg)](https://ci.appveyor.com/project/justeattech/applepayjssample) |

This repository contains a sample implementation of [Apple Pay JS](https://developer.apple.com/reference/applepayjs/) using ASP.NET Core 3.0 written in C# and JavaScript.
This repository contains a sample implementation of [Apple Pay JS](https://developer.apple.com/reference/applepayjs/) using ASP.NET Core 3.1 written in C# and JavaScript.

## Overview

Expand All @@ -24,7 +24,7 @@ The key components to look at for the implementation are:

To setup the repository to run the sample, perform the steps below:

1. Install the [.NET Core 3.0.100 SDK](https://www.microsoft.com/net/download/core), Visual Studio 2019 or Visual Studio Code.
1. Install the [.NET Core 3.1.100 SDK](https://www.microsoft.com/net/download/core), Visual Studio 2019 or Visual Studio Code.
1. Fork this repository.
1. Clone the repository from your fork to your local machine: ```git clone https://github.com/{username}/ApplePayJSSample.git```
1. Restore the Bower, npm and NuGet packages.
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
os: Visual Studio 2019
version: 3.0.{build}
version: 3.1.{build}

environment:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export PATH="$DOTNET_INSTALL_DIR:$PATH"
dotnet_version=$(dotnet --version)

if [ "$dotnet_version" != "$CLI_VERSION" ]; then
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version "2.2.402" --install-dir "$DOTNET_INSTALL_DIR"
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version "2.2.207" --install-dir "$DOTNET_INSTALL_DIR"
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR"
fi

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.0.100"
"version": "3.1.100"
}
}
2 changes: 1 addition & 1 deletion src/ApplePayJS/ApplePayJS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageTags>applepay</PackageTags>
<PreserveCompilationContext>true</PreserveCompilationContext>
<RootNamespace>JustEat.ApplePayJS</RootNamespace>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
<UserSecretsId>JustEat.ApplePayJS</UserSecretsId>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ApplePayJS/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/ApplePayJS/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "justeatapplepayjs",
"private": true,
"version": "3.0.0",
"version": "3.1.0",
"devDependencies": {
"@types/applepayjs": "3.0.0",
"@types/jquery": "3.3.6",
Expand Down
10 changes: 5 additions & 5 deletions tests/ApplePayJS.Tests/ApplePayJS.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\ApplePayJS\ApplePayJS.csproj" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="JustEat.HttpClientInterception" Version="2.0.2" />
<PackageReference Include="JustEat.HttpClientInterception" Version="3.0.0" />
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Selenium.Support" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="77.0.3865.4000" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="79.0.3945.3600" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
Expand Down

0 comments on commit 4debe72

Please sign in to comment.