Use Gradle's task configuration avoidance APIs

This can avoid creating an additional 736 tasks (previously 502 out of
1591 were not created). That's not all that important as the build time
is essentially the same, but this lets us see the poor behavior of the
protobuf plugin in our own project and increase our understanding of how
to avoid task creation when developing the plugin. Of the tasks still
being created, protobuf is the highest contributor with 165 tasks,
followed by maven-publish with 76 and appengine with 53. The remaining
59 are from our own build, but indirectly caused by maven-publish.
diff --git a/all/build.gradle b/all/build.gradle
index ede0b03..08a3e32 100644
--- a/all/build.gradle
+++ b/all/build.gradle
@@ -36,7 +36,7 @@
     api subprojects.minus([project(':grpc-protobuf-lite')])
 }
 
-javadoc {
+tasks.named("javadoc").configure {
     classpath = files(subprojects.collect { subproject ->
         subproject.javadoc.classpath
     })
@@ -49,7 +49,7 @@
     }
 }
 
-task jacocoMerge(type: JacocoMerge) {
+tasks.register("jacocoMerge", JacocoMerge) {
     dependsOn(subprojects.jacocoTestReport.dependsOn)
     dependsOn(project(':grpc-interop-testing').jacocoTestReport.dependsOn)
     mustRunAfter(subprojects.jacocoTestReport.mustRunAfter)
@@ -60,7 +60,7 @@
             .filter { f -> f.exists() }
 }
 
-jacocoTestReport {
+tasks.named("jacocoTestReport").configure {
     dependsOn(jacocoMerge)
     reports {
         xml.required = true
@@ -78,4 +78,4 @@
     sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
 }
 
-tasks.coveralls { dependsOn(jacocoTestReport) }
+tasks.named("coveralls").configure { dependsOn tasks.named("jacocoTestReport") }