Skip to content

build: Set language to latest #388

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

Merged
merged 8 commits into from
May 12, 2025
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
77 changes: 38 additions & 39 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@

## System Requirements

Dotnet 6+ is recommended.

## Compilation target(s)

As in the Dotnet-SDK, we target C# LangVersion 7.3. The `Common.props` configures this automatically.
Dotnet 8+ is recommended.

## Adding a project

1. Create a new library project under `src/`: `dotnet new classlib -o src/OpenFeature.Contrib.MyComponent --langVersion 7.3`
1. Create a new library project under `src/`: `dotnet new classlib -o src/OpenFeature.Contrib.MyComponent`
2. Create a new test project under `test/`: `dotnet new xunit -o test/OpenFeature.Contrib.MyComponent.Test`
3. Add the library project to the solution: `dotnet sln DotnetSdkContrib.sln add src/OpenFeature.Contrib.MyComponent/OpenFeature.Contrib.MyComponent.csproj`
4. Add the test project to the solution: `dotnet sln DotnetSdkContrib.sln add test/OpenFeature.Contrib.MyComponent.Test/OpenFeature.Contrib.MyComponent.Test.csproj`
5. Add the desired properties to your library's `.csproj` file (see example below).
5. Remove all content besides the root element from your test project's `.csproj` file (all settings will be inherited).
6. Add the new library project to `release-please-config.json`.
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`.
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.
6. Remove all content besides the root element from your test project's `.csproj` file (all settings will be inherited).
7. Add the new library project to `release-please-config.json`.
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`.
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.

Sample `.csproj` file:

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

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:
```console
$ gh auth login --scopes read:packages

? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: ****-****
Press Enter to open github.com in your browser...

✓ Authentication complete.
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as ********
```

```console
$ gh auth status

github.com
✓ Logged in to github.com as ******** (~/.config/gh/hosts.yml)
✓ Git operations for github.com configured to use https protocol.
✓ Token: gho_************************************
✓ Token scopes: gist, read:org, read:packages, repo, workflow
```

```console
$ gh auth login --scopes read:packages

? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: ****-****
Press Enter to open github.com in your browser...

✓ Authentication complete.
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as ********
```

```console
$ gh auth status

github.com
✓ Logged in to github.com as ******** (~/.config/gh/hosts.yml)
✓ Git operations for github.com configured to use https protocol.
✓ Token: gho_************************************
✓ Token scopes: gist, read:org, read:packages, repo, workflow
```

2. Run the following command to configure your local environment to consume packages from GitHub Packages:
```console
$ dotnet nuget update source github-open-feature --username $(gh api user --jq .email) --password $(gh auth token) --store-password-in-clear-text

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

Package source "github-open-feature" was successfully updated.
```
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@
Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net5.0'">
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
<PackageReference Include="OpenFeature" Version="[2.0,3.0)" />
</ItemGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<Target Name="NSwag" BeforeTargets="BeforeBuild">
<Exec
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" />
Expand Down
Loading