Clone
 

lucas smaira <lsmaira@google.com> in Gradle

Improve PhasedBuildActionExecuter documentation

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Rename phasedAction() to action()

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Remove projectsEvaluated hook from PhasedActions

And modify projectsLoaded hook to be run after configuration, making

sure that requested models are available.

For now, projects are configurated completely before running the

projectsLoaded action, however we can try to avoid unnecessary

configuration in the future without modifying public APIs.

Signed-off-by: Lucas Smaira <lsmaira@google.com>

  1. … 5 more files in changeset.
Make phased actions run tasks only when defined

With this commit, in order to specify if a PhasedAction should run tasks

or just configure the build, the API forTasks is used: when tasks are

defined (or an empty collection is given), Gradle will run tasks,

otherwise only configure the build.

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Fix documentation of PhasedBuildActionExecuter

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Handle BA failures in phased action runner

Move exception handling in case of failures in BuildActions from

ProviderConnection to ClientProvidedPhasedActionRunner.

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Change exception handling when phased action fails

Exceptions in BuildActions of a PhasedAction are now immediately thrown

and the build imediatelly fails. This makes sure that if an action fails

the remaining steps of the build will not uselessly be executed.

Exceptions are unwrapped in ProviderConnection so the correct

information is sent back to the TAPI client.

This commit also addresses other review comments in the PR:

- Removes unnecessary @since annotations in methods

- Adds a test (ignored for now) making sure that default tasks are not

run when no tasks are specified by the user

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Change target version from 4.7 to 4.8

Changing all uses of 4.7 in documentation and code.

Signed-off-by: Lucas Smaira <lsmaira@google.com>

  1. … 20 more files in changeset.
Code and documentation ajustments to PR

This commit:

- Renames methods in PhasedBuildActionExecuter and corresponding uses

- Improves public java docs making them more precise

- Replaces mocks by stubs in unit tests when possible

- Makes action's handlers in phased actions not receiving failures (they

are send to build results)

Signed-off-by: Lucas Smaira <lsmaira@google.com>

  1. … 24 more files in changeset.
Modify expected tooling api jar size

In DistributionIntegrationSpec

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Remove bad import

In PhasedBuildActionCrossVersionSpec.

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Add @Incubating and @since annotations

To MultipleBuildActionsException.

Signed-off-by: Lucas Smaira <lsmaira@google.com>

Introduce support for running phased actions

This commit introduces the ability of running multiple build actions in

different phases of the build. These actions are passed by the client

through the tooling api.

With this commit, a single action can be added to each one of the

supporting phases (after projects are loaded, after projects are

evaluated and after tasks are run).

This feature allows improvements like running actions that call a model

builder modifying the graph tasks, and then it is possible to first

fetch a model and then execute tasks, in this order. e.g. Android Studio

sync + source generation.

Signed-off-by: Lucas Smaira <lsmaira@google.com>

  1. … 40 more files in changeset.
Improve error messages for ToolingParameterProxy

ToolingParameterProxy#isValid is replaced by #validateParameter which instead

of returning a boolean indicating if the given Class<?> is a valid parameter

type, it throws an error with a precise description message if not valid.

Change version of parameterized models to 4.4

This commit modifies all the java docs and concerned files in previous

commits in this pull request.

  1. … 18 more files in changeset.
Parameter connection related code simplification

Renamings and code simplifications suggested in the pull request.

No functionality changed.

    • -164
    • +0
    /design-docs/tooling-api-parameterized-custom-models.md
Change version of parameterized models to 4.3

This commit modifies all the java docs and concerned files in previous

commits.

  1. … 18 more files in changeset.
Code clean up for parameterized models

Refactorings and code clean up folloiwing commit "Introduce creation of

parameterized tooling models"

  1. … 12 more files in changeset.
Introduce creation of parameterized tooling models

This commit introduces the possibility of passing parameters through the

Tooling API to the model builders in order to create models based on

information received by the client.

This feature allows plugins to register a model builder for a given

model and parameter and then build models based on the received

parameter. It is preferable to passing gradle properties for two

reasons: first convenience and second because parameters can be created

inside the BuildAction.

A new interface ToolingParameterizedModelBuilder was created and should

be extended by parameterized builders. New methods were added to the

BuildController in order to build models with parameters. In order to

keep cross version compatibility, new protocol interfaces were created.

    • -0
    • +164
    /design-docs/tooling-api-parameterized-custom-models.md
  1. … 24 more files in changeset.
Change error message for forTasks() methods

A more accurate message is shown to the developper when Gradle version

does not support calls to methods BuildActionExecuter.forTasks().

Throw Exception when can't run tasks before action

An UnsupportedVersionException is thrown when forTasks() method of

BuildActionExecuter is used and Gradle version doesn't support running

tasks before executing action.

Allow running tasks before executing BuildAction

Introduce methods forTasks in tooling API's BuildActionExecuter so the

user is able to run tasks before having his BuildAction executed, in the

same connection.

This feature is useful in Android development for determining a list of

APK slipts (running some tasks) and return a model with them afterwards

so the IDE can configure the project.

    • -0
    • +28
    /design-docs/tooling-api-improvements.md