Skip to content

Commit

Permalink
CI fixes (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungam3r committed Mar 6, 2023
1 parent 14a784c commit 113bfd3
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 7 deletions.
19 changes: 18 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,31 @@
<LangVersion>latest</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>icon.png</PackageIcon>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">True</ContinuousIntegrationBuild>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);NU5105</NoWarn>
<DebugType>embedded</DebugType>
<ImplicitUsings>enable</ImplicitUsings>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<MinVerDefaultPreReleaseIdentifiers>preview</MinVerDefaultPreReleaseIdentifiers>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup Condition="'$(IsPackable)' == 'true'">
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>See https://github.com/PublicApiGenerator/PublicApiGenerator/releases</PackageReleaseNotes>
<SignAssembly>true</SignAssembly>
<EmbedAllSources>true</EmbedAllSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPackable)' != 'true'">
Expand Down
1 change: 0 additions & 1 deletion src/PublicApiGenerator.Tool/PublicApiGenerator.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net6</TargetFrameworks>
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<ToolCommandName>generate-public-api</ToolCommandName>
<Description>This tool generates your public API to a file. You can use this in approval style tests or for documentation.</Description>
Expand Down
1 change: 0 additions & 1 deletion src/PublicApiGenerator/PublicApiGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<IsPackable>true</IsPackable>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>This library simply returns your public API as a string. You can use this in approval style tests or for documentation.</Description>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions src/PublicApiGeneratorTests/Assembly_attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public void Attributes()
[assembly: PublicApiGeneratorTests.Examples.AttributeWithPositionalParameters1(""Hello"")]
[assembly: PublicApiGeneratorTests.Examples.AttributeWithPositionalParameters2(42)]
[assembly: PublicApiGeneratorTests.Examples.Simple]
[assembly: System.Reflection.AssemblyMetadata(""RepositoryUrl"", """")]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.Runtime.InteropServices.Guid(""3B8D506A-5247-47FF-B053-D29A51A97C33"")]
[assembly: System.Runtime.Versioning.TargetFramework(""{TFM}"", FrameworkDisplayName=""{TFMNAME}"")]
Expand Down
12 changes: 12 additions & 0 deletions src/PublicApiGeneratorTests/HelperTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class GenericTypeExtra<T, T2, T3>
{
}

[AttributeUsage(AttributeTargets.All)]
public class SimpleAttribute : Attribute
{
}
Expand Down Expand Up @@ -60,39 +61,45 @@ public class Attribute_ZZ : Attribute
{
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithPositionalParameters1Attribute : Attribute
{
public AttributeWithPositionalParameters1Attribute(string value)
{
}
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithPositionalParameters2Attribute : Attribute
{
public AttributeWithPositionalParameters2Attribute(int value)
{
}
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithMultiplePositionalParametersAttribute : Attribute
{
public AttributeWithMultiplePositionalParametersAttribute(int value, string value2)
{
}
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithNamedParameterAttribute : Attribute
{
public string StringValue { get; set; }
public int IntValue { get; set; }
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithNamedFieldAttribute : Attribute
{
public string StringValue;
public int IntValue;
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithNamedAndPositionalParameterAttribute : Attribute
{
public AttributeWithNamedAndPositionalParameterAttribute(int value1, string value2)
Expand All @@ -103,6 +110,7 @@ public AttributeWithNamedAndPositionalParameterAttribute(int value1, string valu
public string StringValue { get; set; }
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithNamedParameterAndFieldAttribute : Attribute
{
public int IntField;
Expand All @@ -112,27 +120,31 @@ public class AttributeWithNamedParameterAndFieldAttribute : Attribute
public string StringProperty { get; set; }
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithSimpleEnumAttribute : Attribute
{
public AttributeWithSimpleEnumAttribute(SimpleEnum value)
{
}
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithEnumFlagsAttribute : Attribute
{
public AttributeWithEnumFlagsAttribute(EnumWithFlags value)
{
}
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithEnumWithSomeSpecialFlagsAttribute : Attribute
{
public AttributeWithEnumWithSomeSpecialFlagsAttribute(EnumWithSomeSpecialFlags value)
{
}
}

[AttributeUsage(AttributeTargets.All)]
public class AttributeWithTypeParameterAttribute : Attribute
{
public AttributeWithTypeParameterAttribute(Type type)
Expand Down
6 changes: 3 additions & 3 deletions src/PublicApiGeneratorTests/Method_async.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using PublicApiGeneratorTests.Examples;
using PublicApiGeneratorTests.Examples;

namespace PublicApiGeneratorTests
{
Expand Down Expand Up @@ -107,7 +107,7 @@ public class MethodAsyncReturnValue
{
public async Task<string> AsyncMethod()
{
return await Task.FromResult("Hello world");
return await Task.FromResult("Hello world").ConfigureAwait(false);
}
}

Expand All @@ -123,4 +123,4 @@ public Task<string> AsyncMethod()
// ReSharper restore ClassNeverInstantiated.Global
// ReSharper restore CSharpWarnings::CS1998
// ReSharper restore UnusedMember.Global
}
}
1 change: 1 addition & 0 deletions src/PublicApiGeneratorTests/PublicApiGeneratorTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!--TODO: fix nullability warnings-->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS8601;CS8625;CS8714</WarningsNotAsErrors>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 113bfd3

Please sign in to comment.