private void TryInitializeWithRootPaths(IEnumerable <string> rootPaths)
        {
            foreach (var rootPath in rootPaths)
            {
                try
                {
                    if (!DslSyntaxProvider.IsValidProjectRootPath(rootPath))
                    {
                        log.LogTrace($"Path '{rootPath}' is not a valid Rhetos Project path, skipping.");
                        continue;
                    }

                    log.LogTrace($"Trying to initialize RhetosProjectContext with rootPath='{rootPath}'.");
                    rhetosProjectContext.Initialize(new DslSyntaxProvider(rootPath, new RhetosNetCoreLogProvider(logFactory)));

                    if (rhetosProjectContext.ProjectRootPath == rootPath)
                    {
                        break;
                    }
                }
                catch (Exception e)
                {
                    log.LogTrace($"RhetosProjectContext initialize failed at rootPath='{rootPath}'. {e}");
                }
            }
        }
Exemple #2
0
 private bool IsValidRhetosProjectFolder(string folder)
 {
     return(DslSyntaxProvider.IsValidProjectRootPath(folder));
 }