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.
It’s actually not just fine but awesome - the speedup is tremendous!
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.
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:
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.”