@Test public void compileJavaccDependOnCompileJJTreeWhenInputDirectoryNotEmpty() { applyJavaPluginToProject(); applyJavaccPluginToProject(); JavaToJavaccDependencyAction action = new JavaToJavaccDependencyAction(); final File inputDirectory = new File(getClass().getResource("/jjtree/input").getFile()); CompileJjtreeTask compileJjtreeTask = (CompileJjtreeTask) project.getTasks().findByName(CompileJjtreeTask.TASK_NAME_VALUE); compileJjtreeTask.setInputDirectory(inputDirectory); action.execute(project); TaskCollection<CompileJavaccTask> compileJavaccTasks = project.getTasks().withType(CompileJavaccTask.class); for (CompileJavaccTask task : compileJavaccTasks) { Set<Object> dependencies = task.getDependsOn(); assertTrue(dependencies.contains(project.getTasks().findByName(CompileJjtreeTask.TASK_NAME_VALUE))); } }
@Override public void execute(Project project) { if (!project.getPlugins().hasPlugin("java")) { return; } configureCompileJJTreeTask(project); configureCompileJavaccTask(project); }
JavaToJavaccDependencyAction implements Action<Project> { @Override public void execute(Project project) { if (!project.getPlugins().hasPlugin("java")) { return; } configureCompileJJTreeTask(project); configureCompileJavaccTask(project); } }
JavaToJavaccDependencyAction implements Action<Project> { @Override public void execute(Project project) { if (!project.getPlugins().hasPlugin("java")) { return; } configureCompileJJTreeTask(project); configureCompileJavaccTask(project); }  }
JavaToJavaccDependencyAction implements Action<Project> { @Override public void execute(Project project) { if (!project.getPlugins().hasPlugin("java")) { return; } configureCompileJJTreeTask(project); configureCompileJavaccTask(project); }  @Override void execute(Project project); }
JavaToJavaccDependencyAction implements Action<Project> { @Override public void execute(Project project) { if (!project.getPlugins().hasPlugin("java")) { return; } configureCompileJJTreeTask(project); configureCompileJavaccTask(project); }  @Override void execute(Project project);  }