Gradle 2.5-rc-1: Unable to resolve class ModuleDependencySubstitution

A script that worked under 2.4 fails under 2.5-rc-1:

resolutionStrategy.dependencySubstitution.eachModule { ModuleDependencySubstitution details ->

fails with:

    Could not compile script '/Users/rsivan/pv/pvtrunk/Src/Config/external-dependencies.gradle'.
> startup failed:
  script '/Users/rsivan/pv/pvtrunk/Src/Config/external-dependencies.gradle': 631: unable to resolve class ModuleDependencySubstitution 
   @ line 631, column 47.
     ndencySubstitution.eachModule { ModuleDe
                                   ^

1 error

dependencySubstitution was added in 2.5 and was not part of 2.4 I think. Check the documentation at https://docs.gradle.org/2.5-rc-1/release-notes#dependency-substitution-rules to see how substitution rules work in 2.5

Actually DependencySubstitution is available in 2.4, but some classes changed in 2.5 and that breaks your old script when moving to 2.5.
Perhaps this should be documented as an incompatible change.