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 void tagAndPush( final Project project, final BuildReleaseInitTask currentTask, final boolean forceOnBranch) { try { final BuildVCSTask vcsTask = (BuildVCSTask) new GradleInfoSource(project).getTask(BuildVCSPlugin.VCS_TASK_NAME); // // We cannot tag and push when we have no VCS. Silently fail... // if (!VCSAccess.Type.NONE.toString().toLowerCase().equals(vcsTask.getType().toLowerCase())) { final VCSTaskUtil vcsUtil = new VCSTaskUtil(project); // // Get the current release init task to obtain the branch and origin // variables // final BuildReleaseInitTask initTask = (BuildReleaseInitTask) new GradleInfoSource(project).getTask(BuildReleasePlugin.INIT_TASK_NAME); if (forceOnBranch) { // // Verify we are on the right branch to perform this task. // vcsUtil.validateWorkspaceBranchName(initTask.getReleasebranch()); } if (vcsTask.getBranchName().equals(initTask.getReleasebranch())) { // // Verify the current workspace is clean // if (currentTask.isOnlyifclean()) { vcsUtil.validateWorkspaceIsClean(); } // // Get the tag task to tag the repository // final String tagName = project.getVersion().toString(); vcsTask.createTag(tagName, "Tag created by task " + initTask.getUploadtask()); // // Push the new created tag back to origin // if (!initTask.isIgnoreorigin()) { vcsUtil.getVCS().push(tagName, initTask.getRemoteorigin(), true); } } else { project .getLogger() .info( "Workspace is not on branch '" + initTask.getReleasebranch() + "'. Build release tagging deactivated this execution of " + currentTask.getUploadtask()); } } } catch (final VCSException e) { throw new TaskExecutionException(currentTask, e); } }