Skip to content

Commit

Permalink
housekeeping: update to source package (#64)
Browse files Browse the repository at this point in the history
* housekeeping: Revert to code analysis 3.8

* Further downgrade work

* feature: Make package a source package
  • Loading branch information
glennawatson authored Aug 14, 2022
1 parent ea70b12 commit e79b6c6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 15 deletions.
5 changes: 4 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
<DebugType>portable</DebugType>
<Authors>Glenn Watson</Authors>
<Copyright>Copyright (c) 2021 ReactiveUI Association Incorporated</Copyright>
<Company>ReactiveUI Association Inc</Company>
<Copyright>Copyright © 2020 - $([System.DateTime]::Now.ToString(yyyy)) $(Company)</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>docs\README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/reactivemarbles/RoslynHelpers</PackageProjectUrl>
<PackageDescription>Helpers with the Roslyn system, useful for unit tests.</PackageDescription>
<Owners>glennawatson</Owners>
Expand Down Expand Up @@ -34,6 +36,7 @@
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
<None Include="$(MSBuildThisFileDirectory)..\images\logo.png" Pack="true" PackagePath="" />
<None Include="$(MSBuildThisFileDirectory)..\README.md" Pack="true" PackagePath="\docs"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<LangVersion>9</LangVersion>
<Nullable>enable</Nullable>
<Authors>ReactiveUI Association Inc</Authors>
<Description>A library to make roslyn operations easier.</Description>
<DebugType>full</DebugType>
<DevelopmentDependency>true</DevelopmentDependency>
<IncludeBuildOutput>false</IncludeBuildOutput>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.8.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<Content Include="**\*.cs" PackagePath="any/any" Exclude="**\obj\**\*.cs" />
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion src/ReactiveMarbles.RoslynHelpers/RoslynCommonHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

#pragma warning disable

using System;
using System.Linq;

Expand Down Expand Up @@ -64,7 +66,7 @@ public static AttributeListSyntax[] GenerateObsoleteAttributeList(ISymbol eventD
var message = obsoleteAttribute.ConstructorArguments.FirstOrDefault().Value?.ToString();
var isError = bool.Parse(obsoleteAttribute.ConstructorArguments.ElementAtOrDefault(1).Value?.ToString() ?? bool.FalseString) ? SyntaxKind.TrueLiteralExpression : SyntaxKind.FalseLiteralExpression;

if (message is not null && !string.IsNullOrWhiteSpace(message))
if (message != null && !string.IsNullOrWhiteSpace(message))
{
var attribute = Attribute(
"global::System.ObsoleteAttribute",
Expand Down
18 changes: 9 additions & 9 deletions src/ReactiveMarbles.RoslynHelpers/RoslynGeneratorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

#pragma warning disable

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
Expand Down Expand Up @@ -115,12 +117,10 @@ public static IEnumerable<T> GetMembers<T>(this INamedTypeSymbol symbol)
{
var member = members[i];

if (member is not T targetSymbol)
if (member is T targetSymbol)
{
continue;
yield return targetSymbol;
}

yield return targetSymbol;
}
}

Expand Down Expand Up @@ -148,7 +148,7 @@ public static IEnumerable<IEventSymbol> GetEvents(this INamedTypeSymbol item, bo
{
var member = members[memberIndex];

if (member is not IEventSymbol eventSymbol)
if (!(member is IEventSymbol eventSymbol))
{
continue;
}
Expand Down Expand Up @@ -238,7 +238,7 @@ public static IEnumerable<T> GetBaseTypesAndThis<T>(this T type)
where T : ITypeSymbol
{
var current = type;
while (current is not null)
while (current != null)
{
yield return current;
current = (T?)current.BaseType;
Expand All @@ -261,7 +261,7 @@ public static IEnumerable<T> GetBaseTypesAndThis<T>(this T type, Func<T?, bool>
}

var current = type;
while (current is not null)
while (current != null)
{
if (condition.Invoke(current))
{
Expand Down Expand Up @@ -311,7 +311,7 @@ public static IEnumerable<T> GetBasesWithCondition<T>(this T symbol, Func<T, boo

var current = (T?)symbol.BaseType;

while (current is not null)
while (current != null)
{
if (condition.Invoke(current))
{
Expand All @@ -338,7 +338,7 @@ public static string GetArityDisplayName(this ITypeSymbol namedTypeSymbol)

var current = namedTypeSymbol;

while (current is not null)
while (current != null)
{
items.Push(current);
current = current.ContainingType;
Expand Down
2 changes: 2 additions & 0 deletions src/ReactiveMarbles.RoslynHelpers/SyntaxExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

#pragma warning disable

using System.Linq;
using System.Runtime.CompilerServices;

Expand Down
4 changes: 3 additions & 1 deletion src/ReactiveMarbles.RoslynHelpers/SyntaxFactoryHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

#pragma warning disable

using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -298,7 +300,7 @@ public static AttributeListSyntax AttributeList(AttributeSyntax attribute, Synta
var attributeList = SingletonSeparatedList(attribute);

AttributeTargetSpecifierSyntax? attributeTarget = null;
if (target is not null)
if (target != null)
{
attributeTarget = AttributeTargetSpecifier(target.Value);
}
Expand Down
2 changes: 2 additions & 0 deletions src/ReactiveMarbles.RoslynHelpers/TypesMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

#pragma warning disable

using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down

0 comments on commit e79b6c6

Please sign in to comment.