Beispiel #1
0
        /// <summary>
        /// Scans the SDK source and test folder locations to detect existing projects that
        /// follow our naming convention, adding them to the set of all projects to be
        /// processed into the solution files.
        /// </summary>
        private void ScanForExistingProjects()
        {
            const string awssdkProjectNamePattern = "AWSSDK.*.*proj";

            var foldersToProcess = new[]
            {
                Path.Combine(Options.SdkRootFolder, GeneratorDriver.SourceSubFoldername),
                Path.Combine(Options.SdkRootFolder, GeneratorDriver.TestsSubFoldername)
            };

            foreach (var rootFolder in foldersToProcess)
            {
                foreach (var projectFile in Directory.GetFiles(rootFolder, awssdkProjectNamePattern, SearchOption.AllDirectories))
                {
                    var projectName = Path.GetFileNameWithoutExtension(projectFile);
                    if (_allProjects.ContainsKey(projectName))
                    {
                        continue;
                    }

                    var projectConfig = new ProjectFileCreator.ProjectConfigurationData
                    {
                        ProjectGuid            = Utils.GetProjectGuid(projectFile),
                        ConfigurationPlatforms = GetProjectPlatforms(projectName)
                    };

                    _allProjects.Add(projectName, projectConfig);
                }
            }
        }
Beispiel #2
0
        private void AddExtraTestProjects(ProjectFileConfiguration projectConfig, Dictionary <string, ProjectFileCreator.ProjectConfigurationData> solutionProjects, List <Project> testProjects)
        {
            foreach (var extraTestProject in projectConfig.ExtraTestProjects)
            {
                var projectPath = @"..\..\..\..\sdk\" + extraTestProject;

                var projectGuid = Utils.GetProjectGuid(projectPath);
                var testProject = ProjectFromFile(extraTestProject, projectGuid);

                var testProjectConfig = new ProjectFileCreator.ProjectConfigurationData
                {
                    ProjectGuid            = projectGuid,
                    ConfigurationPlatforms = GetProjectPlatformsFromFile(projectPath).ToList()
                };

                solutionProjects.Add(testProject.Name, testProjectConfig);
                testProjects.Add(testProject);
            }
        }
        private void AddExtraTestProjects(ProjectFileConfiguration projectConfig, Dictionary<string, ProjectFileCreator.ProjectConfigurationData> solutionProjects, List<Project> testProjects)
        {
            foreach (var extraTestProject in projectConfig.ExtraTestProjects)
            {
                var projectPath = @"..\..\..\..\sdk\" + extraTestProject;

                var projectGuid = Utils.GetProjectGuid(projectPath);
                var testProject = ProjectFromFile(extraTestProject, projectGuid);

                var testProjectConfig = new ProjectFileCreator.ProjectConfigurationData
                {
                    ProjectGuid = projectGuid,
                    ConfigurationPlatforms = GetProjectPlatformsFromFile(projectPath).ToList()
                };

                solutionProjects.Add(testProject.Name, testProjectConfig);
                testProjects.Add(testProject);
            }
        }
        /// <summary>
        /// Scans the SDK source and test folder locations to detect existing projects that
        /// follow our naming convention, adding them to the set of all projects to be
        /// processed into the solution files.
        /// </summary>
        private void ScanForExistingProjects()
        {
            const string awssdkProjectNamePattern = "AWSSDK.*.csproj";

            var foldersToProcess = new[]
            {
                Path.Combine(Options.SdkRootFolder, GeneratorDriver.SourceSubFoldername),
                Path.Combine(Options.SdkRootFolder, GeneratorDriver.TestsSubFoldername)
            };

            foreach (var rootFolder in foldersToProcess)
            {
                foreach (var projectFile in Directory.GetFiles(rootFolder, awssdkProjectNamePattern, SearchOption.AllDirectories))
                {
                    var projectName = Path.GetFileNameWithoutExtension(projectFile);
                    if (_allProjects.ContainsKey(projectName))
                        continue;

                    var projectConfig = new ProjectFileCreator.ProjectConfigurationData
                    {
                        ProjectGuid = Utils.GetProjectGuid(projectFile),
                        ConfigurationPlatforms = GetProjectPlatforms(projectName)
                    };

                    _allProjects.Add(projectName, projectConfig);
                }
            }
        }
        /// <summary>
        /// Scans the SDK source and test folder locations to detect existing projects that
        /// follow our naming convention, adding them to the set of all projects to be
        /// processed into the solution files.
        /// </summary>
        private void ScanForExistingProjects()
        {
            const string awssdkProjectNamePattern = "AWSSDK.*.csproj";

            var foldersToProcess = new[]
            {
                Path.Combine(Options.SdkRootFolder, GeneratorDriver.SourceSubFoldername),
                Path.Combine(Options.SdkRootFolder, GeneratorDriver.TestsSubFoldername)
            };

            foreach (var rootFolder in foldersToProcess)
            {
                foreach (var projectFile in Directory.GetFiles(rootFolder, awssdkProjectNamePattern, SearchOption.AllDirectories))
                {
                    var projectName = Path.GetFileNameWithoutExtension(projectFile);
                    if (_allProjects.ContainsKey(projectName))
                        continue;

                    var content = File.ReadAllText(projectFile);

                    var pos = content.IndexOf("<ProjectGuid>", StringComparison.OrdinalIgnoreCase) + "<ProjectGuid>".Length;
                    var lastPos = content.IndexOf("</ProjectGuid>", pos, StringComparison.OrdinalIgnoreCase);
                    var guid = content.Substring(pos, lastPos - pos);

                    var projectConfig = new ProjectFileCreator.ProjectConfigurationData
                    {
                        ProjectGuid = guid,
                        ConfigurationPlatforms = GetProjectPlatforms(projectName)
                    };

                    _allProjects.Add(projectName, projectConfig);
                }
            }
        }