Skip to content

Commit

Permalink
Merge pull request #1217 from praeclarum/net8
Browse files Browse the repository at this point in the history
Upgrade to .NET 8
  • Loading branch information
praeclarum authored Mar 27, 2024
2 parents 89bb0e3 + 3d25c8b commit 57e7350
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 101 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build:

runs-on: macOS-latest
runs-on: ubuntu-latest

steps:

Expand All @@ -21,19 +21,33 @@ jobs:
env:
VERSION_BUILD: ${{github.run_number}}
run: |
sed -i bak "s:</VersionPrefix>:.$VERSION_BUILD</VersionPrefix>:g" Directory.Build.props
sed -i.bak "s:</VersionPrefix>:.$VERSION_BUILD</VersionPrefix>:g" Directory.Build.props
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Install Code Coverarage Tool
run: dotnet tool install --global dotnet-reportgenerator-globaltool

- name: Restore NuGets
run: nuget restore SQLite.sln
run: dotnet restore SQLite.sln

- name: Build and Test
run: |
set -e
cd tests/SQLite.Tests
dotnet test /p:AltCover=true /p:AltCoverForce=true "/p:AltCoverTypeFilter=SQLite.Tests.*"
- name: Verify Async API Matches Sync API
run: |
set -e
dotnet run --project tests/ApiDiff/ApiDiff.csproj
- name: Generate Code Coverage Report
uses: danielpalme/ReportGenerator-GitHub-Action@4.8.4
if: github.event_name == 'push'
with:
reports: 'tests/SQLite.Tests/coverage.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
targetdir: 'CoverageReport' # REQUIRED # The directory where the generated report should be saved.
Expand All @@ -59,11 +73,12 @@ jobs:
enable_jekyll: true

- name: Package
if: github.event_name == 'push'
run: |
make nuget
- uses: actions/upload-artifact@master
if: github.event_name == 'push'
with:
name: Packages
path: PackagesOut

13 changes: 1 addition & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@ SRC=src/SQLite.cs src/SQLiteAsync.cs

PACKAGES_OUT=$(abspath PackagesOut)

all: test nuget

test: tests/bin/Release/SQLite.Tests.dll tests/ApiDiff/bin/Release/ApiDiff.exe
mono packages/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe tests/bin/Release/SQLite.Tests.dll --labels=On --trace=Info
mono tests/ApiDiff/bin/Release/ApiDiff.exe

tests/bin/Release/SQLite.Tests.dll: tests/SQLite.Tests.csproj $(SRC)
nuget restore SQLite.sln
msbuild /p:Configuration=Release tests/SQLite.Tests.csproj

tests/ApiDiff/bin/Release/ApiDiff.exe: tests/ApiDiff/ApiDiff.csproj $(SRC)
msbuild /p:Configuration=Release tests/ApiDiff/ApiDiff.csproj
all: nuget

nuget: pclnuget basenuget sqlciphernuget staticnuget

Expand Down
15 changes: 0 additions & 15 deletions SQLite.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLiteTestsiOS", "tests\SQLite.Tests.iOS\SQLiteTestsiOS.csproj", "{81850129-71C3-40C7-A48B-AA5D2C2E365E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-std", "nuget\SQLite-net-std\SQLite-net-std.csproj", "{081D08D6-10F1-431B-88FE-469FD9FE898C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiDiff", "tests\ApiDiff\ApiDiff.csproj", "{1DEF735C-B973-4ED9-8446-7FFA6D0B410B}"
Expand All @@ -33,18 +31,6 @@ Global
Debug|iPhone = Debug|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|Any CPU.ActiveCfg = Release|iPhone
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|Any CPU.Build.0 = Release|iPhone
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|iPhone.ActiveCfg = Release|iPhone
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|iPhone.Build.0 = Release|iPhone
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|iPhone.ActiveCfg = Debug|iPhone
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|iPhone.Build.0 = Debug|iPhone
{081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -119,7 +105,6 @@ Global
{7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{81850129-71C3-40C7-A48B-AA5D2C2E365E} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}
{1DEF735C-B973-4ED9-8446-7FFA6D0B410B} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}
{80B66A43-B358-4438-BF06-6351B86B121A} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}
EndGlobalSection
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "8.0.100"
}
}
4 changes: 2 additions & 2 deletions src/SQLite.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2009-2021 Krueger Systems, Inc.
// Copyright (c) 2009-2024 Krueger Systems, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -2003,7 +2003,7 @@ public int Update (object obj, Type objType)
throw NotNullConstraintViolationException.New (ex, map, obj);
}

throw ex;
throw;
}

if (rowsAffected > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/SQLiteAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2012-2021 Krueger Systems, Inc.
// Copyright (c) 2012-2024 Krueger Systems, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 3 additions & 37 deletions tests/ApiDiff/ApiDiff.csproj
Original file line number Diff line number Diff line change
@@ -1,42 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1DEF735C-B973-4ED9-8446-7FFA6D0B410B}</ProjectGuid>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>ApiDiff</RootNamespace>
<AssemblyName>ApiDiff</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="ListDiff">
<HintPath>..\..\packages\ListDiff.1.0.7\lib\netstandard1.0\ListDiff.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="..\..\src\SQLite.cs">
<Link>SQLite.cs</Link>
</Compile>
Expand All @@ -45,7 +12,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="ListDiff" Version="1.2.10" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
24 changes: 0 additions & 24 deletions tests/ApiDiff/Properties/AssemblyInfo.cs

This file was deleted.

4 changes: 0 additions & 4 deletions tests/ApiDiff/packages.config

This file was deleted.

4 changes: 2 additions & 2 deletions tests/SQLite.Tests/SQLite.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="AltCover" Version="7.3.802" />
<PackageReference Include="AltCover" Version="8.7.3" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
Expand Down

0 comments on commit 57e7350

Please sign in to comment.