public static IReadOnlyCollection <ServiceProject> Discover(ServiceDiscoveryOptions options)
        {
            var files = Directory.GetFiles(options.Root, "*.csproj", SearchOption.AllDirectories);

            return(files
                   .Where(x => !x.EndsWith(".Tests.csproj") && !x.EndsWith(".Test.csproj") && !x.Contains("node_modules"))
                   .Select(projectPath => new ServiceProject(projectPath, FindAssembly(options, projectPath)))
                   .ToList());
        }
        private static string FindAssembly(ServiceDiscoveryOptions options, string projectPath)
        {
            var assemblyName = Path.GetFileNameWithoutExtension(projectPath) + ".dll";

            var files = Directory.GetFiles(options.Root, assemblyName, SearchOption.AllDirectories);

            return(files
                   .OrderByDescending(File.GetLastWriteTimeUtc)
                   .First());
        }
 public ServerlessBuilder(ServiceDiscoveryOptions serviceDiscoveryOptions, NamingConventions namingConventions)
 {
     _serviceDiscoveryOptions = serviceDiscoveryOptions;
     _namingConventions       = namingConventions;
 }
Ejemplo n.º 4
0
 public Packager(ServiceDiscoveryOptions serviceDiscoveryOptions, PackageOptions options)
 {
     _serviceDiscoveryOptions = serviceDiscoveryOptions;
     _options = options;
 }
Ejemplo n.º 5
0
 public RouterConfigBuilder(ServiceDiscoveryOptions serviceDiscoveryOptions, NamingConventions namingConventions)
 {
     _serviceDiscoveryOptions = serviceDiscoveryOptions;
     _namingConventions       = namingConventions;
 }