private void createBinaryLifecycleTask(SourceSet sourceSet, Project target) {
   Task binaryLifecycleTask = target.task(sourceSet.getClassesTaskName());
   binaryLifecycleTask.setGroup(LifecycleBasePlugin.BUILD_GROUP);
   binaryLifecycleTask.setDescription(String.format("Assembles %s.", sourceSet));
   binaryLifecycleTask.dependsOn(sourceSet.getOutput().getDirs());
   binaryLifecycleTask.dependsOn(sourceSet.getCompileJavaTaskName());
   binaryLifecycleTask.dependsOn(sourceSet.getProcessResourcesTaskName());
 }
 private void attachTasksToBinary(
     ClassDirectoryBinarySpecInternal binary, SourceSet sourceSet, Project target) {
   Task compileTask = target.getTasks().getByPath(sourceSet.getCompileJavaTaskName());
   Task resourcesTask = target.getTasks().getByPath(sourceSet.getProcessResourcesTaskName());
   Task classesTask = target.getTasks().getByPath(sourceSet.getClassesTaskName());
   binary.getTasks().add(compileTask);
   binary.getTasks().add(resourcesTask);
   binary.getTasks().add(classesTask);
   binary.setBuildTask(classesTask);
 }