-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from TNG/325-ensure-no-calls-between-modules-…
…in-a-modulith
- Loading branch information
Showing
13 changed files
with
193 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright 2019 Florian Gather <[email protected]> | ||
// Copyright 2019 Fritz Brandhuber <[email protected]> | ||
// Copyright 2020 Pavel Fischer <[email protected]> | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using ArchUnitNET.Domain.Dependencies; | ||
|
||
namespace ArchUnitNET.Domain | ||
{ | ||
public class UnavailableType : IType | ||
{ | ||
public UnavailableType(IType type) | ||
{ | ||
Type = type; | ||
} | ||
|
||
private IType Type { get; } | ||
public string Name => Type.Name; | ||
public string FullName => Type.FullName; | ||
|
||
public Visibility Visibility => Type.Visibility; | ||
public bool IsNested => Type.IsNested; | ||
public bool IsGeneric => Type.IsGeneric; | ||
public bool IsGenericParameter => Type.IsGenericParameter; | ||
public bool IsStub => true; | ||
public bool IsCompilerGenerated => Type.IsCompilerGenerated; | ||
|
||
public Namespace Namespace => Type.Namespace; | ||
public Assembly Assembly => Type.Assembly; | ||
|
||
public IEnumerable<Attribute> Attributes => | ||
AttributeInstances.Select(instance => instance.Type); | ||
public List<AttributeInstance> AttributeInstances => Type.AttributeInstances; | ||
|
||
public List<ITypeDependency> Dependencies => Type.Dependencies; | ||
public List<ITypeDependency> BackwardsDependencies => Type.BackwardsDependencies; | ||
public IEnumerable<IType> ImplementedInterfaces => Type.ImplementedInterfaces; | ||
|
||
public MemberList Members => Type.Members; | ||
public List<GenericParameter> GenericParameters => Type.GenericParameters; | ||
|
||
public override string ToString() | ||
{ | ||
return FullName; | ||
} | ||
|
||
private bool Equals(Struct other) | ||
{ | ||
return Equals(Type, other.Type); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (ReferenceEquals(null, obj)) | ||
{ | ||
return false; | ||
} | ||
|
||
if (ReferenceEquals(this, obj)) | ||
{ | ||
return true; | ||
} | ||
|
||
return obj.GetType() == GetType() && Equals((Struct)obj); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return Type != null ? Type.GetHashCode() : 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
TestAssemblies/FilteredDirectoryLoaderTestAssembly/Class1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Serilog; | ||
|
||
namespace FilteredDirectoryLoaderTestAssembly; | ||
|
||
public class Class1 | ||
{ | ||
public ILogger logger; | ||
|
||
public Class1() | ||
{ | ||
this.logger = new LoggerConfiguration().CreateLogger(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...Assemblies/FilteredDirectoryLoaderTestAssembly/FilteredDirectoryLoaderTestAssembly.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Serilog" Version="4.2.0" /> | ||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
25 changes: 25 additions & 0 deletions
25
TestAssemblies/FilteredDirectoryLoaderTestAssembly/FilteredDirectoryLoaderTestAssembly.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilteredDirectoryLoaderTestAssembly", "FilteredDirectoryLoaderTestAssembly.csproj", "{8597C220-0EC2-42AF-9675-C56607614773}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{8597C220-0EC2-42AF-9675-C56607614773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{8597C220-0EC2-42AF-9675-C56607614773}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{8597C220-0EC2-42AF-9675-C56607614773}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{8597C220-0EC2-42AF-9675-C56607614773}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {B166203B-6B5B-4BE6-B945-CA9FD03A6054} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters