Skip to content

Commit fb839f9

Browse files
committed
Initial commit
1 parent 122d21d commit fb839f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5276
-1
lines changed

.editorconfig

Lines changed: 457 additions & 0 deletions
Large diffs are not rendered by default.

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: nuget
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "00:00"
8+
open-pull-requests-limit: 20

.github/workflows/ci-build.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
types: [opened, synchronize, reopened, closed]
8+
branches: [ main ]
9+
10+
env:
11+
configuration: Release
12+
productNamespacePrefix: "ReactiveMarbles"
13+
14+
jobs:
15+
build:
16+
runs-on: windows-latest
17+
outputs:
18+
nbgv: ${{ steps.nbgv.outputs.SemVer2 }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/[email protected]
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install .NET Core
26+
uses: actions/[email protected]
27+
with:
28+
dotnet-version: 3.1.x
29+
30+
- name: Install .NET 5
31+
uses: actions/[email protected]
32+
with:
33+
dotnet-version: 5.0.x
34+
35+
# - name: Update VS2019
36+
# shell: powershell
37+
# run: Start-Process -Wait -PassThru -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"""
38+
39+
- name: NBGV
40+
id: nbgv
41+
uses: dotnet/nbgv@master
42+
with:
43+
setAllVars: true
44+
45+
- name: NuGet Restore
46+
run: dotnet restore
47+
working-directory: src
48+
49+
- name: Build
50+
run: dotnet build --configuration=${{ env.configuration }} --verbosity=minimal --no-restore
51+
working-directory: src
52+
53+
- name: Run Unit Tests and Generate Coverage
54+
uses: glennawatson/coverlet-msbuild@v1
55+
with:
56+
project-files: '**/*Tests*.csproj'
57+
no-build: true
58+
exclude-filter: '[${{env.productNamespacePrefix}}.*.Tests.*]*'
59+
include-filter: '[${{env.productNamespacePrefix}}*]*'
60+
output-format: cobertura
61+
output: '../../artifacts/'
62+
configuration: ${{ env.configuration }}
63+
64+
- name: Pack
65+
run: dotnet pack --configuration=${{ env.configuration }} --verbosity=minimal --no-restore
66+
working-directory: src
67+
68+
- name: Upload Code Coverage
69+
shell: bash
70+
run: |
71+
echo $PWD
72+
bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -t ${{ env.CODECOV_TOKEN }} -s '$PWD/artifacts' -f '*.xml'
73+
env:
74+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
75+
76+
- name: Create NuGet Artifacts
77+
uses: actions/upload-artifact@master
78+
with:
79+
name: nuget
80+
path: '**/*.nupkg'
81+
82+
release:
83+
runs-on: windows-latest
84+
needs: build
85+
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
86+
steps:
87+
- name: Checkout
88+
uses: actions/[email protected]
89+
with:
90+
fetch-depth: 0
91+
92+
- name: Download NuGet Packages
93+
uses: actions/[email protected]
94+
with:
95+
name: nuget
96+
97+
- uses: nuget/setup-nuget@v1
98+
name: Setup NuGet
99+
100+
# Decode the base 64 encoded pfx and save the Signing_Certificate
101+
- name: Sign NuGet packages
102+
shell: pwsh
103+
run: |
104+
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}")
105+
[IO.File]::WriteAllBytes("GitHubActionsWorkflow.pfx", $pfx_cert_byte)
106+
$secure_password = ConvertTo-SecureString ${{ secrets.SIGN_CERTIFICATE_PASSWORD }} –asplaintext –force
107+
Import-PfxCertificate -FilePath GitHubActionsWorkflow.pfx -Password $secure_password -CertStoreLocation Cert:\CurrentUser\My
108+
nuget sign -Timestamper http://timestamp.digicert.com -CertificateFingerprint ${{ secrets.SIGN_CERTIFICATE_HASH }} **/*.nupkg
109+
110+
- name: Changelog
111+
uses: glennawatson/ChangeLog@v1
112+
id: changelog
113+
114+
- name: Create Release
115+
uses: actions/[email protected]
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
118+
with:
119+
tag_name: ${{ needs.build.outputs.nbgv }}
120+
release_name: ${{ needs.build.outputs.nbgv }}
121+
body: |
122+
${{ steps.changelog.outputs.commitLog }}
123+
124+
- name: NuGet Push
125+
env:
126+
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
127+
SOURCE_URL: https://api.nuget.org/v3/index.json
128+
run: |
129+
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Reactive Marbles
3+
Copyright (c) 2020 ReactiveUI Association, Inc
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/Directory.Build.props

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<Project>
2+
<PropertyGroup>
3+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
4+
<NoWarn>$(NoWarn);1591;1701;1702;1705;VSX1000</NoWarn>
5+
<Platform>AnyCPU</Platform>
6+
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
7+
<DebugType>embedded</DebugType>
8+
<Authors>Glenn Watson</Authors>
9+
<Copyright>Copyright (c) 2021 ReactiveUI Association Inc</Copyright>
10+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
11+
<PackageProjectUrl>https://github.com/reactivemarbles/CacheDatabase</PackageProjectUrl>
12+
<PackageDescription>Allows users to cache values in a local sqlite database.</PackageDescription>
13+
<Owners>glennawatson</Owners>
14+
<PackageTags>system.reactive;propertychanged;inpc;reactive;functional;akavache;cache;database</PackageTags>
15+
<PackageReleaseNotes>https://github.com/reactivemarbles/CacheDatabase/releases</PackageReleaseNotes>
16+
<RepositoryUrl>https://github.com/reactivemarbles/CacheDatabase</RepositoryUrl>
17+
<RepositoryType>git</RepositoryType>
18+
19+
<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
20+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
21+
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
22+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
23+
<!-- Include PDB in the built .nupkg -->
24+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
25+
</PropertyGroup>
26+
27+
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
28+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
29+
</ItemGroup>
30+
31+
<PropertyGroup>
32+
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
33+
</PropertyGroup>
34+
35+
<ItemGroup>
36+
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
37+
</ItemGroup>
38+
39+
<ItemGroup>
40+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.231" PrivateAssets="all" />
41+
</ItemGroup>
42+
43+
<ItemGroup>
44+
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.354" PrivateAssets="all" />
45+
<PackageReference Include="Roslynator.Analyzers" Version="3.2.0" PrivateAssets="All" />
46+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="all" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
50+
</ItemGroup>
51+
</Project>

src/Directory.build.targets

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Product>$(AssemblyName) ($(TargetFramework))</Product>
4+
</PropertyGroup>
5+
6+
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
7+
<DefineConstants>$(DefineConstants);NET_45;XAML</DefineConstants>
8+
</PropertyGroup>
9+
<PropertyGroup Condition="$(TargetFramework.StartsWith('uap'))">
10+
<DefineConstants>$(DefineConstants);NETFX_CORE;XAML;WINDOWS_UWP</DefineConstants>
11+
</PropertyGroup>
12+
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS'))">
13+
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
14+
</PropertyGroup>
15+
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac'))">
16+
<DefineConstants>$(DefineConstants);MONO;COCOA</DefineConstants>
17+
</PropertyGroup>
18+
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.TVOS'))">
19+
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
20+
</PropertyGroup>
21+
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.WatchOS'))">
22+
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
23+
</PropertyGroup>
24+
<PropertyGroup Condition="$(TargetFramework.StartsWith('MonoAndroid'))">
25+
<DefineConstants>$(DefineConstants);MONO;ANDROID</DefineConstants>
26+
</PropertyGroup>
27+
<PropertyGroup Condition="$(TargetFramework.StartsWith('tizen'))">
28+
<DefineConstants>$(DefineConstants);TIZEN</DefineConstants>
29+
</PropertyGroup>
30+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<LangVersion>latest</LangVersion>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<ProjectReference Include="..\ReactiveMarbles.CacheDatabase.Core\ReactiveMarbles.CacheDatabase.Core.csproj" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="System.Text.Json" Version="5.0.2" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) 2019-2021 ReactiveUI Association Incorporated. All rights reserved.
2+
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for full license information.
4+
5+
using System;
6+
using System.Text.Json;
7+
using System.Text.Json.Serialization;
8+
9+
using ReactiveMarbles.CacheDatabase.Core;
10+
11+
namespace ReactiveMarbles.CacheData.SystemTextJson
12+
{
13+
/// <summary>
14+
/// A converter using System.Text.Json.
15+
/// </summary>
16+
public class SystemJsonSerializer : ISerializer
17+
{
18+
/// <summary>
19+
/// Gets or sets the optional options.
20+
/// </summary>
21+
public JsonSerializerOptions? Options { get; set; }
22+
23+
/// <inheritdoc/>
24+
public T? Deserialize<T>(byte[] bytes) => (T?)JsonSerializer.Deserialize(bytes, typeof(T), Options);
25+
26+
/// <inheritdoc/>
27+
public byte[] Serialize<T>(T item) => JsonSerializer.SerializeToUtf8Bytes(item, Options);
28+
}
29+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# editorconfig.org
2+
# override for benchmarks.
3+
4+
# top-most EditorConfig file
5+
root = true

0 commit comments

Comments
 (0)