Esempio n. 1
0
            public TaskDefinition(BuildTask task, PSWithReturnValueToken varToken)
            {
                this.task = task;
                scriptUseToken = asNodeWithOptions(varToken);
                task.SetParameterValue("Capture", scriptUseToken["Capture"]);

                var kvSerializer = (KeyValueSerializer)scriptUseToken.Where(kv => kv.Key != "Capture")
                .ToDictionary(kv => kv.Key, kv => kv.Value);
                if (!string.IsNullOrEmpty(kvSerializer.ToString()))
                  task.SetParameterValue("CommandParameters", kvSerializer.ToString());

                task.SetParameterValue("ReturnValueType", varToken.ValueType.ToString());
                if (varToken.ValueType.Equals(PSScriptReturnValueType.ItemGroup))
                  task.AddOutputItem("ScriptItemOutput", varToken.VariableName);
                if (varToken.ValueType.Equals(PSScriptReturnValueType.Property))
                  task.AddOutputProperty("ScriptPropOutput", varToken.VariableName);
            }
Esempio n. 2
0
 public void Visit(PSWithReturnValueToken token)
 {
     if (currentTarget == null)
     throw new InvalidOperationException("Unexpected PS value assignment outside of a target");
       ScriptJanitor.AddScriptTask(currentTarget.AddNewTask("RunScript"), token);
 }
Esempio n. 3
0
 public void AddScriptTask(BuildTask task, PSWithReturnValueToken variableToken)
 {
     tasks.Add(new TaskDefinition(task,variableToken));
 }
Esempio n. 4
0
 public void Visit(PSWithReturnValueToken token)
 {
     VisitedPSWithReturnValueToken++;
       TotalCount++;
       Tokens.Add(token);
 }