public TaskRunnerConfig( ITaskRunnerCommandContext context, IEnumerable <ITaskRunnerNode> nodes, ImageSource icon, string temporaryDirectory) { Context = context; Icon = icon; TaskHierarchy = new TaskRunnerNode("NUKE_ROOT"); TaskHierarchy.Children.AddRange(nodes); if (Directory.Exists(temporaryDirectory)) { _watcher = new FileSystemWatcher(temporaryDirectory, "visual-studio-debug.log") { EnableRaisingEvents = true }; _watcher.Changed += (s, e) => { ThreadHelper.JoinableTaskFactory.Run(async() => { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); AttachToBuild(e.FullPath); }); }; } }
public async Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { return(await Task.Run(async() => { ITaskRunnerNode hierarchy = await TryLoadHierarchy(configPath); return new GulpTaskRunnerConfig(hierarchy); })); }
public override Task <ITaskRunnerCommandResult> Invoke(ITaskRunnerCommandContext context) { Task <ITaskRunnerCommandResult> result = base.Invoke(context); result.ContinueWith(_continueWith); return(result); }
public override Task<ITaskRunnerCommandResult> Invoke(ITaskRunnerCommandContext context) { // if the CLI is Yarn and the Verbose option is enabled, set the verbose option correctly if (!_isNpm && this.Command.Options?.Trim() == Constants.NPM_VERBOSE_OPTION) this.Command.Options = this.Command.Options.Replace(Constants.NPM_VERBOSE_OPTION, Constants.YARN_VERBOSE_OPTION).Trim(); return base.Invoke(context); }
/// <summary> /// Parses a configuration file into ITaskRunnerConfig /// </summary> /// <param name="configPath"></param> /// <param name="taskRunnerOptions"></param> /// <param name="environmentPath"></param> /// <param name="projectItem"></param> /// <returns></returns> public async Task<ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { //Custom await Geoffrey.EnsureInitialized(context); ITaskRunnerNode hierarchy = LoadHierarchy(configPath); //Common return new TaskRunnerConfig<PowershellBindingsPersister>(context, hierarchy, _icon); }
public async Task<ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { return await Task.Run(() => { ITaskRunnerNode hierarchy = LoadHierarchy(configPath); return new TaskRunnerConfig(context, hierarchy, _icon); }); }
public async Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { return(await Task.Run(() => { ITaskRunnerNode hierarchy = LoadHierarchy(configPath); return new TaskRunnerConfig(context, hierarchy, _icon); })); }
/// <summary> /// Parses a configuration file into ITaskRunnerConfig /// </summary> /// <param name="configPath"></param> /// <param name="taskRunnerOptions"></param> /// <param name="environmentPath"></param> /// <param name="projectItem"></param> /// <returns></returns> public async Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { //Custom await Geoffrey.EnsureInitialized(context); ITaskRunnerNode hierarchy = LoadHierarchy(configPath); //Common return(new TaskRunnerConfig <PowershellBindingsPersister>(context, hierarchy, _icon)); }
public override Task <ITaskRunnerCommandResult> Invoke(ITaskRunnerCommandContext context) { // if the CLI is Yarn and the Verbose option is enabled, set the verbose option correctly if (!_isNpm && this.Command.Options?.Trim() == Constants.NPM_VERBOSE_OPTION) { this.Command.Options = this.Command.Options.Replace(Constants.NPM_VERBOSE_OPTION, Constants.YARN_VERBOSE_OPTION).Trim(); } return(base.Invoke(context)); }
public async Task<ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { ITaskRunnerNode hierarchy = LoadHierarchy(configPath); if (!hierarchy.Children.Any() || !hierarchy.Children.First().Children.Any()) return null; return await Task.Run(() => { return new TaskRunnerConfig(context, hierarchy, _icon); }); }
public async Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { try { return(await Task.Run(() => { TaskRunnerLogger.WriteLine("TestTaskRunnerProvider.ParseConfig configPath={0}", configPath); ITaskRunnerNode hierarchy = LoadHierarchy(configPath); return new TaskRunnerConfig(hierarchy); })); } catch (Exception ex) { TaskRunnerLogger.WriteLine("Load failed. {0}", ex.Message); return(CreateErrorTaskRunnerConfig(ex)); } }
public async Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { return(await Task.Run(() => { ITaskRunnerNode hierarchy = LoadHierarchy(configPath); if (!hierarchy.Children.Any() && !hierarchy.Children.First().Children.Any()) { return null; } return new TaskRunnerConfig(this, context, hierarchy, _icon); })); }
public async Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { return(await Task.Run(() => { if (!BundlerMinifierPackage.Options.EnableTaskRunnerExplorer) { return null; } ITaskRunnerNode hierarchy = LoadHierarchy(configPath); return new TaskRunnerConfig(context, hierarchy, _icon); })); }
public async Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { return(await Task.Run(() => { var userPathConfig = configPath.Replace(Constants.FILENAME, Constants.USERFILENAME); ITaskRunnerNode hierarchy = LoadHierarchy(configPath, userPathConfig); if (!hierarchy.Children.Any() && !hierarchy.Children.First().Children.Any()) { return null; } return new TaskRunnerConfig(hierarchy, _icon); })); }
public async Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { var rootDirectory = Path.GetDirectoryName(configPath); var temporaryDirectory = Path.Combine(rootDirectory, ".tmp"); return(await Task.Run(() => { while (NukePackage.Dte == null) { System.Threading.Thread.Sleep(50); } return new TaskRunnerConfig( context, CreateNodes(rootDirectory, temporaryDirectory), _icon, temporaryDirectory); })); }
public static async Task EnsureInitialized(ITaskRunnerCommandContext context) { TaskCompletionSource <bool> tcs = new TaskCompletionSource <bool>(); Task existing = Interlocked.CompareExchange(ref _initTask, tcs.Task, null); //If we own the initialization... if (existing == null) { _ps = PowerShell.Create(); _ps.AddScript("Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted –Force"); _ps.Invoke(); _ps.Commands.Clear(); string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); ModulePath = Path.Combine(localAppData, "Ligershark\\tools\\geoffrey-pre\\geoffrey.psm1"); // you can override the location of the PSModule with this env var string modulePathEnv = Environment.GetEnvironmentVariable("GeoffreyPsModulePath"); if (!string.IsNullOrWhiteSpace(modulePathEnv) && File.Exists(modulePathEnv)) { ModulePath = modulePathEnv; } //If we don't already have geoffrey installed, install it if (!File.Exists(ModulePath)) { await InstallGeoffreyAsync(); } _ps.Commands.Clear(); Command importModule = new Command("Import-Module"); importModule.Parameters.Add("Name", ModulePath); _ps.Commands.AddCommand(importModule); _ps.Invoke(); tcs.SetResult(true); return; } await existing; }
public static async Task EnsureInitialized(ITaskRunnerCommandContext context) { TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(); Task existing = Interlocked.CompareExchange(ref _initTask, tcs.Task, null); //If we own the initialization... if (existing == null) { _ps = PowerShell.Create(); _ps.AddScript("Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted –Force"); _ps.Invoke(); _ps.Commands.Clear(); string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); ModulePath = Path.Combine(localAppData, "Ligershark\\tools\\geoffrey-pre\\geoffrey.psm1"); // you can override the location of the PSModule with this env var string modulePathEnv = Environment.GetEnvironmentVariable("GeoffreyPsModulePath"); if (!string.IsNullOrWhiteSpace(modulePathEnv) && File.Exists(modulePathEnv)) { ModulePath = modulePathEnv; } //If we don't already have geoffrey installed, install it if (!File.Exists(ModulePath)) { await InstallGeoffreyAsync(); } _ps.Commands.Clear(); Command importModule = new Command("Import-Module"); importModule.Parameters.Add("Name", ModulePath); _ps.Commands.AddCommand(importModule); _ps.Invoke(); tcs.SetResult(true); return; } await existing; }
public Task <ITaskRunnerConfig> ParseConfig(ITaskRunnerCommandContext context, string configPath) { var rootDir = Path.GetDirectoryName(configPath); var rootNode = new TaskRunnerNode("VSIX Manifest"); var ipConfigNode = new TaskRunnerNode("IPConfig", true) { Command = new TaskRunnerCommand(rootDir, "ipconfig", "all") }; rootNode.Children.Add(ipConfigNode); var traceNode = new TaskRunnerNode("Trace Route", true) { Command = new TaskRunnerCommand(rootDir, "tracert", "visualstudio.com") }; rootNode.Children.Add(traceNode); var config = new ManifestTaskRunnerConfig(rootNode); return(Task.FromResult <ITaskRunnerConfig>(config)); }
public TaskRunnerConfig(ITaskRunnerCommandContext context, ITaskRunnerNode hierarchy, ImageSource icon) { _context = context; TaskHierarchy = hierarchy; Icon = icon; }
public virtual Task <ITaskRunnerCommandResult> Invoke(ITaskRunnerCommandContext context) { return(context.ExecutionService.ExecuteCommand(Command)); }
protected TaskRunnerConfigBase(ITaskRunnerCommandContext context, ITaskRunnerNode hierarchy) { TaskHierarchy = hierarchy; _context = context; }
public TaskRunnerConfig(TaskRunnerProvider provider, ITaskRunnerCommandContext context, ITaskRunnerNode hierarchy, ImageSource rootNodeIcon) : this(provider, context, hierarchy) { _rootNodeIcon = rootNodeIcon; }
protected TaskRunnerConfigBase(TaskRunnerProvider provider, ITaskRunnerCommandContext context, ITaskRunnerNode hierarchy) { _bindingsPersister = new BindingsPersister(provider); TaskHierarchy = hierarchy; _context = context; }
public TaskRunnerConfig(ITaskRunnerCommandContext context, ITaskRunnerNode hierarchy) : base(context, hierarchy) { }
public TaskRunnerConfig(TaskRunnerProvider provider, ITaskRunnerCommandContext context, ITaskRunnerNode hierarchy) : base(provider, context, hierarchy) { }
public TaskRunnerConfig(ITaskRunnerCommandContext context, ITaskRunnerNode hierarchy, ImageSource icon) { _context = context; _hierarchy = hierarchy; _icon = icon; }
public TaskRunnerConfig(ITaskRunnerCommandContext context, ITaskRunnerNode hierarchy, ImageSource rootNodeIcon) : this(context, hierarchy) { _rootNodeIcon = rootNodeIcon; }