Skip to content

Commit

Permalink
Fix issues in Durian
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrstenke committed Jan 31, 2022
1 parent 62355e4 commit a8906a2
Show file tree
Hide file tree
Showing 32 changed files with 160 additions and 531 deletions.
23 changes: 8 additions & 15 deletions durian.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,24 @@
"packages": [
{
"name": "Main",
"version": "2.0.0",
"version": "2.0.1",
"type": [
"Unspecified"
]
},
{
"name": "CoreAnalyzer",
"version": "2.0.0",
"version": "2.0.1",
"type": [
"Analyzer"
]
},
{
"name": "Core",
"version": "2.0.0",
"version": "2.0.1",
"type": [
"Library"
]
},
{
"name": "Manager",
"version": "2.0.0",
"type": [
"Analyzer"
]
}
],
"diagnosticIdPrefix": "00",
Expand All @@ -47,14 +40,14 @@
"packages": [
{
"name": "AnalysisServices",
"version": "2.0.0",
"version": "2.0.1",
"type": [
"Library"
]
},
{
"name": "TestServices",
"version": "2.0.0",
"version": "2.0.1",
"type": [
"Library"
]
Expand All @@ -66,7 +59,7 @@
"packages": [
{
"name": "DefaultParam",
"version": "2.0.0",
"version": "2.0.1",
"type": [
"Analyzer",
"CodeFixLibrary",
Expand All @@ -93,7 +86,7 @@
"packages": [
{
"name": "FriendClass",
"version": "1.0.0",
"version": "1.0.1",
"type": [
"Analyzer",
"CodeFixLibrary",
Expand All @@ -116,7 +109,7 @@
"packages": [
{
"name": "InterfaceTargets",
"version": "1.0.0",
"version": "1.0.1",
"type": [
"Analyzer",
"StaticGenerator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Durian.AnalysisServices" Version="2.0.0" />
<PackageReference Include="Durian.DefaultParam" Version="2.0.0">
<PackageReference Include="Durian.Core" Version="2.0.1" />
<PackageReference Include="Durian.DefaultParam" Version="2.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Durian.FriendClass" Version="1.0.0">
<PackageReference Include="Durian.Core" Version="2.0.1" />
<PackageReference Include="Durian.FriendClass" Version="1.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Durian.InterfaceTargets" Version="1.0.0">
<PackageReference Include="Durian.Core" Version="2.0.1" />
<PackageReference Include="Durian.InterfaceTargets" Version="1.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

This file was deleted.

6 changes: 3 additions & 3 deletions src/Durian.AnalysisServices/Durian.AnalysisServices.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Durian.AnalysisServices is the base package for all Durian analyzers and source generators, offering solutions for most features a Roslyn-based service could require, such as logging, code generation, node filtration, member data containers, and much more.</Description>
<PackageTags>Durian;Analyzer;Source;Generator;Generation;Roslyn;Code;Fix;Extension;Feature;CSharp;C#;Analysis;Syntax;Tree;Node;Service;Utility</PackageTags>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
<Version>2.0.0</Version>
<PackageVersion>2.0.1</PackageVersion>
<AssemblyVersion>2.0.1</AssemblyVersion>
<Version>2.0.1</Version>
<RootNamespace>Durian.Analysis</RootNamespace>

</PropertyGroup>
Expand Down
12 changes: 3 additions & 9 deletions src/Durian.AnalysisServices/DurianGeneratorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,21 +245,15 @@ protected bool InitializeCompilation(in GeneratorExecutionContext context, [NotN
{
if (context.Compilation is not CSharpCompilation c)
{
if (EnableDiagnostics)
{
context.ReportDiagnostic(Diagnostic.Create(DUR0004_NotCSharpCompilation, Location.None));
}
context.ReportDiagnostic(Diagnostic.Create(DUR0004_NotCSharpCompilation, Location.None));

compilation = null;
return false;
}

if (!HasValidReferences(c))
{
if (EnableDiagnostics)
{
context.ReportDiagnostic(Diagnostic.Create(DUR0001_DoesNotReferenceDurianCore, Location.None));
}
context.ReportDiagnostic(Diagnostic.Create(DUR0001_DoesNotReferenceDurianCore, Location.None));

compilation = null;
return false;
Expand Down Expand Up @@ -422,7 +416,7 @@ private static bool HasValidReferences(CSharpCompilation compilation)
{
foreach (AssemblyIdentity assembly in compilation.ReferencedAssemblyNames)
{
if (assembly.Name == "Durian.Core")
if (assembly.Name == "Durian.Core" || assembly.Name == "Durian" || assembly.Name == "Durian.Manager")
{
return true;
}
Expand Down
Loading

0 comments on commit a8906a2

Please sign in to comment.