From 3009dfb3ce8269bfd55dbb7efd6f796ae21a9b1a Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 15 Jun 2024 16:02:15 -0400 Subject: [PATCH 1/4] #66 - Added .NET 8 target; Updated JSON.NET --- src/Leprechaun.Cli/Leprechaun.Cli.csproj | 2 +- .../Leprechaun.CodeGen.Roslyn.csproj | 2 +- .../Leprechaun.InputProviders.Sitecore.csproj | 4 ++-- src/Leprechaun.Tests/Leprechaun.Tests.csproj | 2 +- src/Leprechaun/Leprechaun.csproj | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Leprechaun.Cli/Leprechaun.Cli.csproj b/src/Leprechaun.Cli/Leprechaun.Cli.csproj index 5bd3334..c4b942a 100644 --- a/src/Leprechaun.Cli/Leprechaun.Cli.csproj +++ b/src/Leprechaun.Cli/Leprechaun.Cli.csproj @@ -7,7 +7,7 @@ Exe - net6.0 + net6.0;net8.0 true leprechaun ./nupkg diff --git a/src/Leprechaun.CodeGen.Roslyn/Leprechaun.CodeGen.Roslyn.csproj b/src/Leprechaun.CodeGen.Roslyn/Leprechaun.CodeGen.Roslyn.csproj index d13e6c5..7648a15 100644 --- a/src/Leprechaun.CodeGen.Roslyn/Leprechaun.CodeGen.Roslyn.csproj +++ b/src/Leprechaun.CodeGen.Roslyn/Leprechaun.CodeGen.Roslyn.csproj @@ -9,7 +9,7 @@ Leprechaun.CodeGen.Roslyn Leprechaun.CodeGen.Roslyn - net472;net6.0;netstandard2.1 + net472;net6.0;net8.0;netstandard2.1 false diff --git a/src/Leprechaun.InputProviders.Sitecore/Leprechaun.InputProviders.Sitecore.csproj b/src/Leprechaun.InputProviders.Sitecore/Leprechaun.InputProviders.Sitecore.csproj index 428fb2c..78262f3 100644 --- a/src/Leprechaun.InputProviders.Sitecore/Leprechaun.InputProviders.Sitecore.csproj +++ b/src/Leprechaun.InputProviders.Sitecore/Leprechaun.InputProviders.Sitecore.csproj @@ -9,7 +9,7 @@ Leprechaun.InputProviders.Sitecore Leprechaun.InputProviders.Sitecore - net472;net6.0 + net472;net6.0;net8.0 false true @@ -47,7 +47,7 @@ - + diff --git a/src/Leprechaun.Tests/Leprechaun.Tests.csproj b/src/Leprechaun.Tests/Leprechaun.Tests.csproj index 4e3d86d..64dd635 100644 --- a/src/Leprechaun.Tests/Leprechaun.Tests.csproj +++ b/src/Leprechaun.Tests/Leprechaun.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net6.0;net8.0 false Leprechaun.Tests Leprechaun.Tests diff --git a/src/Leprechaun/Leprechaun.csproj b/src/Leprechaun/Leprechaun.csproj index dae644f..6f68c1b 100644 --- a/src/Leprechaun/Leprechaun.csproj +++ b/src/Leprechaun/Leprechaun.csproj @@ -4,7 +4,7 @@ Leprechaun Leprechaun - net472;net6.0;netstandard2.1 + net472;net6.0;net8.0;netstandard2.1 false @@ -36,6 +36,6 @@ - + \ No newline at end of file From 476e781a61bcb1c5a5f898eccd9bcdfbb680d404 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 15 Jun 2024 16:02:38 -0400 Subject: [PATCH 2/4] Added some better error handling --- .../TemplateReaders/SitecoreTemplateReader.cs | 4 ++++ src/Leprechaun/Filters/BaseTemplatePredicate.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/Leprechaun.InputProviders.Sitecore/TemplateReaders/SitecoreTemplateReader.cs b/src/Leprechaun.InputProviders.Sitecore/TemplateReaders/SitecoreTemplateReader.cs index ed37e75..8e96e8d 100644 --- a/src/Leprechaun.InputProviders.Sitecore/TemplateReaders/SitecoreTemplateReader.cs +++ b/src/Leprechaun.InputProviders.Sitecore/TemplateReaders/SitecoreTemplateReader.cs @@ -41,6 +41,10 @@ public override TemplateInfo[] GetTemplates(ITemplatePredicate predicate) public async Task> GetTemplates(SitecoreTemplatePredicate predicate) { var module = predicate.GetModule(); + if(module == null) + { + throw new InvalidConfigurationException($"No Sitecore module was found for the predicate '{predicate.GetConfigName()}'"); + } await module.DataStore.Reinitialize(null); // ensure the datastore is up to date var tasks = new List>>(); foreach (var fstree in predicate.GetTreeSpecs()) diff --git a/src/Leprechaun/Filters/BaseTemplatePredicate.cs b/src/Leprechaun/Filters/BaseTemplatePredicate.cs index 4f99d7f..903d3b8 100644 --- a/src/Leprechaun/Filters/BaseTemplatePredicate.cs +++ b/src/Leprechaun/Filters/BaseTemplatePredicate.cs @@ -78,6 +78,8 @@ protected IList ParsePreset(XmlNode configuration) return presets; } + public string GetConfigName() => _configuration.Name; + public virtual bool Includes(TemplateInfo template) { Assert.ArgumentNotNull(template, nameof(template)); From 731dec792ea560b6bc5d64ca8710adb6ef9f1202 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 15 Jun 2024 16:08:30 -0400 Subject: [PATCH 3/4] Update copyright year --- license.txt | 2 +- src/SharedProperties.targets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/license.txt b/license.txt index 479a9be..b1ee167 100644 --- a/license.txt +++ b/license.txt @@ -1,6 +1,6 @@ THE MIT LICENSE -Copyright (c) 2023 Ben Lipson +Copyright (c) 2024 Ben Lipson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/SharedProperties.targets b/src/SharedProperties.targets index 0a1900c..cf51b03 100644 --- a/src/SharedProperties.targets +++ b/src/SharedProperties.targets @@ -7,6 +7,6 @@ http://opensource.org/licenses/MIT https://github.com/blipson89/Leprechaun http://www.benlipson.net/wp-content/uploads/2018/04/leprechaun-logo_pipe-small.png - ©2023 Ben Lipson + ©2024 Ben Lipson \ No newline at end of file From c97d633c797c7a41f66cafcea73a4920066c932b Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 15 Jun 2024 16:20:46 -0400 Subject: [PATCH 4/4] #66 - fixed build issue --- src/Leprechaun.Cli/Leprechaun.Cli.csproj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Leprechaun.Cli/Leprechaun.Cli.csproj b/src/Leprechaun.Cli/Leprechaun.Cli.csproj index c4b942a..db99115 100644 --- a/src/Leprechaun.Cli/Leprechaun.Cli.csproj +++ b/src/Leprechaun.Cli/Leprechaun.Cli.csproj @@ -40,5 +40,20 @@ tools\net6.0\any\Legacy false + + true + tools\net8.0\any\Plugins + false + + + true + tools\net8.0\any\Legacy + false + + + true + tools\net8.0\any\Legacy + false +