@Override
  protected void addPortalToolDependencies(Project project) {
    super.addPortalToolDependencies(project);

    GradleUtil.addDependency(
        project, getPortalToolConfigurationName(), "org.apache.ant", "ant", "1.9.4");
  }
  protected void addDependenciesJspC(Project project) {
    ConfigurableFileCollection configurableFileCollection =
        project.files(getUnzippedJarDir(project));

    configurableFileCollection.builtBy(UNZIP_JAR_TASK_NAME);

    GradleUtil.addDependency(project, JspCPlugin.CONFIGURATION_NAME, configurableFileCollection);
  }
  public BasePortalToolsTask() {
    project = getProject();

    Configuration configuration = GradleUtil.addConfiguration(project, getConfigurationName());

    configuration.setDescription("Configures the " + getToolName() + " tool for this project.");
    configuration.setVisible(false);

    GradleUtil.executeIfEmpty(
        configuration,
        new Action<Configuration>() {

          @Override
          public void execute(Configuration configuration) {
            addDependencies();
          }
        });
  }
  public int getJmxRemotePort() {
    Integer jmxRemotePort = GradleUtil.toInteger(_jmxRemotePort);

    if (jmxRemotePort != null) {
      return jmxRemotePort;
    }

    return 0;
  }
  protected void configureTaskCompileJSP(Project project) {
    boolean jspPrecompileEnabled =
        GradleUtil.getProperty(project, JSP_PRECOMPILE_ENABLED_PROPERTY_NAME, false);

    if (!jspPrecompileEnabled) {
      return;
    }

    JavaCompile javaCompile =
        (JavaCompile) GradleUtil.getTask(project, JspCPlugin.COMPILE_JSP_TASK_NAME);

    String dirName = _osgiHelper.getBundleSymbolicName(project) + "-" + project.getVersion();

    LiferayExtension liferayExtension = GradleUtil.getExtension(project, LiferayExtension.class);

    File dir = new File(liferayExtension.getLiferayHome(), "work/" + dirName);

    javaCompile.setDestinationDir(dir);
  }
  protected Task addTaskUnzipJar(final Project project) {
    Task task = project.task(UNZIP_JAR_TASK_NAME);

    final Jar jar = (Jar) GradleUtil.getTask(project, JavaPlugin.JAR_TASK_NAME);

    task.dependsOn(jar);

    task.doLast(
        new Action<Task>() {

          @Override
          public void execute(Task task) {
            Project project = task.getProject();

            FileUtil.unzip(project, jar.getArchivePath(), getUnzippedJarDir(project));
          }
        });

    return task;
  }
  protected void configureTaskGenerateJSPJava(final Project project) {
    CompileJSPTask compileJSPTask =
        (CompileJSPTask) GradleUtil.getTask(project, JspCPlugin.GENERATE_JSP_JAVA_TASK_NAME);

    compileJSPTask.setWebAppDir(
        new Callable<File>() {

          @Override
          public File call() throws Exception {
            File unzippedJarDir = getUnzippedJarDir(project);

            File resourcesDir = new File(unzippedJarDir, "META-INF/resources");

            if (resourcesDir.exists()) {
              return resourcesDir;
            }

            return unzippedJarDir;
          }
        });
  }
 public BuildThumbnailsTask() {
   GradleUtil.setProperty(this, LiferayOSGiPlugin.AUTO_CLEAN_PROPERTY_NAME, false);
 }
 @Override
 public FileCollection getClasspath() {
   return GradleUtil.getConfiguration(project, getConfigurationName());
 }
  protected void addDependency(String group, String name, String version, boolean transitive) {

    GradleUtil.addDependency(project, getConfigurationName(), group, name, version, transitive);
  }