Skip to content

Commit e4985c7

Browse files
askptweyert
authored andcommitted
build: Set language to latest (open-feature#388)
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com> Signed-off-by: Weyert de Boer <weyert@innerfuse.biz>
1 parent 2bc5e68 commit e4985c7

29 files changed

+799
-843
lines changed

CONTRIBUTING.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,19 @@
22

33
## System Requirements
44

5-
Dotnet 6+ is recommended.
6-
7-
## Compilation target(s)
8-
9-
As in the Dotnet-SDK, we target C# LangVersion 7.3. The `Common.props` configures this automatically.
5+
Dotnet 8+ is recommended.
106

117
## Adding a project
128

13-
1. Create a new library project under `src/`: `dotnet new classlib -o src/OpenFeature.Contrib.MyComponent --langVersion 7.3`
9+
1. Create a new library project under `src/`: `dotnet new classlib -o src/OpenFeature.Contrib.MyComponent`
1410
2. Create a new test project under `test/`: `dotnet new xunit -o test/OpenFeature.Contrib.MyComponent.Test`
1511
3. Add the library project to the solution: `dotnet sln DotnetSdkContrib.sln add src/OpenFeature.Contrib.MyComponent/OpenFeature.Contrib.MyComponent.csproj`
1612
4. Add the test project to the solution: `dotnet sln DotnetSdkContrib.sln add test/OpenFeature.Contrib.MyComponent.Test/OpenFeature.Contrib.MyComponent.Test.csproj`
1713
5. Add the desired properties to your library's `.csproj` file (see example below).
18-
5. Remove all content besides the root element from your test project's `.csproj` file (all settings will be inherited).
19-
6. Add the new library project to `release-please-config.json`.
20-
7. Add a `version.txt` file to the root of your library with a version matching that in your new `.csproj` file, e.g. `0.0.1`.
21-
8. If you care to release a pre `1.0.0` version, add the same version above to `.release-please-manifest.json`. Failing to do this will release a `1.0.0` initial release.
14+
6. Remove all content besides the root element from your test project's `.csproj` file (all settings will be inherited).
15+
7. Add the new library project to `release-please-config.json`.
16+
8. Add a `version.txt` file to the root of your library with a version matching that in your new `.csproj` file, e.g. `0.0.1`.
17+
9. If you care to release a pre `1.0.0` version, add the same version above to `.release-please-manifest.json`. Failing to do this will release a `1.0.0` initial release.
2218

2319
Sample `.csproj` file:
2420

@@ -62,34 +58,37 @@ Dependencies used only for building and testing should have a `<PrivateAssets>al
6258
## Consuming pre-release packages
6359

6460
1. Acquire a [GitHub personal access token (PAT)](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) scoped for `read:packages` and verify the permissions:
65-
```console
66-
$ gh auth login --scopes read:packages
67-
68-
? What account do you want to log into? GitHub.com
69-
? What is your preferred protocol for Git operations? HTTPS
70-
? How would you like to authenticate GitHub CLI? Login with a web browser
71-
72-
! First copy your one-time code: ****-****
73-
Press Enter to open github.com in your browser...
74-
75-
✓ Authentication complete.
76-
- gh config set -h github.com git_protocol https
77-
✓ Configured git protocol
78-
✓ Logged in as ********
79-
```
80-
81-
```console
82-
$ gh auth status
83-
84-
github.com
85-
✓ Logged in to github.com as ******** (~/.config/gh/hosts.yml)
86-
✓ Git operations for github.com configured to use https protocol.
87-
✓ Token: gho_************************************
88-
✓ Token scopes: gist, read:org, read:packages, repo, workflow
89-
```
61+
62+
```console
63+
$ gh auth login --scopes read:packages
64+
65+
? What account do you want to log into? GitHub.com
66+
? What is your preferred protocol for Git operations? HTTPS
67+
? How would you like to authenticate GitHub CLI? Login with a web browser
68+
69+
! First copy your one-time code: ****-****
70+
Press Enter to open github.com in your browser...
71+
72+
✓ Authentication complete.
73+
- gh config set -h github.com git_protocol https
74+
✓ Configured git protocol
75+
✓ Logged in as ********
76+
```
77+
78+
```console
79+
$ gh auth status
80+
81+
github.com
82+
✓ Logged in to github.com as ******** (~/.config/gh/hosts.yml)
83+
✓ Git operations for github.com configured to use https protocol.
84+
✓ Token: gho_************************************
85+
✓ Token scopes: gist, read:org, read:packages, repo, workflow
86+
```
87+
9088
2. Run the following command to configure your local environment to consume packages from GitHub Packages:
91-
```console
92-
$ dotnet nuget update source github-open-feature --username $(gh api user --jq .email) --password $(gh auth token) --store-password-in-clear-text
9389

94-
Package source "github-open-feature" was successfully updated.
95-
```
90+
```console
91+
$ dotnet nuget update source github-open-feature --username $(gh api user --jq .email) --password $(gh auth token) --store-password-in-clear-text
92+
93+
Package source "github-open-feature" was successfully updated.
94+
```

src/OpenFeature.Contrib.Providers.Flagsmith/OpenFeature.Contrib.Providers.Flagsmith.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,4 @@
3030
Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net5.0'">
3131
<PackageReference Include="System.Text.Json" Version="8.0.5" />
3232
</ItemGroup>
33-
34-
<PropertyGroup>
35-
<LangVersion>latest</LangVersion>
36-
</PropertyGroup>
3733
</Project>

src/OpenFeature.Contrib.Providers.Flipt/OpenFeature.Contrib.Providers.Flipt.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
<PackageReference Include="OpenFeature" Version="[2.0,3.0)" />
3636
</ItemGroup>
3737

38-
<PropertyGroup>
39-
<LangVersion>latest</LangVersion>
40-
</PropertyGroup>
41-
4238
<Target Name="NSwag" BeforeTargets="BeforeBuild">
4339
<Exec
4440
Command="$(NSwagExe_Net90) openapi2csclient /className:FliptRestClient /namespace:Flipt.Rest /input:&quot;openapi.yaml&quot; /output:&quot;$(ProjectDir)obj/$(ConfigurationName)/$(TargetFramework)/Flipt.Rest.Client.cs&quot; /GenerateExceptionClasses:true /OperationGenerationMode:SingleClientFromPathSegments /JsonLibrary:SystemTextJson /GenerateOptionalParameters:true /GenerateDefaultValues:true /GenerateResponseClasses:true /GenerateClientInterfaces:true /GenerateClientClasses:true /GenerateDtoTypes:true /ExceptionClass:FliptRestException /GenerateNativeRecords:true /UseBaseUrl:false /GenerateBaseUrlProperty:false" />

0 commit comments

Comments
 (0)