Gradle 2.4-rc-1 is now available for testing

The Gradle team is pleased to announce the availability of the first release candidate for Gradle 2.4. This release contains many new features and significant performance enhancements pertinent to all builds.

Please read the release notes for more information. Downloads and wrapper usage instructions are available from gradle.org/release-candidate. Please try Gradle 2.4-rc-1 with your projects and report any problems.

1 Like

This topic is now a banner. It will appear at the top of every page until it is dismissed by the user.

Everything fine with my usual three projects.

Itā€™s actually not just fine but awesome - the speedup is tremendous! :heart_eyes:

One of the builds failed initially because of a codenarc violation that wasnā€™t reported in Gradle 2.3. It seems like it didnā€™t check the test sourcesets before but is doing so now. Either that or the codenarc rulesets changed.

This isnā€™t a problem of Gradle 2.4, though. I just wanted to mention it for the sake of completeness.

Do you know which rule violation you were seeing? CodeNarc only changed versions, so if itā€™s doing something new, weā€™d like to include that as a warning in the release notes.

No issues seen so far :slight_smile:

The ā€œNoDefā€ rule complained about our Spock specifications.
While that rule makes sense for application code itā€™s not really applicable to test code.

Our codenarc.xml looked like this:

<ruleset xmlns="http://codenarc.org/ruleset/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://codenarc.org/ruleset/1.0 http://codenarc.org/ruleset-schema.xsd" xsi:noNamespaceSchemaLocation="http://codenarc.org/ruleset-schema.xsd">
    <ruleset-ref path="rulesets/basic.xml"/>
    <ruleset-ref path="rulesets/convention.xml">
        <exclude name="CouldBeElvis"/>
    </ruleset-ref>
    <ruleset-ref path="rulesets/imports.xml">
        <exclude name="NoWildcardImports"/>
    </ruleset-ref>
    <ruleset-ref path="rulesets/naming.xml">
        <rule-config name="MethodName">
            <property name="regex" value="^[a-z][\$_a-zA-Z0-9]*$|^.*\s.*$"/>
        </rule-config>
        <exclude name="ConfusingMethodName"/>
        <exclude name="FactoryMethodName"/>
    </ruleset-ref>
    <ruleset-ref path="rulesets/logging.xml"/>
</ruleset>

We just excluded the rule in question for now:

<ruleset-ref path="rulesets/convention.xml">
    <exclude name="CouldBeElvis"/>
    <exclude name="NoDef"/>
</ruleset-ref>

We should probably use different rules for src/main and src/test in the long runā€¦

I moved 7 posts to a new topic: 2.4-rc-1 Regression: JNA path conflicts in test execution JVM

I realize it is incubating, but Iā€™ve discovered something in the configuration of my native C++ project:

Iā€™m trying to do most of the configuration in a custom plugin/script and then have the ability to tweak options in the project build.gradle file. This was working with 2.3, but with 2.4-rc-1 gradle thinks Iā€™m trying to re-declare my main library instead of just tweak some options on it.

Exception thrown while executing model rule: model.components
Cannot create ā€˜components.mainā€™ using creation rule ā€˜model.components > create(main)ā€™ as the rule ā€˜model.components > create(main)ā€™ is already registered to create this model element.

The line it is complaining about is in a method of my plugin that is used to tweak the source folders:

    public void withCppSource(def closure) {
        project.model {
            components {
                main(NativeLibrarySpec) {
                    sources {
                        cpp {
                            source closure
                        }
                    }
                }
            }
        }
    }

Iā€™m providing this utility method so my plugin keeps my main build.gradle file compatible with Gradle 2.2.1 and later versions (2.3+) where the structure of native C++ scripts has changed.

Looking closer at the release notes, I suspect this is not surprising behaviour (the notes state: ā€œUsing create syntax fails when the element already exists.ā€) . But Iā€™m not sure how to fix my code to accommodate the delayed creation and still have a utility method to configure the C++ source files. What syntax should I be using?
Everything Iā€™ve tried has failed with the message:
The following model rules are unbound:
model.main.sources.cpp
Mutable:
- main.sources.cpp (java.lang.Object)

(for main.sources, main.sources.cpp, main.sources.cpp.source ,etc.)
Which I think is related to the other note: ā€œThere are currently no query method on this interface.ā€

Have you tried just leaving off the type?

        project.model {
            components {
                main {
                    sources {
                        cpp {
                            source closure
                        }
                    }
                }
            }
        }

This topic is no longer a banner. It will no longer appear at the top of every page.

Hi,

I just wanted to point out a small mistake (spelling) in the release notes:
https://gradle.org/docs/2.4-rc-1/release-notes

Itā€™s in the code sample for the ā€œDepending on a particular Maven snapshot versionā€ section:
depenencies should actually be dependencies (missing ā€œdā€).

Many thanks. Iā€™ve made the change for the next RC or final release.