@Test public void generatedJavaFilesFromCompileJavaccAreAddedToMainJavaSourceSet() { applyJavaccPluginToProject(); applyJavaPluginToProject(); JavaToJavaccDependencyAction action = new JavaToJavaccDependencyAction(); final File outputDirectory = new File(getClass().getResource("/javacc/testgenerated").getFile()); CompileJavaccTask compileJavaccTask = (CompileJavaccTask) project.getTasks().findByName(CompileJavaccTask.TASK_NAME_VALUE); compileJavaccTask.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.txt"))); } }
@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);  }