bmuschko/gradle-cargo-plugin — pull request #42 by seanjreilly (2013-05-09 14:06:09+00:00)
Title: Deprecation warnings in gradle 1.6

When running a build script that includes the cargo plugin in gradle 1.6, the following errors are emitted every time the build script is evaluated:

>The ConfigurationContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.

>The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.

This happens when the plugin is configured, and so the warnings show up even if you're not doing anything with cargo, which is annoying.

This pull request fixes the problem by calling the suggested replacement methods instead, if they exist. If the replacement methods don't exist, then the originals are called. This allows the plugin to work properly in multiple versions of gradle (I tested with 1.4, 1.5, and 1.6).