Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for multiple target frameworks #21

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
strategy:
fail-fast: true
matrix:
dotnet-version: ["6.0.x"]
dotnet-version: ["6.0.x", "7.0.x", "8.0.x"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ services.AddRelewise(options => options.ReadFromConfiguration(configuration));

The configuration offers a lot of other great features, such as

- Set specific options for `DatasetId`, `ApiKey` and `Timeout` for the individual client instances of `ITracker`, `IRecommender` and `ISearcher`.
- Set specific options for `DatasetId`, `ApiKey`, `ServerUrl` and `Timeout` for the individual client instances of `ITracker`, `IRecommender` and `ISearcher`.
- Named clients to allow different configuration for integrations etc or to use for a multi site-setup.

Here is a full example of all the configuration settings we provide via the appsettings or via the fluent API:

```json
"Relewise": {
"DatasetId": "6D9361AA-A23D-4BF2-A818-5ABA792E2102",
"ApiKey": "r4FqfMqtiZjJmoN",
"DatasetId": "<<dataset-id>>",
"ApiKey": "<<api-key>>",
"Timeout": "00:00:03",
"ServerUrl": "https://stage01-api.relewise.com",
"ServerUrl": "<<server-url>>",
"Tracker": {
"Timeout": "00:00:10"
},
Expand All @@ -67,8 +67,9 @@ Here is a full example of all the configuration settings we provide via the apps
}
},
"ContentSite": {
"DatasetId": "8DF23DAF-6C96-47DB-BE34-84629359D3B8",
"ApiKey": "61ce444b6e7c4f",
"DatasetId": "<<dataset-id>>",
"ApiKey": "<<api-key>>",
"ServerUrl": "<<server-url>>",
"Timeout": "00:00:03",
"Tracker": {
"Timeout": "00:00:10"
Expand Down
6 changes: 6 additions & 0 deletions Relewise.Client.Extensions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{0B49B522-D
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Actions", "{FB651A7A-743B-4369-AD17-FDFDBB97726A}"
ProjectSection(SolutionItems) = preProject
.github\workflows\backend.yml = .github\workflows\backend.yml
.github\workflows\publish.yml = .github\workflows\publish.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<LangVersion>10</LangVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Relewise.Client.Extensions/Builders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void Add(string name, Action<RelewiseClientsOptionsBuilder> options, bool
if (Clients.ContainsKey(name) && throwIfExists)
throw new ArgumentException("A client with that name was already registered", nameof(name));

if (Clients.TryGetValue(name, out RelewiseClientsOptionsBuilder builder))
if (Clients.TryGetValue(name, out RelewiseClientsOptionsBuilder? builder))
{
if (throwIfExists)
throw new ArgumentException("A client with that name was already registered", nameof(name));
Expand Down
33 changes: 16 additions & 17 deletions src/Relewise.Client.Extensions/Relewise.Client.Extensions.csproj
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<nullable>enable</nullable>
<LangVersion>10</LangVersion>

<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>true</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyName>Relewise.Client.Extensions</AssemblyName>
<RootNamespace>Relewise.Client.Extensions</RootNamespace>
<Title>Relewise Client Extensions</Title>
<Description>Relewise is a next generation personalization SaaS-platform, which offers functionality within product- and content recommendations and personalized search. This official extension library helps you work more efficient with the Relewise Client SDK (see 'Relewise.Client'), including configuration options, multiple named clients and more to come in the future.</Description>
<PackageIcon>logo.png</PackageIcon>
<PackageTags>Relewise;Recommendations;Search;SearchEngine;Personalization;Recommender</PackageTags>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<License>http://opensource.org/licenses/MIT</License>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/Relewise/relewise-sdk-csharp-extensions</PackageProjectUrl>
<RepositoryUrl>https://github.com/Relewise/relewise-sdk-csharp-extensions</RepositoryUrl>
<PackageId>Relewise.Client.Extensions</PackageId>
<PackageVersion>1.4.2</PackageVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<PackageVersion>1.5.0</PackageVersion>
<Authors>Relewise</Authors>
<Company>Relewise</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Relewise.Client" Version="1.25.0" />
<PackageReference Include="Relewise.Client" Version="[1.25.0, 2)" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="[7.0.0, 9)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="[7.0.4, 9)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[7.0.0, 9)" />
</ItemGroup>

<ItemGroup>
<None Include="logo.png" Pack="true" PackagePath="" />
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="logo.png" Pack="true" PackagePath="\" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
Expand Down