private void _configureRootTaskDistBundle(final Task warTask) {
    Project project = warTask.getProject();

    Copy copy =
        (Copy)
            GradleUtil.getTask(
                project.getRootProject(), RootProjectConfigurator.DIST_BUNDLE_TASK_NAME);

    copy.dependsOn(warTask);

    copy.into(
        "osgi/modules",
        new Closure<Void>(project) {

          @SuppressWarnings("unused")
          public void doCall(CopySpec copySpec) {
            Project project = warTask.getProject();

            ConfigurableFileTree configurableFileTree = project.fileTree("dist");

            configurableFileTree.builtBy(warTask);
            configurableFileTree.include("*.war");

            copySpec.from(configurableFileTree);
          }
        });
  }
  @Override
  public void apply(Project project) {
    WorkspaceExtension workspaceExtension =
        GradleUtil.getExtension((ExtensionAware) project.getGradle(), WorkspaceExtension.class);

    Task initBundleTask =
        GradleUtil.getTask(project.getRootProject(), RootProjectConfigurator.INIT_BUNDLE_TASK_NAME);

    _configureAnt(project);

    UpdatePropertiesTask updatePropertiesTask =
        _addTaskUpdateProperties(project, workspaceExtension);

    _addTaskBuild(project, updatePropertiesTask);

    Task warTask = GradleUtil.getTask(project, WarPlugin.WAR_TASK_NAME);

    _configureTaskWar(warTask, workspaceExtension, initBundleTask);

    _configureRootTaskDistBundle(warTask);
  }