diff --git a/spkl/CrmSvcUtilFilteringService/CrmSvcUtil.FilteringService.csproj b/spkl/CrmSvcUtilFilteringService/CrmSvcUtil.FilteringService.csproj index 4c4e5be2..441fe934 100644 --- a/spkl/CrmSvcUtilFilteringService/CrmSvcUtil.FilteringService.csproj +++ b/spkl/CrmSvcUtilFilteringService/CrmSvcUtil.FilteringService.csproj @@ -55,8 +55,8 @@ ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.21\lib\net462\Microsoft.Crm.Sdk.Proxy.dll - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.25\lib\net462\Microsoft.Rest.ClientRuntime.dll diff --git a/spkl/CrmSvcUtilFilteringService/app.config b/spkl/CrmSvcUtilFilteringService/app.config index dc96ecaa..75bdc66b 100644 --- a/spkl/CrmSvcUtilFilteringService/app.config +++ b/spkl/CrmSvcUtilFilteringService/app.config @@ -24,7 +24,7 @@ - + diff --git a/spkl/CrmSvcUtilFilteringService/packages.config b/spkl/CrmSvcUtilFilteringService/packages.config index c0adb684..8e942a19 100644 --- a/spkl/CrmSvcUtilFilteringService/packages.config +++ b/spkl/CrmSvcUtilFilteringService/packages.config @@ -5,7 +5,7 @@ - + diff --git a/spkl/SparkleXrm.Tasks.Tests/EarlyBoundTypes.cs b/spkl/SparkleXrm.Tasks.Tests/EarlyBoundTypes.cs index beb2a527..6c9265c2 100644 --- a/spkl/SparkleXrm.Tasks.Tests/EarlyBoundTypes.cs +++ b/spkl/SparkleXrm.Tasks.Tests/EarlyBoundTypes.cs @@ -6,10 +6,7 @@ using System.Collections.Generic; using System.Configuration; using System.IO; -using System.Linq; -using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; namespace SparkleXrm.Tasks.Tests { @@ -222,7 +219,7 @@ public void TestNotGeneratingAnyOptionsets() Directory.Delete(tempFolder, true); } } - + [TestMethod] [TestCategory("Integration Tests")] public void TestNotGeneratingAnyOptionsets_OneTypePerFile() @@ -263,7 +260,7 @@ public void TestNotGeneratingAnyOptionsets_OneTypePerFile() Directory.Delete(tempFolder, true); } } - + private static void Generate(string tempFolder, ConfigFile config) { var connectionString = ConfigurationManager.ConnectionStrings["integration_testing"].ConnectionString; @@ -278,13 +275,12 @@ private static void Generate(string tempFolder, ConfigFile config) // Act var task = new EarlyBoundClassGeneratorTask(ctx, trace); - task.ConectionString = connectionString; + task.ConnectionString = connectionString; task.CreateEarlyBoundTypes(ctx, config); } } - private static void EnsureClassIsCreatedCorrectly(string classPath, string className) { var code = File.ReadAllText(classPath); diff --git a/spkl/SparkleXrm.Tasks.Tests/EarlyBoundTypes_DlaB.cs b/spkl/SparkleXrm.Tasks.Tests/EarlyBoundTypes_DlaB.cs new file mode 100644 index 00000000..26b02d49 --- /dev/null +++ b/spkl/SparkleXrm.Tasks.Tests/EarlyBoundTypes_DlaB.cs @@ -0,0 +1,152 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Xrm.Sdk.Client; +using Microsoft.Xrm.Tooling.Connector; +using SparkleXrm.Tasks.Config; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace SparkleXrm.Tasks.Tests +{ + [TestClass] + public class EarlyBoundTypesDlaB + { + [TestMethod] + [TestCategory("Integration Tests")] + public void TestEbgGenerateGlobalOptionsets() + { + // Arrange + Guid id = Guid.NewGuid(); + var tempFolder = Path.Combine(Path.GetTempPath(), id.ToString()); + Directory.CreateDirectory(tempFolder); + try + { + var config = new ConfigFile + { + earlyboundtypes = new List{ + new EarlyBoundTypeConfig{ + useEarlyBoundGeneratorApi = true, + generateOptionsetEnums = true, + entities ="socialprofile,socialactivity" + } + }, + filePath = tempFolder + + }; + Generate(tempFolder, config); + + // Check that there was only a single instance of the global optionsset 'socialprofile_community' + // public enum socialprofile_community + + var matches = CountMatches("public enum SocialProfile_Community", tempFolder); + Assert.AreEqual(1, matches, "Global optionset created once only"); + } + finally + { + Directory.Delete(tempFolder, true); + } + } + + [TestMethod] + [TestCategory("Integration Tests")] + public void TestEbgGenerateGlobalOptionsets_OneTypePerFile() + { + // Arrange + Guid id = Guid.NewGuid(); + var tempFolder = Path.Combine(Path.GetTempPath(), id.ToString()); + Directory.CreateDirectory(tempFolder); + try + { + var config = new ConfigFile + { + earlyboundtypes = new List{ + new EarlyBoundTypeConfig{ + generateOptionsetEnums = true, + useEarlyBoundGeneratorApi = true, + entities ="socialprofile,socialactivity", + oneTypePerFile = true + } + }, + filePath = tempFolder + + }; + Generate(tempFolder, config); + + + Assert.IsFalse(File.Exists(Path.Combine(tempFolder, "entities.cs"))); + + EnsureClassIsCreatedCorrectly(Path.Combine($"{tempFolder}\\Entities", "SocialProfile.cs"), "SocialProfile"); + EnsureClassIsCreatedCorrectly(Path.Combine($"{tempFolder}\\Entities", "SocialActivity.cs"), "SocialActivity"); + + EnsureOptionSetsIsCreatedCorrectly(Path.Combine($"{tempFolder}\\OptionSets", "socialprofile_community.cs"), "SocialProfile_Community"); + EnsureOptionSetsIsCreatedCorrectly(Path.Combine($"{tempFolder}\\OptionSets", "socialactivity_prioritycode.cs"), "SocialActivity_PriorityCode"); + } + finally + { + Directory.Delete(tempFolder, true); + } + } + private static void Generate(string tempFolder, ConfigFile config) + { + var connectionString = ConfigurationManager.ConnectionStrings["integration_testing"].ConnectionString; + CrmServiceClient crmSvc = new CrmServiceClient(connectionString); + var userId = crmSvc.GetMyCrmUserId(); + var trace = new TraceLogger(); + + + using (var ctx = new OrganizationServiceContext(crmSvc)) + { + ctx.MergeOption = MergeOption.NoTracking; + + // Act + var task = new EarlyBoundClassGeneratorTask(ctx, trace); + task.ConnectionString = connectionString; + + task.CreateEarlyBoundTypes(ctx, config); + } + } + + private static void EnsureClassIsCreatedCorrectly(string classPath, string className) + { + var code = File.ReadAllText(classPath); + var matches = Regex.Matches(code, $"public partial class {className}"); + Assert.AreEqual(1, matches.Count, $"Class {className} created once only"); + } + + private static void EnsureOptionSetsIsCreatedCorrectly(string optionSetsPath, string optionSetsName) + { + var code = File.ReadAllText(optionSetsPath); + var matches = Regex.Matches(code, $"public enum {optionSetsName}"); + Assert.AreEqual(1, matches.Count, $"Optionset {optionSetsName} created once only"); + } + + private static int CountMatches(string matchString, string tempFolder) + { + var path = Path.Combine(tempFolder, "entities.cs"); + string code = File.ReadAllText(path); + var matches = Regex.Matches(code, matchString); + var count = matches.Count; + path = Path.Combine(tempFolder, "optionsets.cs"); + if (File.Exists(path)) + { + code = File.ReadAllText(path); + matches = Regex.Matches(code, matchString); + count += matches.Count; + } + + path = Path.Combine(tempFolder, "actions.cs"); + if (File.Exists(path)) + { + code = File.ReadAllText(path); + matches = Regex.Matches(code, matchString); + count += matches.Count; + } + return count; + } + } +} diff --git a/spkl/SparkleXrm.Tasks.Tests/SparkleXrm.Tasks.Tests.csproj b/spkl/SparkleXrm.Tasks.Tests/SparkleXrm.Tasks.Tests.csproj index ded8896e..da37f2e6 100644 --- a/spkl/SparkleXrm.Tasks.Tests/SparkleXrm.Tasks.Tests.csproj +++ b/spkl/SparkleXrm.Tasks.Tests/SparkleXrm.Tasks.Tests.csproj @@ -44,33 +44,42 @@ Plugins.snk + + ..\packages\DLaB.Xrm.EarlyBoundGenerator.Api.1.2020.5.5\lib\net462\DLaB.EarlyBoundGenerator.Api.dll + ..\packages\FakeItEasy.5.5.0\lib\net45\FakeItEasy.dll - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Crm.Sdk.Proxy.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Crm.Sdk.Proxy.dll + True - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Rest.ClientRuntime.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Rest.ClientRuntime.dll + False - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.dll + True - ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll + ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll + True - ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll + ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll + True - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Xrm.Tooling.Connector.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Xrm.Tooling.Connector.dll + True ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll @@ -166,6 +175,7 @@ + @@ -209,6 +219,7 @@ + diff --git a/spkl/SparkleXrm.Tasks.Tests/app.config b/spkl/SparkleXrm.Tasks.Tests/app.config index e3c44456..354f94ec 100644 --- a/spkl/SparkleXrm.Tasks.Tests/app.config +++ b/spkl/SparkleXrm.Tasks.Tests/app.config @@ -1,9 +1,9 @@  - + - + @@ -73,7 +73,7 @@ - + diff --git a/spkl/SparkleXrm.Tasks.Tests/packages.config b/spkl/SparkleXrm.Tasks.Tests/packages.config index d4327beb..93dbedc8 100644 --- a/spkl/SparkleXrm.Tasks.Tests/packages.config +++ b/spkl/SparkleXrm.Tasks.Tests/packages.config @@ -1,11 +1,12 @@  + - - - - - + + + + + diff --git a/spkl/SparkleXrm.Tasks/Config/ConfigFile.cs b/spkl/SparkleXrm.Tasks/Config/ConfigFile.cs index 67f1e750..a62e19ef 100644 --- a/spkl/SparkleXrm.Tasks/Config/ConfigFile.cs +++ b/spkl/SparkleXrm.Tasks/Config/ConfigFile.cs @@ -58,7 +58,7 @@ public virtual SolutionPackageConfig[] GetSolutionConfig(string profile) public virtual EarlyBoundTypeConfig[] GetEarlyBoundConfig(string profile) { if (earlyboundtypes == null) - return new EarlyBoundTypeConfig[] { new EarlyBoundTypeConfig(){ + return new [] { new EarlyBoundTypeConfig{ filename ="Entities.cs", entities = "account,contact", classNamespace = "Xrm", @@ -66,20 +66,28 @@ public virtual EarlyBoundTypeConfig[] GetEarlyBoundConfig(string profile) generateStateEnums = true } }; + foreach (var type in earlyboundtypes) + { + if (string.IsNullOrEmpty(type.entities) && type.entityCollection?.Length > 0) + { + type.entities = string.Join(",", type.entityCollection); + } + + if (string.IsNullOrEmpty(type.actions) && type.actionCollection?.Length > 0) + { + type.actions = string.Join(",", type.actionCollection); + } + } + EarlyBoundTypeConfig[] config = null; if (profile == "default") { profile = null; } - if (profile != null) - { - config = earlyboundtypes.Where(c => c.profile != null && c.profile.Replace(" ", "").Split(',').Contains(profile)).ToArray(); - } - else - { - // Default profile or empty - config = earlyboundtypes.Where(c => c.profile == null || c.profile.Replace(" ", "").Split(',').Contains("default") || String.IsNullOrWhiteSpace(c.profile)).ToArray(); - } + + config = profile == null + ? earlyboundtypes.Where(c => c.profile == null || c.profile.Replace(" ", "").Split(',').Contains("default") || string.IsNullOrWhiteSpace(c.profile)).ToArray() + : earlyboundtypes.Where(c => c.profile != null && c.profile.Replace(" ", "").Split(',').Contains(profile)).ToArray(); return config; } diff --git a/spkl/SparkleXrm.Tasks/Config/EarlyBoundTypeConfig.cs b/spkl/SparkleXrm.Tasks/Config/EarlyBoundTypeConfig.cs index 7e0d6f33..c7efdca5 100644 --- a/spkl/SparkleXrm.Tasks/Config/EarlyBoundTypeConfig.cs +++ b/spkl/SparkleXrm.Tasks/Config/EarlyBoundTypeConfig.cs @@ -1,24 +1,33 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SparkleXrm.Tasks.Config +namespace SparkleXrm.Tasks.Config { - public class EarlyBoundTypeConfig + public class EarlyBoundTypeConfig : DLaB.EarlyBoundGenerator.Settings.POCO.ExtensionConfig { + public bool useEarlyBoundGeneratorApi; + public string profile; public string entities; public string[] entityCollection; public string actions; public string[] actionCollection; public bool generateOptionsetEnums; - public bool generateGlobalOptionsets; - public bool generateStateEnums; public string filename; public string classNamespace; public string serviceContextName; public bool oneTypePerFile; + + #region spkl Generation Specific + + public bool generateGlobalOptionsets; + public bool generateStateEnums; + + #endregion spkl Generation Specific + + #region Early Bound Generator Specific + + public bool? generateActions; + public string actionFilename; + public string optionSetFilename; + + #endregion Early Bound Generator Specific } } \ No newline at end of file diff --git a/spkl/SparkleXrm.Tasks/SparkleXrm.Tasks.csproj b/spkl/SparkleXrm.Tasks/SparkleXrm.Tasks.csproj index 79bcf8a7..b517fa6c 100644 --- a/spkl/SparkleXrm.Tasks/SparkleXrm.Tasks.csproj +++ b/spkl/SparkleXrm.Tasks/SparkleXrm.Tasks.csproj @@ -37,36 +37,39 @@ SparkleXrm.snk + + ..\packages\DLaB.Xrm.EarlyBoundGenerator.Api.1.2020.5.5\lib\net462\DLaB.EarlyBoundGenerator.Api.dll + - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Crm.Sdk.Proxy.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Crm.Sdk.Proxy.dll True ..\packages\Microsoft.Extensions.FileSystemGlobbing.3.1.0\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll False - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Rest.ClientRuntime.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Rest.ClientRuntime.dll True - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.dll True - ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll + ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll True - ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll + ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Xrm.Tooling.Connector.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Xrm.Tooling.Connector.dll True @@ -77,6 +80,7 @@ + @@ -174,6 +178,14 @@ + + + + + + + + @@ -204,6 +216,21 @@ + + + + + + + + + + + + + + + diff --git a/spkl/SparkleXrm.Tasks/Tasks/EarlyBoundClassGeneratorTask.cs b/spkl/SparkleXrm.Tasks/Tasks/EarlyBoundClassGeneratorTask.cs index 5f21dd4c..41da86aa 100644 --- a/spkl/SparkleXrm.Tasks/Tasks/EarlyBoundClassGeneratorTask.cs +++ b/spkl/SparkleXrm.Tasks/Tasks/EarlyBoundClassGeneratorTask.cs @@ -1,21 +1,19 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Client; using SparkleXrm.Tasks.Config; using System.IO; using System.Diagnostics; +using DLaB.EarlyBoundGenerator; +using DLaB.Log; using SparkleXrm.Tasks.CrmSvcUtil; +using System.Linq; namespace SparkleXrm.Tasks { public class EarlyBoundClassGeneratorTask : BaseTask { - public string ConectionString {get;set;} - private string _folder; + public string ConnectionString { get; set; } public EarlyBoundClassGeneratorTask(IOrganizationService service, ITrace trace) : base(service, trace) { } @@ -26,46 +24,189 @@ public EarlyBoundClassGeneratorTask(OrganizationServiceContext ctx, ITrace trace protected override void ExecuteInternal(string folder, OrganizationServiceContext ctx) { - + _trace.WriteLine("Searching for plugin config in '{0}'", folder); var configs = ServiceLocator.ConfigFileFactory.FindConfig(folder); foreach (var config in configs) { _trace.WriteLine("Using Config '{0}'", config.filePath); - + CreateEarlyBoundTypes(ctx, config); } _trace.WriteLine("Processed {0} config(s)", configs.Count); - + } + public void CreateEarlyBoundTypes(OrganizationServiceContext ctx, ConfigFile config) { - _folder = config.filePath; + var earlyBoundTypeConfigs = config.GetEarlyBoundConfig(Profile); + foreach (var earlyboundConfig in earlyBoundTypeConfigs) + { + if (earlyboundConfig.useEarlyBoundGeneratorApi) + { + _trace.WriteLine("Using DLaB.EarlyBoundGenerator.Api"); + ProcessEbgGeneration(config, earlyboundConfig); + } + else + { + CreateEarlyBoundTypesSpkl(ctx, config, earlyboundConfig); + } + } + } + + #region DLaB.EarlyBoundGenerator.Api + + private void ProcessEbgGeneration(ConfigFile config, EarlyBoundTypeConfig earlyboundConfig) + { + Logger.Instance.OnLog += DLaBOnLog; + var crmSvcUtilPath = GetCrmSvcUtilPathDLaB(); + var ebgConfig = DLaB.EarlyBoundGenerator.Settings.EarlyBoundGeneratorConfig.GetDefault(); + ebgConfig.MaskPassword = ConnectionString != null && ConnectionString.ToLower().Contains("password"); + ebgConfig.ExtensionConfig.SetPopulatedValues(earlyboundConfig); + ebgConfig.ExtensionConfig.EntitiesWhitelist = ConvertCommasToPipes(earlyboundConfig.entities); + ebgConfig.ExtensionConfig.ActionsWhitelist = ConvertCommasToPipes(earlyboundConfig.actions); + ebgConfig.ExtensionConfig.GenerateEnumProperties = earlyboundConfig.generateOptionsetEnums; + ebgConfig.EntityOutPath = GetFile(config.filePath, earlyboundConfig.filename, "entities.cs", earlyboundConfig.oneTypePerFile); + ebgConfig.ActionOutPath = GetFile(config.filePath, earlyboundConfig.actionFilename, "actions.cs", earlyboundConfig.oneTypePerFile); + ebgConfig.OptionSetOutPath = GetFile(config.filePath, earlyboundConfig.optionSetFilename, "optionsets.cs", earlyboundConfig.oneTypePerFile); + ebgConfig.SupportsActions = earlyboundConfig.generateActions != false && !string.IsNullOrWhiteSpace(earlyboundConfig.actions); + ebgConfig.Namespace = earlyboundConfig.classNamespace ?? "Xrm"; + ebgConfig.ConnectionString = ConnectionString; + ebgConfig.CrmSvcUtilRelativePath = crmSvcUtilPath; + ebgConfig.RootPath = Path.GetDirectoryName(crmSvcUtilPath); + ebgConfig.ServiceContextName = string.IsNullOrWhiteSpace(earlyboundConfig.serviceContextName) + ? ebgConfig.ServiceContextName + : earlyboundConfig.serviceContextName; + if (earlyboundConfig.oneTypePerFile) + { + ebgConfig.ExtensionConfig.CreateOneFilePerAction = true; + ebgConfig.ExtensionConfig.CreateOneFilePerEntity = true; + ebgConfig.ExtensionConfig.CreateOneFilePerOptionSet = true; + } + + + if (string.IsNullOrEmpty(ebgConfig.ConnectionString)) + { + throw new Exception("ConnectionString must be supplied for CrmSvcUtil"); + } + + var logic = new Logic(ebgConfig); + if (!earlyboundConfig.generateOptionsetEnums) + { + if (ebgConfig.SupportsActions) + { + logic.CreateActions(); + } + + logic.CreateEntities(); + } + else + { + new Logic(ebgConfig).ExecuteAll(); + } + } + + private void DLaBOnLog(LogMessageInfo info) + { + _trace.WriteLine(info.ModalMessage); + if (info.Detail != null && info.Detail != info.ModalMessage) + { + _trace.WriteLine(info.Detail); + } + } + + private string GetFile(string path, string configured, string fileTypeName, bool createOneFilePerType) + { + path = Path.Combine(path, string.IsNullOrWhiteSpace(configured) + ? fileTypeName + : configured); + if (createOneFilePerType && Path.GetExtension(path).ToLower() == ".cs") + { + path = Path.GetDirectoryName(path) + "\\" + Path.GetFileNameWithoutExtension(path) + "\\"; + } + return path; + } + + private string ConvertCommasToPipes(string value) + { + if (string.IsNullOrWhiteSpace(value)) + { + return null; + } + return value.Replace(',', '|'); + } + + private string GetCrmSvcUtilPathDLaB() + { + // locate the CrmSvcUtil package folder + var targetFolder = ServiceLocator.DirectoryService.GetApplicationDirectory(); + + // If we are running in VS, then move up past bin/Debug + if (targetFolder.Contains(@"bin\Debug") || targetFolder.Contains(@"bin\Release")) + { + targetFolder += @"\.."; + } + + // move from spkl.v.v.v.\tools - back to packages folder + var path = Path.GetFullPath(targetFolder + @"\..\.."); + _trace.WriteLine("Target {0}", path); + var dLaBCrmSvcUtilExtPath = ServiceLocator.DirectoryService.SimpleSearch(path, "DLaB.CrmSvcUtilExtensions.dll"); + if (string.IsNullOrEmpty(dLaBCrmSvcUtilExtPath)) + { + throw new SparkleTaskException(SparkleTaskException.ExceptionTypes.UTILSNOTFOUND, + $"Cannot locate DLaB.CrmSvcUtilExtensions.dll anywhere within '{path}' - run Install-Package DLaB.EarlyBoundGenerator.Api"); + } + + var crmSvcUtilFolder = new FileInfo(dLaBCrmSvcUtilExtPath).DirectoryName; + var crmSvcUtilPath = ServiceLocator.DirectoryService.SimpleSearch(crmSvcUtilFolder, "CrmSvcUtil.exe"); + if (string.IsNullOrEmpty(crmSvcUtilPath)) + { + throw new SparkleTaskException(SparkleTaskException.ExceptionTypes.UTILSNOTFOUND, + $"Cannot locate CrmSvcUtil.exe at '{crmSvcUtilFolder}' - run Install-Package DLaB.EarlyBoundGenerator.Api"); + } + + return crmSvcUtilPath; + } + + #endregion // Early Bound Generator + + #region spkl Early Bound Generator + + public void CreateEarlyBoundTypesSpkl(OrganizationServiceContext ctx, ConfigFile config, EarlyBoundTypeConfig earlyboundconfig) + { + var folder = config.filePath; // locate the CrmSvcUtil package folder var targetfolder = ServiceLocator.DirectoryService.GetApplicationDirectory(); - + // If we are running in VS, then move up past bin/Debug if (targetfolder.Contains(@"bin\Debug") || targetfolder.Contains(@"bin\Release")) { targetfolder += @"\.."; } + _trace.WriteLine("Target {0}", targetfolder); // move from spkl.v.v.v.\tools - back to packages folder - var crmsvcutilPath = ServiceLocator.DirectoryService.SimpleSearch(targetfolder + @"\..\..", "crmsvcutil.exe"); - _trace.WriteLine("Target {0}", targetfolder); - var crmsvcutilFolder = new FileInfo(crmsvcutilPath).DirectoryName; + var crmsvcutilPaths = ServiceLocator.DirectoryService.Search(targetfolder + @"\..\..", @"crmsvcutil.exe"); + + // Get the latest version of coretools from the coretools folder + var crmsvcutilPath = (from f in crmsvcutilPaths + where f.ToLower().EndsWith(@"content\bin\coretools\crmsvcutil.exe") + orderby f descending + select f).FirstOrDefault(); + + if (string.IsNullOrEmpty(crmsvcutilPath)) { throw new SparkleTaskException(SparkleTaskException.ExceptionTypes.UTILSNOTFOUND, $"Cannot locate CrmSvcUtil at '{crmsvcutilPath}' - run Install-Package Microsoft.CrmSdk.CoreTools"); } - + var crmsvcutilFolder = new FileInfo(crmsvcutilPath).DirectoryName; // Copy the filtering assembly var filteringAssemblyPathString = ServiceLocator.DirectoryService.SimpleSearch(targetfolder + @"\..\..", "spkl.CrmSvcUtilExtensions.dll"); - + if (string.IsNullOrEmpty(filteringAssemblyPathString)) { throw new SparkleTaskException(SparkleTaskException.ExceptionTypes.UTILSNOTFOUND, @@ -80,91 +221,89 @@ public void CreateEarlyBoundTypes(OrganizationServiceContext ctx, ConfigFile con } var earlyBoundTypeConfigs = config.GetEarlyBoundConfig(this.Profile); - foreach (var earlyboundconfig in earlyBoundTypeConfigs) + + if (string.IsNullOrEmpty(earlyboundconfig.entities) && earlyboundconfig.entityCollection?.Length > 0) { - if(string.IsNullOrEmpty(earlyboundconfig.entities) && earlyboundconfig.entityCollection?.Length > 0) - { - earlyboundconfig.entities = string.Join(",", earlyboundconfig.entityCollection); - } + earlyboundconfig.entities = string.Join(",", earlyboundconfig.entityCollection); + } - if (string.IsNullOrEmpty(earlyboundconfig.actions) && earlyboundconfig.actionCollection?.Length > 0) - { - earlyboundconfig.actions = string.Join(",", earlyboundconfig.actionCollection); - } + if (string.IsNullOrEmpty(earlyboundconfig.actions) && earlyboundconfig.actionCollection?.Length > 0) + { + earlyboundconfig.actions = string.Join(",", earlyboundconfig.actionCollection); + } - // Create config and copy to the CrmSvcUtil folder - var configXml = $@" + // Create config and copy to the CrmSvcUtil folder + var configXml = $@" {earlyboundconfig.entities} {earlyboundconfig.actions} { - earlyboundconfig.generateOptionsetEnums.ToString().ToLower() - } + earlyboundconfig.generateOptionsetEnums.ToString().ToLower() + } {earlyboundconfig.generateStateEnums.ToString().ToLower()} {earlyboundconfig.generateGlobalOptionsets.ToString().ToLower()} "; - // Copy the filtering assembly to the CrmSvcUtil folder - File.WriteAllText(Path.Combine(crmsvcutilFolder, "spkl.crmsvcutil.config"), configXml); + // Copy the filtering assembly to the CrmSvcUtil folder + File.WriteAllText(Path.Combine(crmsvcutilFolder, "spkl.crmsvcutil.config"), configXml); - if (string.IsNullOrEmpty(this.ConectionString)) - throw new Exception("ConnectionString must be supplied for CrmSvcUtil"); + if (string.IsNullOrEmpty(this.ConnectionString)) + throw new Exception("ConnectionString must be supplied for CrmSvcUtil"); - // Run CrmSvcUtil - var parameters = - $@"/connstr:""{this.ConectionString}"" /out:""{ - Path.Combine(this._folder, earlyboundconfig.filename) - }"" /namespace:""{earlyboundconfig.classNamespace}"" /serviceContextName:""{ - earlyboundconfig.serviceContextName - }"" /GenerateActions:""{ - !String.IsNullOrEmpty(earlyboundconfig.actions) - }"" /codewriterfilter:""spkl.CrmSvcUtilExtensions.FilteringService,spkl.CrmSvcUtilExtensions"" /codewritermessagefilter:""spkl.CrmSvcUtilExtensions.MessageFilteringService,spkl.CrmSvcUtilExtensions"" /codegenerationservice:""spkl.CrmSvcUtilExtensions.CodeGenerationService, spkl.CrmSvcUtilExtensions"" /metadataproviderqueryservice:""spkl.CrmSvcUtilExtensions.MetadataProviderQueryService,spkl.CrmSvcUtilExtensions"""; + // Run CrmSvcUtil + var parameters = + $@"/connstr:""{this.ConnectionString}"" /out:""{ + Path.Combine(folder, earlyboundconfig.filename) + }"" /namespace:""{earlyboundconfig.classNamespace}"" /serviceContextName:""{ + earlyboundconfig.serviceContextName + }"" /GenerateActions:""{ + !String.IsNullOrEmpty(earlyboundconfig.actions) + }"" /codewriterfilter:""spkl.CrmSvcUtilExtensions.FilteringService,spkl.CrmSvcUtilExtensions"" /codewritermessagefilter:""spkl.CrmSvcUtilExtensions.MessageFilteringService,spkl.CrmSvcUtilExtensions"" /codegenerationservice:""spkl.CrmSvcUtilExtensions.CodeGenerationService, spkl.CrmSvcUtilExtensions"" /metadataproviderqueryservice:""spkl.CrmSvcUtilExtensions.MetadataProviderQueryService,spkl.CrmSvcUtilExtensions"""; - var procStart = new ProcessStartInfo(crmsvcutilPath, parameters) - { - WorkingDirectory = crmsvcutilFolder, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true, - UseShellExecute = false, - WindowStyle = ProcessWindowStyle.Hidden - }; - - _trace.WriteLine("Running {0} {1}", crmsvcutilPath, parameters); - var exitCode = 0; - Process proc = null; - try - { - proc = Process.Start(procStart); - proc.OutputDataReceived += Proc_OutputDataReceived; - proc.ErrorDataReceived += Proc_OutputDataReceived; - proc.BeginOutputReadLine(); - proc.BeginErrorReadLine(); - proc.WaitForExit(20 * 60 * 60 * 1000); - proc.CancelOutputRead(); - proc.CancelErrorRead(); - } - finally - { - exitCode = proc.ExitCode; - - proc.Close(); - } + var procStart = new ProcessStartInfo(crmsvcutilPath, parameters) + { + WorkingDirectory = crmsvcutilFolder, + RedirectStandardOutput = true, + RedirectStandardError = true, + CreateNoWindow = true, + UseShellExecute = false, + WindowStyle = ProcessWindowStyle.Hidden + }; - if (exitCode!=0) - { - throw new SparkleTaskException(SparkleTaskException.ExceptionTypes.CRMSVCUTIL_ERROR, $"CrmSvcUtil exited with error {exitCode}"); - } + _trace.WriteLine("Running {0} {1}", crmsvcutilPath, parameters); + var exitCode = 0; + Process proc = null; + try + { + proc = Process.Start(procStart); + proc.OutputDataReceived += Proc_OutputDataReceived; + proc.ErrorDataReceived += Proc_OutputDataReceived; + proc.BeginOutputReadLine(); + proc.BeginErrorReadLine(); + proc.WaitForExit(20 * 60 * 60 * 1000); + proc.CancelOutputRead(); + proc.CancelErrorRead(); + } + finally + { + exitCode = proc.ExitCode; - // Now that crmsvcutil has created the earlybound class file let's split it into separate files if this what the user wants - if (earlyboundconfig.oneTypePerFile) - { - _trace.WriteLine("oneTypePerFile=true : Splitting types into separate files..."); - SplitCrmSvcUtilOutputFileIntoOneFilePerType( - Path.Combine(_folder, earlyboundconfig.filename), - Path.Combine(_folder, Path.GetDirectoryName(earlyboundconfig.filename)), - earlyboundconfig.classNamespace); - } + proc.Close(); + } + + if (exitCode != 0) + { + throw new SparkleTaskException(SparkleTaskException.ExceptionTypes.CRMSVCUTIL_ERROR, $"CrmSvcUtil exited with error {exitCode}"); + } + + // Now that crmsvcutil has created the earlybound class file let's split it into separate files if this what the user wants + if (earlyboundconfig.oneTypePerFile) + { + _trace.WriteLine("oneTypePerFile=true : Splitting types into separate files..."); + SplitCrmSvcUtilOutputFileIntoOneFilePerType( + Path.Combine(folder, earlyboundconfig.filename), + Path.Combine(folder, Path.GetDirectoryName(earlyboundconfig.filename)), + earlyboundconfig.classNamespace); } } @@ -179,6 +318,11 @@ private void SplitCrmSvcUtilOutputFileIntoOneFilePerType(string earlyboundconfig var sourceCodeManipulator = new SourceCodeSplitter(_trace); sourceCodeManipulator.WriteToSeparateFiles(destinationDirectoryPath, sourceCode, typeNamespace); + + // Remove the original single code file generated by crmsvcutil + File.Delete(earlyboundconfigFilename); } + + #endregion } } diff --git a/spkl/SparkleXrm.Tasks/app.config b/spkl/SparkleXrm.Tasks/app.config index 1117171f..8cb9115c 100644 --- a/spkl/SparkleXrm.Tasks/app.config +++ b/spkl/SparkleXrm.Tasks/app.config @@ -57,7 +57,7 @@ - + diff --git a/spkl/SparkleXrm.Tasks/packages.config b/spkl/SparkleXrm.Tasks/packages.config index 86e70452..f9a6f5b4 100644 --- a/spkl/SparkleXrm.Tasks/packages.config +++ b/spkl/SparkleXrm.Tasks/packages.config @@ -1,12 +1,13 @@  - - - - - + + + + + + - + diff --git a/spkl/TestPlugin/PreValidateaccountUpdate.cs b/spkl/TestPlugin/PreValidateaccountUpdate.cs index b073df1e..18bd3c58 100644 --- a/spkl/TestPlugin/PreValidateaccountUpdate.cs +++ b/spkl/TestPlugin/PreValidateaccountUpdate.cs @@ -46,14 +46,14 @@ namespace TestPlugin.Plugins IsolationModeEnum.Sandbox ,Description = "Description" ,Id = "b5a10b53-3788-e711-96d0-00155d380101" - ,UnSecureConfiguration = "Some config" + ,UnSecureConfiguration = @"Some config" )] [CrmPluginRegistration("Delete", "account", StageEnum.PostOperation, ExecutionModeEnum.Synchronous, "","Delete Step", 1, IsolationModeEnum.Sandbox ,Id = "b8a10b53-3788-e711-96d0-00155d380101" - ,UnSecureConfiguration = "Some unsecure config" + ,UnSecureConfiguration = @"Some unsecure config" )] public class PreValidateaccountUpdate : PluginBase { diff --git a/spkl/TestPlugin/TestPlugin.csproj b/spkl/TestPlugin/TestPlugin.csproj index 53af0ba3..632299a9 100644 --- a/spkl/TestPlugin/TestPlugin.csproj +++ b/spkl/TestPlugin/TestPlugin.csproj @@ -38,25 +38,25 @@ - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Crm.Sdk.Proxy.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Crm.Sdk.Proxy.dll - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Rest.ClientRuntime.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Rest.ClientRuntime.dll - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.dll - ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll + ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll - ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll + ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Xrm.Tooling.Connector.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Xrm.Tooling.Connector.dll ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/spkl/TestPlugin/app.config b/spkl/TestPlugin/app.config index 50f6b166..e132793d 100644 --- a/spkl/TestPlugin/app.config +++ b/spkl/TestPlugin/app.config @@ -12,7 +12,7 @@ - + diff --git a/spkl/TestPlugin/packages.config b/spkl/TestPlugin/packages.config index 7d9031ca..ae979375 100644 --- a/spkl/TestPlugin/packages.config +++ b/spkl/TestPlugin/packages.config @@ -1,10 +1,10 @@  - - - - - + + + + + diff --git a/spkl/TestPlugin/spkl.json b/spkl/TestPlugin/spkl.json index 8a6ab213..ae596b7e 100644 --- a/spkl/TestPlugin/spkl.json +++ b/spkl/TestPlugin/spkl.json @@ -1,30 +1,32 @@ { - "plugins": [ - { - "solution": "Test", - "assemblypath": "bin\\**\\", - "classRegex": "((public( sealed)? class (?'class'[\\w]*)[\\W]*?)((?'plugin':[\\W]*?((IPlugin)|(PluginBase)|(Plugin)))|(?'wf':[\\W]*?CodeActivity)))" - }, - { - "profile": "debug", - "solution": "Test", - "assemblypath": "bin\\**\\TestPlugin.dll" - }, - { - "assemblypath": "bin\\Debug" - } - ], - "earlyboundtypes": [ - { - "profile": "default", - "entities": "account,contact,quote,goal", - "actions": "dev1_simpleaction", - "generateOptionsetEnums": true, - "generateGlobalOptionsets": false, - "generateStateEnums": true, - "filename": "EarlyBoundTypes.cs", - "classNamespace": "TestPlugin", - "serviceContextName": "XrmSvc" - } - ] + "plugins": [ + { + "solution": "Test", + "assemblypath": "bin\\**\\", + "classRegex": "((public( sealed)? class (?'class'[\\w]*)[\\W]*?)((?'plugin':[\\W]*?((IPlugin)|(PluginBase)|(Plugin)))|(?'wf':[\\W]*?CodeActivity)))" + }, + { + "profile": "debug", + "solution": "Test", + "assemblypath": "bin\\**\\TestPlugin.dll" + }, + { + "assemblypath": "bin\\Debug" + } + ], + "earlyboundtypes": [ + { + "useEarlyBoundGeneratorApi": false, + "profile": "default", + "entities": "account,contact,quote,goal", + "actions": "dev1_simpleaction", + "generateOptionsetEnums": true, + "filename": "EarlyBoundTypes.cs", + "classNamespace": "TestPlugin", + "serviceContextName": "XrmSvc", + "oneTypePerFile": false, + "generateGlobalOptionsets": false, + "generateStateEnums": true + } + ] } \ No newline at end of file diff --git a/spkl/TestPluginWorkflowCombined/TestPluginWorkflowCombined.csproj b/spkl/TestPluginWorkflowCombined/TestPluginWorkflowCombined.csproj index 0bace663..631c68d3 100644 --- a/spkl/TestPluginWorkflowCombined/TestPluginWorkflowCombined.csproj +++ b/spkl/TestPluginWorkflowCombined/TestPluginWorkflowCombined.csproj @@ -38,25 +38,25 @@ - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Crm.Sdk.Proxy.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Crm.Sdk.Proxy.dll - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Rest.ClientRuntime.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Rest.ClientRuntime.dll - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.dll - ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll + ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll - ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll + ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Xrm.Tooling.Connector.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Xrm.Tooling.Connector.dll ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/spkl/TestPluginWorkflowCombined/app.config b/spkl/TestPluginWorkflowCombined/app.config index 50f6b166..e132793d 100644 --- a/spkl/TestPluginWorkflowCombined/app.config +++ b/spkl/TestPluginWorkflowCombined/app.config @@ -12,7 +12,7 @@ - + diff --git a/spkl/TestPluginWorkflowCombined/packages.config b/spkl/TestPluginWorkflowCombined/packages.config index 7d9031ca..ae979375 100644 --- a/spkl/TestPluginWorkflowCombined/packages.config +++ b/spkl/TestPluginWorkflowCombined/packages.config @@ -1,10 +1,10 @@  - - - - - + + + + + diff --git a/spkl/TestWorkflowActivity/TestWorkflowActivity.csproj b/spkl/TestWorkflowActivity/TestWorkflowActivity.csproj index 5d436913..a91dec46 100644 --- a/spkl/TestWorkflowActivity/TestWorkflowActivity.csproj +++ b/spkl/TestWorkflowActivity/TestWorkflowActivity.csproj @@ -38,25 +38,25 @@ - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Crm.Sdk.Proxy.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Crm.Sdk.Proxy.dll - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Rest.ClientRuntime.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Rest.ClientRuntime.dll - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.dll - ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll + ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll - ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll + ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Xrm.Tooling.Connector.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Xrm.Tooling.Connector.dll ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/spkl/TestWorkflowActivity/app.config b/spkl/TestWorkflowActivity/app.config index cf1c053c..ed97c806 100644 --- a/spkl/TestWorkflowActivity/app.config +++ b/spkl/TestWorkflowActivity/app.config @@ -24,7 +24,7 @@ - + diff --git a/spkl/TestWorkflowActivity/packages.config b/spkl/TestWorkflowActivity/packages.config index 7d9031ca..ae979375 100644 --- a/spkl/TestWorkflowActivity/packages.config +++ b/spkl/TestWorkflowActivity/packages.config @@ -1,10 +1,10 @@  - - - - - + + + + + diff --git a/spkl/spkl/App.config b/spkl/spkl/App.config index 13ee2802..66402386 100644 --- a/spkl/spkl/App.config +++ b/spkl/spkl/App.config @@ -1,8 +1,8 @@  - - - + + + @@ -21,42 +21,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -65,18 +41,13 @@ - - - - - - + diff --git a/spkl/spkl/Package/spkl.nuspec b/spkl/spkl/Package/spkl.nuspec index 501e8f1a..f8ac6081 100644 --- a/spkl/spkl/Package/spkl.nuspec +++ b/spkl/spkl/Package/spkl.nuspec @@ -29,6 +29,7 @@ + diff --git a/spkl/spkl/Program.cs b/spkl/spkl/Program.cs index f314b441..616188c5 100644 --- a/spkl/spkl/Program.cs +++ b/spkl/spkl/Program.cs @@ -359,7 +359,7 @@ private static void RunTask(CommandLineArgs arguments, IOrganizationService serv trace.WriteLine("Generating early bound types"); var earlyBound = new EarlyBoundClassGeneratorTask(service, trace); task = earlyBound; - earlyBound.ConectionString = arguments.Connection; + earlyBound.ConnectionString = arguments.Connection; break; case "unpack": diff --git a/spkl/spkl/packages.config b/spkl/spkl/packages.config index 1d8dc83f..fcf707d2 100644 --- a/spkl/spkl/packages.config +++ b/spkl/spkl/packages.config @@ -1,12 +1,13 @@  - - - - - - + + + + + + + diff --git a/spkl/spkl/spkl.csproj b/spkl/spkl/spkl.csproj index d652530d..f6d221c3 100644 --- a/spkl/spkl/spkl.csproj +++ b/spkl/spkl/spkl.csproj @@ -38,31 +38,35 @@ ..\packages\CmdLine.1.0.7.509\lib\net40-Client\CmdLine.dll True + + ..\packages\DLaB.Xrm.EarlyBoundGenerator.Api.1.2020.5.5\lib\net462\DLaB.EarlyBoundGenerator.Api.dll + - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Crm.Sdk.Proxy.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Crm.Sdk.Proxy.dll True - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Rest.ClientRuntime.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Rest.ClientRuntime.dll True + - ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.dll + ..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.dll True - ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll + ..\packages\Microsoft.CrmSdk.Deployment.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll True - ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.23\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll + ..\packages\Microsoft.CrmSdk.Workflow.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll True - ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.38\lib\net462\Microsoft.Xrm.Tooling.Connector.dll + ..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.44\lib\net462\Microsoft.Xrm.Tooling.Connector.dll True @@ -79,6 +83,7 @@ ..\packages\System.Collections.Immutable.1.7.0\lib\netstandard2.0\System.Collections.Immutable.dll + @@ -155,14 +160,6 @@ Designer - - - - - - - - Designer @@ -191,62 +188,7 @@ SparkleXrm.Tasks - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +