Пример #1
0
        public ProjectAsset(IDirectoryAccessor directoryAccessor, string csprojFileName = null) : base(directoryAccessor)
        {
            if (directoryAccessor == null)
            {
                throw new ArgumentNullException(nameof(directoryAccessor));
            }

            if (string.IsNullOrWhiteSpace(csprojFileName))
            {
                var firstProject = DirectoryAccessor.GetAllFiles().Single(f => f.Extension == ".csproj");
                _projectFile = DirectoryAccessor.GetFullyQualifiedFilePath(firstProject.FileName);
            }
            else
            {
                _projectFile = DirectoryAccessor.GetFullyQualifiedFilePath(csprojFileName);
            }

            Directory = DirectoryAccessor.GetFullyQualifiedRoot();
            Name      = _projectFile?.Name ?? Directory?.Name;
            _lastBuildErrorLogFile = directoryAccessor.GetFullyQualifiedFilePath(".trydotnet-builderror");
            _cleanupStep           = new PipelineStep <AnalyzerResult>(LoadResultOrCleanAsync);
            _projectBuildStep      = _cleanupStep.Then(BuildProjectAsync);
            _workspaceStep         = _projectBuildStep.Then(BuildWorkspaceAsync);
        }
Пример #2
0
 private string GetFilePath()
 {
     return(DirectoryAccessor.GetFullyQualifiedFilePath(Name.ExecutableName()).FullName);
 }