private async Task <DirectoryInfo> GetProjectDirectory(string command) { if (Exists()) { var result = await CommandLine.Execute(FilePath, command, DirectoryAccessor.GetFullyQualifiedRoot()); var path = string.Join("", result.Output); if (result.ExitCode == 0 && !string.IsNullOrEmpty(path)) { var projectDirectory = new DirectoryInfo(string.Join("", result.Output)); if (projectDirectory.Exists) { return(projectDirectory); } } } return(null); }
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); }
public Task Prepare() { return(CommandLine.Execute(FilePath, MLS.PackageTool.PackageToolConstants.PreparePackage, DirectoryAccessor.GetFullyQualifiedRoot())); }
public async Task <WebAssemblyAsset> LocateWasmAsset() { var result = await CommandLine.Execute(GetFilePath(), MLS.PackageTool.PackageToolConstants.LocateWasmAsset, DirectoryAccessor.GetFullyQualifiedRoot()); var projectDirectory = new DirectoryInfo(string.Join("", result.Output)); if (!projectDirectory.Exists) { return(null); } return(new WebAssemblyAsset(new FileSystemDirectoryAccessor(projectDirectory))); }