internal static async Task<BuildResult> BuildAsync(this BuildManager buildManager, ITestOutputHelper logger, ProjectCollection projectCollection, ProjectRootElement project, string target, IDictionary<string, string> globalProperties = null, LoggerVerbosity logVerbosity = LoggerVerbosity.Detailed, ILogger[] additionalLoggers = null)
        Requires.NotNull(buildManager, nameof(buildManager));
        Requires.NotNull(projectCollection, nameof(projectCollection));
        Requires.NotNull(project, nameof(project));

        globalProperties = globalProperties ?? new Dictionary<string, string>();
        var projectInstance = new ProjectInstance(project, globalProperties, null, projectCollection);
        var brd = new BuildRequestData(projectInstance, new[] { target }, null, BuildRequestDataFlags.ProvideProjectStateAfterBuild);

        var parameters = new BuildParameters(projectCollection);

        var loggers = new List<ILogger>();
        loggers.Add(new ConsoleLogger(logVerbosity, s => logger.WriteLine(s.TrimEnd('\r', '\n')), null, null));
        parameters.Loggers = loggers.ToArray();


        var result = await buildManager.BuildAsync(brd);


        return result;
Example #2
 public static Task<ITarget> BuildAsync(this IPlan plan, ModuleName name, CancellationToken token)
     var buildTasks = plan.BuildAsync(name.Singleton(), token);
     Debug.Assert(buildTasks.Count == 1,"Expected build task dictionary for a single module to only contain a single task.");
     return buildTasks[name];
Example #3
 public static ITarget Build(this IPlan plan, ModuleName name)
     return plan.BuildAsync(name).Result;
 /// <summary>
 /// Builds (compiles) the specified job in the specified Data Lake
 /// Analytics account for job correctness and validation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.DataLake.AnalyticsJob.IJobOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the Data Lake Analytics account to build the
 /// job for
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters to build a job, which simulates submission.
 /// </param>
 /// <returns>
 /// Data Lake Analytics job information response from a build or create
 /// request.
 /// </returns>
 public static Task<JobInfoBuildOrCreateResponse> BuildAsync(this IJobOperations operations, string resourceGroupName, string accountName, JobInfoBuildOrCreateParameters parameters)
     return operations.BuildAsync(resourceGroupName, accountName, parameters, CancellationToken.None);