Skip to content

Commit 8bc6de2

Browse files
committed
Cross-compile for .NET Core 3.0 and .NET Standard
1 parent 928598c commit 8bc6de2

File tree

7 files changed

+28
-16
lines changed

7 files changed

+28
-16
lines changed

.appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ environment:
1919
DOTNET_CLI_TELEMETRY_OPTOUT: true
2020
CI: true
2121
artifacts:
22-
- path: .\src\Webenable.Logging.JavaScript\artifacts\**\*.nupkg
22+
- path: .\artifacts\**\*.nupkg
2323
name: NuGet

.travis.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
language: csharp
22
mono: none
3-
dotnet: 2.1.701
3+
dotnet: 3.0
44
dist: xenial
5+
env:
6+
global:
7+
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
8+
- DOTNET_CLI_TELEMETRY_OPTOUT=true
59
branches:
610
only:
711
- master
@@ -13,5 +17,5 @@ matrix:
1317
- os: linux
1418
dist: xenial
1519
- os: osx
16-
dotnet: 2.1.701
17-
osx_image: xcode10.1
20+
dotnet: 3.0.100
21+
osx_image: xcode11.2

global.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "3.0.100"
4+
}
5+
}

src/Webenable.Logging.JavaScript/Webenable.Logging.JavaScript.csproj

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netstandard2.0</TargetFramework>
4-
<VersionPrefix>1.0.0</VersionPrefix>
3+
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
4+
<VersionPrefix>1.1.0</VersionPrefix>
55
<Description>Forwards JavaScript logs to ASP.NET Core applications.</Description>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<Copyright>© 2019 Webenable B.V., Henk Mollema</Copyright>
@@ -14,10 +14,13 @@
1414
<NoWarn>CS1591</NoWarn>
1515
<LangVersion>latest</LangVersion>
1616
</PropertyGroup>
17-
<ItemGroup>
17+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
1818
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.0" />
1919
<PackageReference Include="Microsoft.AspNetCore.Razor" Version="2.1.0" />
2020
</ItemGroup>
21+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
22+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
23+
</ItemGroup>
2124
<ItemGroup>
2225
<Compile Update="Resources.Designer.cs" DesignTime="True" AutoGen="True" DependentUpon="Resources.resx" />
2326
<EmbeddedResource Update="Resources.resx" Generator="ResXFileCodeGenerator" LastGenOutput="Resources.Designer.cs" />

test/Webenable.Logging.JavaScript.TestWebsite/Startup.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Microsoft.AspNetCore.Mvc;
44
using Microsoft.Extensions.Configuration;
55
using Microsoft.Extensions.DependencyInjection;
6+
using Microsoft.Extensions.Hosting;
67

78
namespace Webenable.Logging.JavaScript.TestWebsite
89
{
@@ -18,10 +19,10 @@ public Startup(IConfiguration configuration)
1819
public void ConfigureServices(IServiceCollection services)
1920
{
2021
services.AddJavaScriptLogging();
21-
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
22+
services.AddRazorPages().SetCompatibilityVersion(CompatibilityVersion.Latest);
2223
}
2324

24-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
25+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
2526
{
2627
if (env.IsDevelopment())
2728
{
@@ -34,7 +35,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
3435

3536
app.UseStaticFiles();
3637

37-
app.UseMvc();
38+
app.UseRouting();
39+
app.UseEndpoints(endpoints => endpoints.MapRazorPages());
3840
}
3941
}
4042
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.1</TargetFramework>
3+
<TargetFramework>netcoreapp3.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\..\src\Webenable.Logging.JavaScript\Webenable.Logging.JavaScript.csproj" />
7-
<PackageReference Include="Microsoft.AspNetCore.App" />
8-
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
97
</ItemGroup>
108
</Project>

test/Webenable.Logging.JavaScript.Tests/Webenable.Logging.JavaScript.Tests.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.1</TargetFramework>
3+
<TargetFramework>netcoreapp3.0</TargetFramework>
44
<IsPackable>false</IsPackable>
55
</PropertyGroup>
66
<ItemGroup>
77
<ProjectReference Include="..\Webenable.Logging.JavaScript.TestWebsite\Webenable.Logging.JavaScript.TestWebsite.csproj" />
8-
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.6" />
9-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.1.3" />
8+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
9+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.0.0" />
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
1111
<PackageReference Include="xunit" Version="2.4.1" />
1212
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />

0 commit comments

Comments
 (0)