Exemple #1
0
 public BuildConfiguration(ILocalPath outputFolder, ILocalPath distributionLocalFolder, IServerPath distributionServerPath, ILocalPath solutionFile)
 {
     this.OutputFolder           = outputFolder;
     this.DistributionLocalPath  = distributionLocalFolder;
     this.DistributionServerPath = distributionServerPath;
     this.SolutionFile           = solutionFile;
 }
Exemple #2
0
        public void DownloadFolderContent(IServerPath serverPath, ILocalPath localPath, ILogger logger)
        {
            var items = this.VersionControlServer.GetItems(serverPath.AsString(), VersionSpec.Latest, RecursionType.OneLevel);

            foreach (var item in items.Items)
            {
                if (0 == string.Compare(item.ServerItem, serverPath.AsString(), true))
                {
                    continue;
                }

                var itemServerPath = new ServerPath(item.ServerItem);
                var itemLocalPath  = localPath.Subpath(itemServerPath.GetName());

                if (item.ItemType == ItemType.File)
                {
                    logger.Info($"Download file {item.ServerItem} to {itemLocalPath.AsString()}");
                    item.DownloadFile(itemLocalPath.AsString());
                }
                else
                {
                    DownloadFolderContent(itemServerPath, itemLocalPath, logger);
                }
            }
        }
Exemple #3
0
 public ILocalPath ResolveDistributionLocalPath(ILocalPath basePath)
 {
     return(basePath.Subpath(Folders.EnginesAndGamesFolder.WellKnownName)
            .Subpath(_contentProvider.Name)
            .Subpath(Folders.EngineFolder.WellKnownName)
            .Subpath(_version.ToString()));
 }
Exemple #4
0
 public void PendAdd(ILocalPath filePath)
 {
     if (!_tfsGateway.HasPendingChanges(filePath))
     {
         _tfsGateway.PendAdd(filePath);
     }
     _pendingFiles.Add(filePath.AsString());
 }
Exemple #5
0
        public void PendDelete(ILocalPath path)
        {
            var serverPath = _workspace.GetServerItemForLocalItem(path.AsString());

            _workspace.Get(new GetRequest(serverPath, RecursionType.Full, VersionSpec.Latest), GetOptions.None);
            _workspace.PendDelete(path.AsString(), RecursionType.Full);
            _pendingChanges.Add(path.AsString());
        }
Exemple #6
0
 public ILocalPath ResolveDistributionLocalPath(ILocalPath basePath)
 {
     return(basePath.Subpath(Folders.EnginesAndGamesFolder.WellKnownName)
            .Subpath(_engineName.ToString())
            .Subpath(Folders.GamesFolder.WellKnownName)
            .Subpath(_gameName)
            .Subpath(Folders.GameLimitsFolder.WellKnownName)
            .Subpath(_version.ToString()));
 }
Exemple #7
0
        public void CheckoutForEdit(ILocalPath filePath)
        {
            if (!_tfsGateway.HasPendingChanges(filePath))
            {
                _tfsGateway.CheckoutForEdit(filePath);
            }

            _pendingFiles.Add(filePath.AsString());
        }
Exemple #8
0
 public EveryCentDatabase(ILocalPath databasePath)
 {
     try
     {
         var pathToDatabase = databasePath.GetLocalFilePath("everycent.db3");
         _connection = new SQLiteAsyncConnection(pathToDatabase, false);
         _connection.CreateTableAsync <Movement>().Wait();
     }
     catch (Exception) { }
 }
Exemple #9
0
        private IEnumerable <IVisualStudioProject> ReadVisualStudioProjects(ILocalPath inFolder)
        {
            var projects = new List <IVisualStudioProject>();

            foreach (var projectInSolution in _solutionFile.ProjectsInOrder.Where(p => p.ProjectType == SolutionProjectType.KnownToBeMSBuildFormat))
            {
                if (!this.SolutionFoldersToIgnore.Contains(projectInSolution.ParentProjectGuid) &&
                    projectInSolution.AbsolutePath.StartsWith(inFolder.AsString(), StringComparison.OrdinalIgnoreCase))
                {
                    projects.Add(new VisualStudioProject(projectInSolution.AbsolutePath));
                }
            }

            return(projects);
        }
Exemple #10
0
        private IEnumerable <string> FindReferencedAssemblies(ILocalPath folderContainingAssemblies, IEnumerable <string> allUsedReferences)
        {
            var allUsedReferencesDic = allUsedReferences.Distinct().ToDictionary(r => r, StringComparer.OrdinalIgnoreCase);
            var assemblies           = new List <string>();

            foreach (var file in Directory.EnumerateFiles(folderContainingAssemblies.AsString(),
                                                          "*.dll",
                                                          SearchOption.AllDirectories))
            {
                if (allUsedReferencesDic.ContainsKey(file))
                {
                    assemblies.Add(file);
                }
            }

            return(assemblies);
        }
Exemple #11
0
        public void TryGetLatest(ILocalPath localPath)
        {
            var workspace = GetWorkspace();

            if (!workspace.IsLocalPathMapped(localPath.AsString()))
            {
                return;
            }

            var serverPath = workspace.GetServerItemForLocalItem(localPath.AsString());

            var tfsItem = workspace.VersionControlServer.GetItems(serverPath, RecursionType.None).Items.FirstOrDefault();

            if (tfsItem != null)
            {
                workspace.GetFullLatest(tfsItem.ServerItem);
            }
        }
Exemple #12
0
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            try
            {
                ILocalPath path   = DependencyService.Get <ILocalPath>();
                string     dbPath = path.DatabasePath(_databasePath);
                if (string.IsNullOrEmpty(dbPath))
                {
                    throw new Exception("ILocalPath.DatabasePath: returned null reference");
                }

                optionsBuilder.UseSqlite($"Filename={dbPath}");
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
        }
Exemple #13
0
 public void WriteFileContent(ILocalPath localPath, byte[] content)
 {
     _fileSystemManager.WriteFileContent(localPath.AsString(), content);
 }
Exemple #14
0
 public void WriteAllText(ILocalPath filePath, string fileContent)
 {
     _fileSystemManager.WriteAllText(filePath.AsString(), fileContent);
 }
Exemple #15
0
 public string ReadAllText(ILocalPath filePath)
 {
     return(_fileSystemManager.ReadAllText(filePath.AsString()));
 }
Exemple #16
0
 public void CopyFile(ILocalPath sourceFile, ILocalPath targetFile)
 {
     _fileSystemManager.CopyFile(sourceFile.AsString(), targetFile.AsString());
 }
Exemple #17
0
 public bool FileExists(ILocalPath fileLocalPath)
 {
     return(_fileSystemManager.FileExists(fileLocalPath.AsString()));
 }
Exemple #18
0
 public AssemblyInfoVersionUpdateAction(ILocalPath assemblyInfoFile, VersionNumber version)
 {
     _assemblyInfoFile = assemblyInfoFile;
     _version          = version;
 }
Exemple #19
0
 public void PendAdd(ILocalPath filePath)
 {
 }
Exemple #20
0
 public IServerPath GetServerPathFromLocalPath(ILocalPath localPath)
 {
     return(CreateServerPathDescriptor(GetWorkspace().GetServerItemForLocalItem(localPath.AsString())));
 }
Exemple #21
0
 public ILocalPath ResolveBuildOutputPath(ILocalPath basePath)
 {
     return(basePath.Subpath(Folders.GamesFolder.WellKnownName)
            .Subpath(GameName)
            .Subpath(FileName));
 }
Exemple #22
0
 public TfsFile(IServerPath serverPath, ILocalPath localPath, ITfsGateway tfsGateway)
 {
     ServerPath  = serverPath;
     LocalPath   = localPath;
     _tfsGateway = tfsGateway;
 }
Exemple #23
0
 public bool HasPendingChanges(ILocalPath filePath)
 {
     return(GetWorkspace().GetPendingChanges(filePath.AsString()).Any());
 }
Exemple #24
0
 public void DeleteFile(ILocalPath targetFile)
 {
     _fileSystemManager.DeleteFile(targetFile.AsString());
 }
Exemple #25
0
 public void TryGetLatestVersion(ILocalPath filePath)
 {
 }
Exemple #26
0
 public bool HasPendingChanges(ILocalPath targetFile)
 {
     return(false);
 }
Exemple #27
0
 public GameOutputFile(string gameName, Folders.GameEngineFolder engineFolder, ILocalPath sourceFile)
 {
     GameName   = gameName;
     EngineName = engineFolder.Name;
     SourceFile = sourceFile;
 }
Exemple #28
0
 public void CheckoutForEdit(ILocalPath localFilePath)
 {
     GetWorkspace().PendEdit(localFilePath.AsString());
 }
Exemple #29
0
 public ILocalPath ResolveDistributionPath(ILocalPath basePath)
 {
     return(basePath.Subpath(this.FileName));
 }
Exemple #30
0
 public void CheckoutForEdit(ILocalPath filePath)
 {
     File.SetAttributes(filePath.AsString(), FileAttributes.Normal);
 }