@Test public void generatedJavaccFilesFromCompileJJTreeAreAddedToCompileJavaccSourceSet() { applyJavaccPluginToProject(); applyJavaPluginToProject(); JavaToJavaccDependencyAction action = new JavaToJavaccDependencyAction(); final File inputDirectory = new File(getClass().getResource("/jjtree/input").getFile()); final File outputDirectory = new File(getClass().getResource("/jjtree/testgenerated").getFile()); CompileJjtreeTask compileJjtreeTask = (CompileJjtreeTask) project.getTasks().findByName(CompileJjtreeTask.TASK_NAME_VALUE); compileJjtreeTask.setInputDirectory(inputDirectory); compileJjtreeTask.setOutputDirectory(outputDirectory); action.execute(project); TaskCollection<JavaCompile> javaCompilationTasks = project.getTasks().withType(JavaCompile.class); for (JavaCompile task : javaCompilationTasks) { assertTrue(task.getSource().contains(new File(outputDirectory, "someSourceFile.jj"))); } TaskCollection<CompileJavaccTask> compileJavaccsTasks = project.getTasks().withType(CompileJavaccTask.class); for (CompileJavaccTask task : compileJavaccsTasks) { assertTrue(task.getSource().contains(new File(outputDirectory, "someSourceFile.jj"))); } }
@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);  }