Clone Tools
  • last updated a few seconds ago
Constraints: committers
Constraints: files
Constraints: dates
Renamed src/main/groovy to src/main/java in core

    • -35
    • +0
    • -69
    • +0
  1. … 2531 more files in changeset.
Replace usage of `String#format` with good old string concatenation

The rationale behind this change is that while `String#format` is usually admitted as good for readability (this is arguable),

in practice it is very bad for performance. Since Java 6, the JVM (the JIT, to be correct) does a pretty good job at optimizing

string concatenation. However, it is only capable to do so if we're using "dirty" string concatenations (using `+`), or `StringBuilder`.

However, usage of `StringBuilder` is not recommended either for 2 reasons:

1. it significantly decreases code readability

2. in Java 9, String concatenation is even more optimized thanks to `invokedynamic`, and code using `StringBuilder` will *not* benefit

from this optimization.

There are sill leftover `String#format` calls in the code, in the following cases:

- the call is used to generate an exception message. That's 90% of the remaining calls.

- the call is obviously a debug message, often used in `toString` (because as we all know, `toString` should only be used for debugging)

- the format includes specific number formatting patterns

- I missed it

    • -2
    • +2
    • -1
    • +1
  1. … 224 more files in changeset.
Convert `AntBuilderDelegate` to Java

    • -86
    • +0
    • -0
    • +124
Convert `ProjectScript` to Java

This should only be called with a Project as `scriptTarget`, so casting

like that should be fine.

    • -0
    • +65
Clean up of ant logging adapter

+review REVIEW-5912

  1. … 1 more file in changeset.
Moved classes related to dispatching property and method requests to live in their own package.

  1. … 48 more files in changeset.
Improve property and method lookup from some configuration closures, by short-circuiting the inefficient lookup in `Closure` and reusing the lookup in `ConfigureDelegate` instead.

Currently this improvement is applied only in a few places in the DSL, in particular when configuring any named container (but not its elements). A later change will roll this out more widely.

This change also removed duplicate property and method lookup on the owner object for these closures, improves error reporting on missing property or method so that the actual target of the configure closure is reported, and also cleans up the closure parameter and closure.delegate objects that are visible to the closure body so that they are always the target object.

    • -4
    • +4
  1. … 13 more files in changeset.
Cache AbstractProject.getBuildDir()

Remove `ModelReference` interning

- interning, while reducing memory usage, also has a clear impact on performance of task creation

- task creation is now 5% faster

- compensates some of memory usage increase by optimizing model creation

+review REVIEW-5852

  1. … 10 more files in changeset.
Include `Project` type in missing property error messages for project objects.

  1. … 1 more file in changeset.
Include the declared type of a task in missing property error messages for tasks.

  1. … 3 more files in changeset.
Cache generated group name in AbstractProject.getGroup

First stab at allowing Ant task output to be captured.

+review REVIEW-5912

    • -0
    • +22
    • -0
    • +24
  1. … 7 more files in changeset.
Merge branch 'release'

  1. … 3 more files in changeset.
Add delete(Action<? super DeleteSpec>) to Project

+review REVIEW-5852

- Adds a DeleteSpec

- Deprecates and removes references to DeleteAction

- Moves DeleteActionImpl to Deleter

- Updates tests

  1. … 16 more files in changeset.
Moved `canonicalize()` method from `GFileUtils` to `FileUtils`.

GFileUtils requires Ant and its dependencies. Moving the method to a better home breaks this dependency for clients of the method.

    • -1
    • +2
    • -1
    • +2
  1. … 23 more files in changeset.
Moved internal logging classes from 'core' to 'logging' project.

  1. … 416 more files in changeset.
Moved the public logging API classes from `core` to new `logging` project.

    • -4
    • +9
  1. … 23 more files in changeset.
GRADLE-3414 JavaBean spec compliant task input property names parsing

Let's start with how Gradle behave before this commit.

Given the following build script:


class MyTask extends DefaultTask {

private String flags


public String getCFlags() {



public void setCFlags(String flags) {

this.flags = flags



task('something', type: MyTask) {}


A simple task with an `@Input` property declared using a getter and a

corresponding setter.

Running `gradle something` rightly shows an error message about the

missing non-optional input:


> No value has been specified for property 'cFlags'.


So, let's do what Gradle says:


task('something', type: MyTask) {

cFlags = "anything"



But then `gradle something` shows the following error:


> No such property: cFlags for class: MyTask_Decorated

Possible solutions: CFlags, class


According to the JavaBean spec, the property name should be `CFlags`,

not `cFlags`. Groovy respect the spec, we have a mismatch.

The issue is the same with a bunch of the JavaBeans spec corner cases

like e.g. `getURL()` or `getcCompiler()`. It boils down to using

`java.beans.Introspector.decapitalize()` instead of


We fixed the same issue in the software model in 2.11.

All in all, this commit fix the validation error messages. It may break

builds that use `task.getInputs().getProperties().get("...")` and rely

on wrong property names.

+review REVIEW-5878

    • -2
    • +2
  1. … 2 more files in changeset.
Ignore bridge methods in task annotationprocessing

Getters in tasks that result in additional bridge methods have been handled twice by the AnnotationProcessingTaskFactory

This could ultimately result in excessive input/output evaluation as tasks had duplicate reference to output, input properties

With this change we should have less directory scanning in builds. Especially the duplicate scanning of `build/test-results`

and `build/reports/tests` has been removed which should result in faster test task execution and also faster processing of

up-to-date `Test` tasks.

    • -1
    • +1
  1. … 1 more file in changeset.
[#578] Add Project.findProperty method

A convenient to deal with properties which could be not set.

Without that hasProperty has to be used as a guard check.

  1. … 2 more files in changeset.
Promote some instance constants to class constants

The `Validator` class should be static, and carries too much context with it: the outer task factory class is kept, resulting in unnecessary memory usage. Same for some class constants, that were declared as instance constants: all the anonymous inner class retained a reference to `AnnotationProcessingTaskFactory`. Having non static members also prevents the JIT from being agressive about inlining or unrolling loops.

    • -15
    • +14
Made `SourceDirectorySetFactory` available as service that can be used by rules.

  1. … 3 more files in changeset.
Added `Instantiator` as a service and inject it directly into a bunch of rules, rather than using a `ServiceRegistry` to look up an `Instantiator`.

  1. … 4 more files in changeset.
Apply abstract modifier to classes consistently

Prior to this commit, a minority of clases positioned the `abstract`

modifier before the `public` visibility modifier:

{ git grep -h '^abstract public'; git grep -h '^public abstract'; } \

| cut -d' ' -f1-3 | sort | uniq -c

25 abstract public class

232 public abstract class

This commit normalizes this usage with the following command:

git grep -l '^abstract public' \

| xargs perl -p -i -e 's/^abstract public/public abstract/'

Resulting in the following homogeny:

{ git grep -h '^abstract public'; git grep -h '^public abstract'; } \

| cut -d' ' -f1-3 | sort | uniq -c

257 public abstract class

  1. … 24 more files in changeset.
Expose struct bindings store to node initializer registry

+review REVIEW-5761

  1. … 4 more files in changeset.
Apply rules to links via predicates

Extends the filtering options when applying rules to the children of a

node by allowing evaluating child nodes via a Predicate (instead of

matching them against a single type).

+review REVIEW-5738

  1. … 24 more files in changeset.
Rework how nodes are discovered in scope, add `@Hidden` annotation

There’s an issue with closing scopes (most importantly the <root>

scope) too early when rules reference their inputs by type. In such a

case we need to force the discovery of all children of the scope node

in order to find a node that can be viewed as the given type.

Closing the scope, though (especially when it’s the <root> scope) means

that rules applied later will not be able to create further nodes in

the scope (since it is already in SelfClosed).

To avoid having to close the scope, we can try to discover the children

that are already registered first, and only close the node if a node is

not already registered. This is exactly what we did previously.

However, if discovering such a node require inputs to be closed, a

cascade effect can still start. This change tries avoid this situation

further by first discovering only the children of the scope that can be

discovered without having to close any other nodes. If the a node

viewable as the requested type can be found among these (now

discovered) children, we don’t need to explore the scope any further.

These children can be called ‘self-discovering’. The vast majority of

nodes (except for managed model elements created via @Model currently,

and extensible nodes like BinarySpec) are self-discovering.

Previously we had the @Service annotation to do something similar to

self-discovery, but in an explicit way. @Service marked a @Meodel

element to be pushed to Discovered upon registration. The problem with

this is we already started executing rules before all the rules could

have been extracted from RuleSources and the model DSL, which could

lead to nodes being closed prematurely. This change surpasses the need

for the @Service annotation, and fixes the early execution of rules.

Nodes don’t need to be pushed to Discovered upon registration anymore,

as they are discovered only as needed.

A new @Hidden annotation was also introduced in order to take over the

second role of @Service. This annotation should probably be moved into

the public API eventually.

+review REVIEW-5735

  1. … 17 more files in changeset.
Introduces first elements of work for JVM test execution in the Java software model

* Add a new `testing-jvm` subproject that contains classes relative to testing support in the JVM model

* Introduces a `JUnitTestSuitePlugin` that brings a new component type: JUnitTestSuiteSpec

* Extract a `BaseJvmBinarySpec` for common configuration of JVM libraries and test suites

* Separate configuration of `JvmBinarySpec` from specific bits of `JarBinarySpec`

* Some integration tests to make sure at this point we can compile a test suite (but not execute it)

Story: gradle/langos#103

  1. … 19 more files in changeset.
Do not inject ServiceRegistry in State * remove ServiceRegistry from State implementation * make TypeConverter a service found in ModelRegistry * use constructor injection for TypeConverter in ManagedProxyClassGenerator * propagate TypeConverter do proxy instantiation

+review REVIEW-5672

  1. … 11 more files in changeset.