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.
The āNoDefā rule complained about our Spock specifications.
While that rule makes sense for application code itās not really applicable to test code.
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.ā
Itās in the code sample for the āDepending on a particular Maven snapshot versionā section: depenencies should actually be dependencies (missing ādā).