Skip to content

Add SourceLink, embedded readme, implicit usings; refactor project properties #416

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 3 commits into from
Jul 18, 2022
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
33 changes: 33 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project>

<PropertyGroup>
<Authors>Deinok,Alexander Rose,graphql-dotnet</Authors>
<Description>A GraphQL Client for .NET Standard</Description>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<NoWarn>$(NoWarn);NU5105</NoWarn> <!--TODO: fix-->
<NoWarn>$(NoWarn);1591</NoWarn> <!--TODO: write comments to public APIs-->
<Nullable>annotations</Nullable>
<PackageIcon>logo.64x64.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/graphql-dotnet/graphql-client</PackageProjectUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>GraphQL</PackageTags>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Deterministic>true</Deterministic>
<!-- https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables -->
<!-- https://github.com/clairernovotny/DeterministicBuilds -->
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<DebugType>embedded</DebugType>
<ImplicitUsings>enable</ImplicitUsings>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<IsPackable>true</IsPackable>
</PropertyGroup>

</Project>
33 changes: 20 additions & 13 deletions src/src.props → Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
<Project>

<Import Project="../root.props" />

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<LangVersion>8.0</LangVersion>
<PropertyGroup Condition="'$(IsPackable)' == 'true'">
<PackageReadmeFile>README.md</PackageReadmeFile>
<!--<Nullable>enable</Nullable>--> <!--TODO-->
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <!--TODO: remove? since generated on CI-->
</PropertyGroup>

<ItemGroup>
<PackageReference Update="GitVersionTask" Version="5.6.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup Condition=" '$(GitVersion_SemVer)' != ''">
<PropertyGroup Condition="'$(IsPackable)' == 'true' AND '$(GitVersion_SemVer)' != ''">
<GetVersion>false</GetVersion>
<WriteVersionInfoToBuildLog>false</WriteVersionInfoToBuildLog>
<UpdateAssemblyInfo>false</UpdateAssemblyInfo>
Expand All @@ -33,4 +25,19 @@
<RepositoryCommit Condition=" '$(RepositoryCommit)' == '' ">$(GitVersion_Sha)</RepositoryCommit>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPackable)' != 'true'">
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'">
<None Include="..\..\assets\logo.64x64.png" Pack="true" PackagePath="\" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE.txt" Pack="true" PackagePath="\" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Update="GitVersionTask" Version="5.6.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
11 changes: 3 additions & 8 deletions GraphQL.Client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.1.32228.430
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{47C98B55-08F1-4428-863E-2C5C876DEEFE}"
ProjectSection(SolutionItems) = preProject
src\.editorconfig = src\.editorconfig
src\src.props = src\src.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{63F75859-4698-4EDE-8B70-4ACBB8BC425A}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
dotnet-tools.json = dotnet-tools.json
LICENSE.txt = LICENSE.txt
examples\GraphQL.Client.Example\Program.cs = examples\GraphQL.Client.Example\Program.cs
README.md = README.md
root.props = root.props
tests\tests.props = tests\tests.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0B0EDB0F-FF67-4B78-A8DB-B5C23E1FEE8C}"
ProjectSection(SolutionItems) = preProject
tests\tests.props = tests\tests.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{6326E0E2-3F48-4BAF-80D3-47AED5EB647C}"
ProjectSection(SolutionItems) = preProject
Expand Down
2 changes: 0 additions & 2 deletions GraphQL.Client.sln.DotSettings

This file was deleted.

2 changes: 1 addition & 1 deletion examples/GraphQL.Client.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace GraphQL.Client.Example
{
public class Program
public static class Program
{
public static async Task Main()
{
Expand Down
38 changes: 0 additions & 38 deletions root.props

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../src.props" />

<PropertyGroup>
<Description>Abstractions for the Websocket transport used in GraphQL.Client</Description>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace GraphQL.Client.Abstractions.Websocket
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;

namespace GraphQL.Client.Abstractions.Websocket
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.IO;
using System.Threading.Tasks;

namespace GraphQL.Client.Abstractions.Websocket
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../src.props" />

<PropertyGroup>
<Description>Abstractions for GraphQL.Client</Description>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
Expand Down
4 changes: 0 additions & 4 deletions src/GraphQL.Client.Abstractions/GraphQLClientExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Threading;
using System.Threading.Tasks;

namespace GraphQL.Client.Abstractions
{
public static class GraphQLClientExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace GraphQL.Client.Abstractions
{
public static class GraphQLJsonSerializerExtensions
Expand Down
3 changes: 0 additions & 3 deletions src/GraphQL.Client.Abstractions/IGraphQLClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;

namespace GraphQL.Client.Abstractions
{
Expand Down
4 changes: 0 additions & 4 deletions src/GraphQL.Client.Abstractions/IGraphQLJsonSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace GraphQL.Client.Abstractions
{
public interface IGraphQLJsonSerializer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;

namespace GraphQL.Client.Abstractions.Utilities
namespace GraphQL.Client.Abstractions.Utilities
{
/// <summary>
/// Copied from https://github.com/jquense/StringUtils
Expand Down
5 changes: 1 addition & 4 deletions src/GraphQL.Client.Abstractions/Utilities/StringUtils.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Text.RegularExpressions;

namespace GraphQL.Client.Abstractions.Utilities
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../src.props" />

<PropertyGroup>
<Description>A GraphQL Client which executes the queries directly on a provided GraphQL schema using graphql-dotnet</Description>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Threading;
using System.Threading.Tasks;
using GraphQL.Client.Abstractions;
using GraphQL.Types;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;
using System.Linq;
using System.Reflection;
using GraphQL.Client.Abstractions.Utilities;
using Newtonsoft.Json;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../src.props" />

<PropertyGroup>
<Description>A serializer implementation for GraphQL.Client using Newtonsoft.Json as underlying JSON library</Description>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
Expand Down
3 changes: 0 additions & 3 deletions src/GraphQL.Client.Serializer.Newtonsoft/MapConverter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using GraphQL.Client.Abstractions;
using GraphQL.Client.Abstractions.Websocket;
using Newtonsoft.Json;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Buffers;
using System.Numerics;
using System.Text;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../src.props" />

<PropertyGroup>
<Description>A serializer implementation for GraphQL.Client using System.Text.Json as underlying JSON library</Description>
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.Json;
Expand Down
4 changes: 0 additions & 4 deletions src/GraphQL.Client.Serializer.SystemTextJson/MapConverter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text.Json;
using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.IO;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using GraphQL.Client.Abstractions;
using GraphQL.Client.Abstractions.Websocket;

Expand Down
2 changes: 0 additions & 2 deletions src/GraphQL.Client/GraphQL.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../src.props" />

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<RootNamespace>GraphQL.Client.Http</RootNamespace>
Expand Down
8 changes: 1 addition & 7 deletions src/GraphQL.Client/GraphQLHttpClient.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using GraphQL.Client.Abstractions;
using GraphQL.Client.Abstractions.Websocket;
using GraphQL.Client.Http.Websocket;
Expand Down Expand Up @@ -110,7 +104,7 @@ public IObservable<GraphQLResponse<TResponse>> CreateSubscriptionStream<TRespons
#endregion

/// <summary>
/// explicitly opens the websocket connection. Will be closed again on disposing the last subscription
/// Explicitly opens the websocket connection. Will be closed again on disposing the last subscription.
/// </summary>
/// <returns></returns>
public Task InitializeWebsocketConnection() => GraphQlHttpWebSocket.InitializeWebSocket();
Expand Down
1 change: 0 additions & 1 deletion src/GraphQL.Client/GraphQLHttpClientExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Net.WebSockets;
using GraphQL.Client.Abstractions;

Expand Down
5 changes: 1 addition & 4 deletions src/GraphQL.Client/GraphQLHttpClientOptions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.WebSockets;
using System.Threading.Tasks;

namespace GraphQL.Client.Http
{
/// <summary>
/// The Options that the <see cref="GraphQLHttpClient"/> will use
/// The Options that the <see cref="GraphQLHttpClient"/> will use.
/// </summary>
public class GraphQLHttpClientOptions
{
Expand Down
2 changes: 0 additions & 2 deletions src/GraphQL.Client/GraphQLHttpRequest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;
using System.Net.Http;
using System.Runtime.Serialization;
using System.Text;
using GraphQL.Client.Abstractions;
Expand Down
Loading