コード例 #1
0
        public void InitializeToolkitProject(Project project)
        {
            if (project == null)
            {
                throw new ArgumentNullException(nameof(project));
            }

            var model = TemplateModel.Object(project);

            var slnRes = _resourceRepository.CreateResource(project.SolutionPath, Files.ProjectSln);

            slnRes.Content = _templateProcessor.Transform(slnRes.Content, model);

            var coreRes = _resourceRepository.CreateResource(project.CoreProjectPath, Files.CoreCsproj);

            coreRes.Content = _templateProcessor.Transform(coreRes.Content, model);

            var commandRes = _resourceRepository.CreateResource(project.CommandProjectPath, Files.CommandCsproj);

            commandRes.Content = _templateProcessor.Transform(commandRes.Content, model);

            var manifestRes = _resourceRepository.CreateResource(project.ManifestPath, Files.ManifestPsd1);

            manifestRes.Content = _templateProcessor.Transform(manifestRes.Content, model);

            var loadertRes = _resourceRepository.CreateResource(project.LoaderPath, Files.LoaderPsm1);

            loadertRes.Content = _templateProcessor.Transform(loadertRes.Content, model);

            _resourceRepository.CreateResource(project.GitignorePath, Files.Gitignore);

            _fileSystem.FileCreate(project.ChangeLogPath);
            _fileSystem.FileCreate(project.LicencePath);
            _fileSystem.FileCreate(project.ReadmePath);
        }