Example #1
0
 private IEnumerable <JamEntryInfo> RediscoverEntriesFromStubs(FilePath entriesPath, IReadOnlyCollection <JamEntryStub> stubs)
 {
     foreach (var stub in stubs)
     {
         var id = stub.Id;
         var entryDirectoryPath = entriesPath.Append(stub.EntrySubpath);
         yield return(EntryInfoExplorer.RediscoverJamEntryInfo(id, entryDirectoryPath));
     }
 }
Example #2
0
        public JamInfo RediscoverJamInfo(FilePath jamDirectoryPath)
        {
            var jamInfo = StubJamInfoFromFile(jamDirectoryPath)
                          ?? StubJamInfoFromDirectory(jamDirectoryPath);

            var entriesPath = jamDirectoryPath.Append(jamInfo.EntriesSubpath);

            jamInfo.Entries = RediscoverEntriesFromStubs(entriesPath, jamInfo.EntriesStubs).ToList();

            return(jamInfo);
        }
        public JamInfo RediscoverJamInfo(FilePath jamDirectoryPath)
        {
            var jamInfo = StubJamInfoFromFile(jamDirectoryPath) ?? StubJamInfoFromDirectory(jamDirectoryPath);

            jamInfo.LogoFileName ??= FindLogoPath(jamDirectoryPath)?.AsRelativeTo(jamDirectoryPath);

            var entriesPath = jamDirectoryPath.Append(jamInfo.EntriesSubpath);

            jamInfo.Entries = RediscoverEntriesFromStubs(entriesPath, jamInfo.EntriesStubs).ToList();

            return(jamInfo);
        }
Example #4
0
        // ---------------
        // Loading entries
        // ---------------

        private IEnumerable <JamEntryInfo> LoadEntriesFromStubs(FilePath entriesPath, IReadOnlyCollection <JamEntryStub> stubs)
        {
            foreach (var stub in stubs)
            {
                var id = stub.Id;
                var entryDirectoryPath = entriesPath.Append(stub.EntrySubpath);
                var entry = EntryInfoExplorer.TryLoadJamEntryInfo(id, entryDirectoryPath);
                if (entry != null)
                {
                    yield return(entry);
                }
            }
        }
Example #5
0
        // -----------------------
        // Stubbing from directory
        // -----------------------

        private JamInfo StubJamInfoFromDirectory(FilePath jamDirectoryPath)
        {
            var entriesPath = FindEntriesPath(jamDirectoryPath);

            if (entriesPath == null)
            {
                throw new DirectoryNotFoundException("Could not find the entries subdirectory in the jam directory.");
            }

            var entriesStubs = FindEntriesStubs(entriesPath.Value).ToList();

            return(new JamInfo()
            {
                JamInfoPath = jamDirectoryPath.Append("jam.jaminfo"),
                EntriesSubpath = entriesPath.Value.AsRelativeTo(jamDirectoryPath),
                EntriesStubs = entriesStubs,
            });
        }
Example #6
0
        // -----------------------
        // Stubbing from directory
        // -----------------------

        private JamEntryInfo StubEntryInfoFromDirectory(string id, FilePath entryDirectoryPath)
        {
            var titleAndAuthors = ExtractTitleAndAuthors(entryDirectoryPath);

            return(new JamEntryInfo()
            {
                Id = id,
                EntryInfoPath = entryDirectoryPath.Append("entry.jamentry"),
                Title = titleAndAuthors.Title,
                Team = new JamTeamInfo
                {
                    Name = null,
                    Authors = titleAndAuthors.Authors.Select(name => new JamAuthorInfo {
                        Name = name
                    }).ToList()
                }
            });
        }
Example #7
0
        private void RebuildByFluentMigration(FilePath projPath, FilePath psScript)
        {
            var createDatabase = projPath.Append(new FilePath("DatabaseScripts")).Append(new FilePath("CreateDatabase.sql"));
            Log.Status("Creating database from " + createDatabase.ToEnvironmentalPath());
            _builder.RunSqlScripts(projPath, createDatabase);

            Log.Status("Running RunMigrationsLocally.ps1");
            projPath.Call("powershell " + psScript.ToEnvironmentalPath(), "");
        }