Ejemplo n.º 1
0
        private static ConfigApplication FromSolution(FileInfo file)
        {
            var application = new ConfigApplication()
            {
                Source = file,
                Name   = NameInferer.InferApplicationName(file)
            };

            // BE CAREFUL modifying this code. Avoid proliferating MSBuild types
            // throughout the code, because we load them dynamically.
            foreach (var projectFile in ProjectReader.EnumerateProjects(file))
            {
                // Check for the existance of a launchSettings.json as an indication that the project is
                // runnable. This will only apply in the case where tye is being used against a solution
                // like `tye init` or `tye run` without a `tye.yaml`.
                //
                // We want a *fast* heuristic that excludes unit test projects and class libraries without
                // having to load all of the projects.
                var launchSettings = Path.Combine(projectFile.DirectoryName !, "Properties", "launchSettings.json");
                if (File.Exists(launchSettings) || ContainsOutputTypeExe(projectFile))
                {
                    var service = new ConfigService()
                    {
                        Name    = NormalizeServiceName(Path.GetFileNameWithoutExtension(projectFile.Name)),
                        Project = projectFile.FullName.Replace('\\', '/'),
                    };

                    application.Services.Add(service);
                }
            }

            return(application);
        }
Ejemplo n.º 2
0
        private static ConfigApplication FromSolution(FileInfo file)
        {
            var application = new ConfigApplication()
            {
                Source = file,
            };

            // BE CAREFUL modifying this code. Avoid proliferating MSBuild types
            // throughout the code, because we load them dynamically.
            foreach (var projectFile in ProjectReader.EnumerateProjects(file))
            {
                var description = CreateService(projectFile);
                if (description != null)
                {
                    application.Services.Add(description);
                }
            }

            return(application);
        }
Ejemplo n.º 3
0
        private static ConfigApplication FromSolution(FileInfo file)
        {
            var application = new ConfigApplication()
            {
                Source = file,
            };

            // BE CAREFUL modifying this code. Avoid proliferating MSBuild types
            // throughout the code, because we load them dynamically.
            foreach (var projectFile in ProjectReader.EnumerateProjects(file))
            {
                var service = new ConfigService()
                {
                    Name    = Path.GetFileNameWithoutExtension(projectFile.Name).ToLowerInvariant(),
                    Project = projectFile.FullName.Replace('\\', '/'),
                };

                application.Services.Add(service);
            }

            return(application);
        }