Ejemplo n.º 1
0
 public IServerPath ResolveDistributionServerPath(IServerPath basePath)
 {
     return(basePath.Subpath(Folders.EnginesAndGamesFolder.WellKnownName)
            .Subpath(_contentProvider.Name)
            .Subpath(Folders.EngineFolder.WellKnownName)
            .Subpath(_version.ToString()));
 }
Ejemplo n.º 2
0
 private IServerPath ResolveDistributionServerPath(IServerPath basePath)
 {
     return(basePath.Subpath(Folders.EnginesAndGamesFolder.WellKnownName)
            .Subpath(_engineName.ToString())
            .Subpath(Folders.GamesFolder.WellKnownName)
            .Subpath(_gameName)
            .Subpath(Folders.GameLimitsFolder.WellKnownName)
            .Subpath(_version.ToString()));
 }
Ejemplo n.º 3
0
        public Optional <IServerPath> TryGetSubFolder(IServerPath parentServerPath, string subfolderName)
        {
            var result = Optional <IServerPath> .None();

            var subfolderServerPath = parentServerPath.Subpath(subfolderName);

            _tfsCache.FindFolder(subfolderServerPath.AsString())
            .Do(item => result = Optional <IServerPath> .Some(subfolderServerPath));

            return(result);
        }
Ejemplo n.º 4
0
        public Optional <IServerPath> TryGetFile(IServerPath parentFolderServerPath, string fileName)
        {
            var fileServerPath = parentFolderServerPath.Subpath(fileName);

            Optional <Item> tfsItem = _tfsCache.FindFile(fileServerPath.AsString());

            if (tfsItem.Any())
            {
                return(Optional <IServerPath> .Some(fileServerPath));
            }
            else
            {
                return(Optional <IServerPath> .None());
            }
        }
Ejemplo n.º 5
0
        public void CreateFile(IServerPath folderServerPath, string fileName, byte[] content)
        {
            var workspace      = GetWorkspace();
            var fileServerPath = folderServerPath.Subpath(fileName);
            var fileLocalPath  = workspace.GetLocalItemForServerItem(fileServerPath.AsString());

            _fileSystemManager.WriteFileContent(fileLocalPath, content);

            workspace.PendAdd(fileLocalPath);

            workspace.CheckInWithPolicyOverride($"Add file {fileName}",
                                                new string[] { fileLocalPath },
                                                "This file was automatically created by the GGP Developer Tool.");

            _tfsCache.AddFileToCache(fileServerPath.AsString());
        }
Ejemplo n.º 6
0
        private void AppendInstallerContent(InstallerDefinition installerDefinition, IServerPath branchServerPath)
        {
            var installerContentTxtPath = branchServerPath.Subpath(Constants.Versions)
                                          .Subpath(installerDefinition.Version.ToString())
                                          .Subpath(Constants.InstallerContentTxt);

            foreach (var keyValue in StringKeyValueCollection.Parse(_sourceControlAdapter.ReadTextFile(installerContentTxtPath)))
            {
                if (keyValue.Value.StartsWith("$/"))
                {
                    installerDefinition.Components.Add(new InstallerDefinition.ComponentDefinition(keyValue.Name, _sourceControlAdapter.CreateServerPath(keyValue.Value)));
                }
                else //backward compatibility with the installers up to 1.5.x
                {
                    installerDefinition.Components.Add(new InstallerDefinition.ComponentDefinition(keyValue.Name, _sourceControlAdapter.CreateServerPath(ConfigurationManager.AppSettings[ConfigurationKeys.oldDistributionPath]).Subpath(keyValue.Value)));
                }
            }
        }
Ejemplo n.º 7
0
        public IServerPath CreateSubfolder(IServerPath parentServerPath, string subfolderName)
        {
            var workspace           = GetWorkspace();
            var localParentFolder   = workspace.GetLocalItemForServerItem(parentServerPath.AsString());
            var subfolderLocalPath  = Path.Combine(localParentFolder, subfolderName);
            var subfolderServerPath = parentServerPath.Subpath(subfolderName);

            _fileSystemManager.CreateFolder(subfolderLocalPath);

            workspace.Map(subfolderServerPath.AsString(), subfolderLocalPath);
            workspace.PendAdd(subfolderLocalPath);


            workspace.CheckInWithPolicyOverride($"Create folder {subfolderName}",
                                                new string[] { subfolderLocalPath },
                                                "This folder was created automatically by the GGP Developer Tool.");

            _tfsCache.AddFolderToCache(subfolderServerPath.AsString());
            return(subfolderServerPath);
        }
Ejemplo n.º 8
0
 public void Branch(IServerPath targetFolder)
 {
     _tfsGateway.Branch(this.ServerPath, targetFolder.Subpath(this.Name), false);
 }
Ejemplo n.º 9
0
 private IServerPath ResolveDistributionServerPath(IServerPath basePath)
 {
     return(basePath.Subpath(Folders.CoreFolder.WellKnownName)
            .Subpath(_contentProvider.Name)
            .Subpath(_version.ToString()));
 }
Ejemplo n.º 10
0
 public IServerPath GetServerPath()
 {
     return(_parentPath.Subpath(this.Name));
 }
Ejemplo n.º 11
0
        private InstallerDefinition CreateInstallerDefinitionHeader(IServerPath branchServerPath)
        {
            var latestTxtFileContent = _sourceControlAdapter.ReadTextFile(branchServerPath.Subpath(Constants.LatestTxt));

            return(new InstallerDefinition(latestTxtFileContent));
        }