Skip to content

Commit

Permalink
Merge pull request #4 from CluedIn-io/feature/Apply-Enricher-Provider
Browse files Browse the repository at this point in the history
Apply Enricher Provider (AB#6516)
  • Loading branch information
BenFidge committed Jan 15, 2022
2 parents 8f782d5 + 975ca22 commit 4c1efee
Show file tree
Hide file tree
Showing 25 changed files with 420 additions and 106 deletions.
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
<PropertyGroup Label="Package Metadata">
<Title>$(RootNamespace)</Title>
<Authors>$(Company)</Authors>
<!-- TODO: Licensing -->
<!-- <PackageLicenseFile> if not using an open source license should be set to the path of a license _in_ the package -->
<!-- <PackageRequireLicenseAcceptance> should be set to true if a license is included -->
<PackageProjectUrl>http://cluedin.com</PackageProjectUrl>
<PackageIcon>nugetlogo.png</PackageIcon>
</PropertyGroup>

<ItemGroup Label="Package Includes">
<None Include="$(MSBuildThisFileDirectory)build\assets\nugetlogo.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
34 changes: 17 additions & 17 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project>
<!-- Ensure the targets for Central package management are imported -->
<Import Project="Sdk.targets" Sdk="Microsoft.Build.CentralPackageVersions"/>
<!-- Ensure the targets for Central package management are imported -->
<Import Project="Sdk.targets" Sdk="Microsoft.Build.CentralPackageVersions"/>

<Target Name="ValidateAssemblyMeta" BeforeTargets="Build">
<Warning Code="CIQ0001" Text="`Product` [$(Product)] must be 'CluedIn'." Condition="'$(Product)' != 'CluedIn'"/>
<Warning Code="CIQ0002" Text="`AssemblyTitle` [$(AssemblyTitle)] must match project name [$(MSBuildProjectName)]." Condition="'$(AssemblyTitle)' != '$(MSBuildProjectName)'"/>
<Warning Code="CIQ0003" Text="`AssemblyName` [$(AssemblyName)] must match `Product.AssemblyTitle` [$(Product).$(AssemblyTitle)]." Condition="'$(AssemblyName)' != '$(Product).$(AssemblyTitle)'"/>
<Warning Code="CIQ0004" Text="`RootNamespace` [$(RootNamespace)] must match `AssemblyName` [$(AssemblyName)]." Condition="'$(RootNamespace)' != '$(AssemblyName)'"/>
</Target>

<Target Name="ValidateAssemblyMeta" BeforeTargets="Build">
<Warning Code="CIQ0001" Text="`Product` [$(Product)] must be 'CluedIn'." Condition="'$(Product)' != 'CluedIn'"/>
<Warning Code="CIQ0002" Text="`AssemblyTitle` [$(AssemblyTitle)] must match project name [$(MSBuildProjectName)]." Condition="'$(AssemblyTitle)' != '$(MSBuildProjectName)'"/>
<Warning Code="CIQ0003" Text="`AssemblyName` [$(AssemblyName)] must match `Product.AssemblyTitle` [$(Product).$(AssemblyTitle)]." Condition="'$(AssemblyName)' != '$(Product).$(AssemblyTitle)'"/>
<Warning Code="CIQ0004" Text="`RootNamespace` [$(RootNamespace)] must match `AssemblyName` [$(AssemblyName)]." Condition="'$(RootNamespace)' != '$(AssemblyName)'"/>
</Target>

<Target Name="ValidatePackMeta" BeforeTargets="Pack" Condition="'$(IsPackable)' == 'true'">
<Warning Code="CIQ1001" Text="`PackageId` [$(PackageId)] must match `AssemblyName` [$(AssemblyName)] for packable projects." Condition="'$(PackageId)' != '$(AssemblyName)'"/>
<Warning Code="CIQ1002" Text="`PackageVersion` [$(PackageVersion)] must match `Version` [$(Version)] for packable projects." Condition="'$(PackageVersion)' != '$(Version)'"/>
<Warning Code="CIQ1003" Text="`Authors` [$(Authors)] must match `Company` [$(Company)] for packable projects." Condition="'$(Authors)' != '$(Company)'"/>
<Warning Code="CIQ1004" Text="`Title` [$(Title)] must match `RootNamespace` [$(RootNamespace)] for packable projects." Condition="'$(Title)' != '$(RootNamespace)'"/>
<Warning Code="CIQ1005" Text="`Description` must be provided for packable projects." Condition="'$(Description)' == ''"/>
<Warning Code="CIQ1006" Text="`Copyright` must be provided for packable projects." Condition="'$(Copyright)' == ''"/>
</Target>
<Target Name="ValidatePackMeta" BeforeTargets="Pack" Condition="'$(IsPackable)' == 'true'">
<Warning Code="CIQ1001" Text="`PackageId` [$(PackageId)] must match `AssemblyName` [$(AssemblyName)] for packable projects." Condition="'$(PackageId)' != '$(AssemblyName)'"/>
<Warning Code="CIQ1002" Text="`PackageVersion` [$(PackageVersion)] must match `Version` [$(Version)] for packable projects." Condition="'$(PackageVersion)' != '$(Version)'"/>
<Warning Code="CIQ1003" Text="`Authors` [$(Authors)] must match `Company` [$(Company)] for packable projects." Condition="'$(Authors)' != '$(Company)'"/>
<Warning Code="CIQ1004" Text="`Title` [$(Title)] must match `RootNamespace` [$(RootNamespace)] for packable projects." Condition="'$(Title)' != '$(RootNamespace)'"/>
<Warning Code="CIQ1005" Text="`Description` must be provided for packable projects." Condition="'$(Description)' == ''"/>
<Warning Code="CIQ1006" Text="`Copyright` must be provided for packable projects." Condition="'$(Copyright)' == ''"/>
</Target>

</Project>
38 changes: 15 additions & 23 deletions ExternalSearch.Providers.GoogleMaps.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B2A52533-7FBF-41FE-A0AF-874FC54300B2}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7E2E897B-E664-4ECC-8AD8-814AAEAD8639}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{A32B6852-82C7-4107-8C68-AE9232289E09}"
ProjectSection(SolutionItems) = preProject
test\unit\Directory.Build.props = test\unit\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "integration", "integration", "{DBD1964B-DBD9-4C70-96CA-391C34B3D75F}"
EndProject
Expand All @@ -35,6 +22,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{02641789-0D38-4DBB-9288-23592CF55D25}"
ProjectSection(SolutionItems) = preProject
NuGet.config = NuGet.config
packages.props = packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Code Style", "Code Style", "{2C3AECCF-DCB5-4ED7-8B7B-8F373EDE3A5E}"
Expand All @@ -48,38 +36,42 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Git", "Git", "{17EE3C8D-BAE
.gitignore = .gitignore
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExternalSearch.Providers.GoogleMaps", "src\ExternalSearch.Providers.GoogleMaps.csproj", "{E5832F12-6BB8-4ACA-AB23-F82888FF3971}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExternalSearch.GoogleMaps.Integration.Tests", "test\integration\Integration.Tests\ExternalSearch.GoogleMaps.Integration.Tests.csproj", "{8CBDF6EB-A861-466E-932B-04CA5917923C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExternalSearch.Providers.GoogleMaps", "src\ExternalSearch.Providers.GoogleMaps\ExternalSearch.Providers.GoogleMaps.csproj", "{998CD3A8-DF37-4B8F-A519-D805D98E92B3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Provider.ExternalSearch.GoogleMaps", "src\ExternalSearch.Providers.GoogleMaps.Provider\Provider.ExternalSearch.GoogleMaps.csproj", "{76FE5F98-D73D-4175-8936-42BDD012F0BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E5832F12-6BB8-4ACA-AB23-F82888FF3971}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5832F12-6BB8-4ACA-AB23-F82888FF3971}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5832F12-6BB8-4ACA-AB23-F82888FF3971}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5832F12-6BB8-4ACA-AB23-F82888FF3971}.Release|Any CPU.Build.0 = Release|Any CPU
{8CBDF6EB-A861-466E-932B-04CA5917923C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CBDF6EB-A861-466E-932B-04CA5917923C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CBDF6EB-A861-466E-932B-04CA5917923C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CBDF6EB-A861-466E-932B-04CA5917923C}.Release|Any CPU.Build.0 = Release|Any CPU
{998CD3A8-DF37-4B8F-A519-D805D98E92B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{998CD3A8-DF37-4B8F-A519-D805D98E92B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{998CD3A8-DF37-4B8F-A519-D805D98E92B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{998CD3A8-DF37-4B8F-A519-D805D98E92B3}.Release|Any CPU.Build.0 = Release|Any CPU
{76FE5F98-D73D-4175-8936-42BDD012F0BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76FE5F98-D73D-4175-8936-42BDD012F0BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76FE5F98-D73D-4175-8936-42BDD012F0BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76FE5F98-D73D-4175-8936-42BDD012F0BE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A32B6852-82C7-4107-8C68-AE9232289E09} = {7E2E897B-E664-4ECC-8AD8-814AAEAD8639}
{DBD1964B-DBD9-4C70-96CA-391C34B3D75F} = {7E2E897B-E664-4ECC-8AD8-814AAEAD8639}
{5A324190-DAD7-4EEF-92AA-BC3E5712C80B} = {7E2E897B-E664-4ECC-8AD8-814AAEAD8639}
{E1A76004-11EB-44E0-B1D2-B197689E9265} = {9BD54E81-D9C8-4419-82B8-8EE6CC7E2647}
{02641789-0D38-4DBB-9288-23592CF55D25} = {9BD54E81-D9C8-4419-82B8-8EE6CC7E2647}
{2C3AECCF-DCB5-4ED7-8B7B-8F373EDE3A5E} = {9BD54E81-D9C8-4419-82B8-8EE6CC7E2647}
{17EE3C8D-BAE4-481A-B9CC-1BE878E86124} = {9BD54E81-D9C8-4419-82B8-8EE6CC7E2647}
{E5832F12-6BB8-4ACA-AB23-F82888FF3971} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
{8CBDF6EB-A861-466E-932B-04CA5917923C} = {DBD1964B-DBD9-4C70-96CA-391C34B3D75F}
{998CD3A8-DF37-4B8F-A519-D805D98E92B3} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
{76FE5F98-D73D-4175-8936-42BDD012F0BE} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6A61CB42-80C5-4A83-AC3E-DA41FC875525}
Expand Down
Binary file added build/assets/nugetlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/3.3.0-release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Features
- Implemented Provider Model
61 changes: 30 additions & 31 deletions packages.props
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@

<Project>
<PropertyGroup Label="Dependency Versions">
<_ComponentHost>2.0.0-alpha-14</_ComponentHost>
<_AutoFixture>4.11.0</_AutoFixture>
<_CluedIn>3.3.0-*</_CluedIn>
</PropertyGroup>
<PropertyGroup Label="Dependency Versions">
<_ComponentHost>2.0.0</_ComponentHost>
<_AutoFixture>4.11.0</_AutoFixture>
<_CluedIn>3.3.0-alpha*</_CluedIn>
</PropertyGroup>

<ItemGroup>
<!--
<ItemGroup>
<!--
Specified versions for dependencies in test projects
MUST SPECIFY IN CSPROJ AS <PackageReference Name="<depName>" />
-->
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Update="AutoFixture.Xunit2" Version="$(_AutoFixture)" />
<PackageReference Update="AutoFixture.Idioms" Version="$(_AutoFixture)" />
<PackageReference Update="AutoFixture.AutoMoq" Version="$(_AutoFixture)" />
<PackageReference Update="coverlet.msbuild" Version="2.8.0" />
<PackageReference Update="Serilog.Sinks.XUnit" Version="1.0.21" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Update="Moq" Version="4.13.1" />
<PackageReference Update="Shouldly" Version="3.0.2" />
<PackageReference Update="CluedIn.Testing.Base" Version="$(_CluedIn)" />
</ItemGroup>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Update="AutoFixture.Xunit2" Version="$(_AutoFixture)" />
<PackageReference Update="AutoFixture.Idioms" Version="$(_AutoFixture)" />
<PackageReference Update="AutoFixture.AutoMoq" Version="$(_AutoFixture)" />
<PackageReference Update="coverlet.msbuild" Version="2.8.0" />
<PackageReference Update="Serilog.Sinks.XUnit" Version="1.0.21" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Update="Moq" Version="4.13.1" />
<PackageReference Update="Shouldly" Version="3.0.2" />
<PackageReference Update="CluedIn.Testing.Base" Version="$(_CluedIn)" />
</ItemGroup>

<ItemGroup>
<!--
<ItemGroup>
<!--
Specified versions for dependencies across the solution
MUST SPECIFY IN CSPROJ AS <PackageReference Name="<depName>" />
-->
<PackageReference Update="ComponentHost" Version="$(_ComponentHost)" />
<PackageReference Update="CluedIn.Crawling" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.CrawlerIntegrationTesting" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.Core" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.Core.Agent" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.Server" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.Server.Common.WebApi" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.ExternalSearch" Version="$(_CluedIn)" />
<PackageReference Update="ComponentHost" Version="$(_ComponentHost)" />
<PackageReference Update="CluedIn.Crawling" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.CrawlerIntegrationTesting" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.Core" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.Core.Agent" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.Server" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.Server.Common.WebApi" Version="$(_CluedIn)" />
<PackageReference Update="CluedIn.ExternalSearch" Version="$(_CluedIn)" />

</ItemGroup>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System.Reflection;
using Castle.MicroKernel.Registration;
using CluedIn.Core;
using CluedIn.Core.Providers;
using CluedIn.Core.Server;
using CluedIn.ExternalSearch.Providers.GoogleMaps;
using ComponentHost;
using Constants = CluedIn.ExternalSearch.Providers.GoogleMaps.Constants;

namespace CluedIn.Provider.GoogleMaps
{
[Component(Constants.ComponentName, "Providers", ComponentType.Service, ServerComponents.ProviderWebApi, Components.Server, Components.DataStores, Isolation = ComponentIsolation.NotIsolated)]
public sealed class GoogleMapsProviderProviderComponent : ServiceApplicationComponent<IServer>
{
/**********************************************************************************************************
* CONSTRUCTOR
**********************************************************************************************************/

/// <summary>
/// Initializes a new instance of the <see cref="GoogleMapsProviderProviderComponent" /> class.
/// </summary>
/// <param name="componentInfo">The component information.</param>
public GoogleMapsProviderProviderComponent(ComponentInfo componentInfo) : base(componentInfo)
{
// Dev. Note: Potential for compiler warning here ... CA2214: Do not call overridable methods in constructors
// this class has been sealed to prevent the CA2214 waring being raised by the compiler
Container.Register(Component.For<GoogleMapsProviderProviderComponent>().Instance(this));
}

/**********************************************************************************************************
* METHODS
**********************************************************************************************************/

/// <summary>Starts this instance.</summary>
public override void Start()
{
var asm = Assembly.GetAssembly(typeof(GoogleMapsProviderProviderComponent));
Container.Register(Types.FromAssembly(asm).BasedOn<IProvider>().WithServiceFromInterface().If(t => !t.IsAbstract).LifestyleSingleton());

State = ServiceState.Started;
}

/// <summary>Stops this instance.</summary>
public override void Stop()
{
if (State == ServiceState.Stopped)
return;

State = ServiceState.Stopped;
}
}
}
Loading

0 comments on commit 4c1efee

Please sign in to comment.