@Test public void augmentArgumentsAppendsOutputDirectory() throws IOException { File inputDirectory = testFolder.newFolder("input"); RelativePath fileToCompile = new RelativePath(true, "MyClass.jj"); ProgramArguments augmentedArguments = programInvoker.augmentArguments(inputDirectory, fileToCompile, new ProgramArguments()); String expectedOutputDirectoryArgument = String.format("-OUTPUT_DIRECTORY=%s", tempOutputDirectory.getAbsolutePath()); assertThat(augmentedArguments.get(augmentedArguments.size() - 1), is(equalTo(expectedOutputDirectoryArgument))); }
@Override public ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments) { ProgramArguments augmentedArguments = new ProgramArguments(arguments); augmentedArguments.add("OUTPUT_DIRECTORY", inputRelativePath.getFile(tempOutputDirectory).getParentFile().getAbsolutePath()); return augmentedArguments; }
JavaccProgramInvoker extends AbstractProgramInvoker { @Override public ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments) { ProgramArguments augmentedArguments = new ProgramArguments(arguments); augmentedArguments.add("OUTPUT_DIRECTORY", inputRelativePath.getFile(tempOutputDirectory).getParentFile().getAbsolutePath()); return augmentedArguments; } }
JavaccProgramInvoker extends AbstractProgramInvoker { @Override public ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments) { ProgramArguments augmentedArguments = new ProgramArguments(arguments); augmentedArguments.add("OUTPUT_DIRECTORY", inputRelativePath.getFile(tempOutputDirectory).getParentFile().getAbsolutePath()); return augmentedArguments; } JavaccProgramInvoker(Project project, Configuration classpath, File tempOutputDirectory); }
JavaccProgramInvoker extends AbstractProgramInvoker { @Override public ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments) { ProgramArguments augmentedArguments = new ProgramArguments(arguments); augmentedArguments.add("OUTPUT_DIRECTORY", inputRelativePath.getFile(tempOutputDirectory).getParentFile().getAbsolutePath()); return augmentedArguments; } JavaccProgramInvoker(Project project, Configuration classpath, File tempOutputDirectory); @Override ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments); @Override String getProgramName(); @Override String supportedSuffix(); }
JavaccProgramInvoker extends AbstractProgramInvoker { @Override public ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments) { ProgramArguments augmentedArguments = new ProgramArguments(arguments); augmentedArguments.add("OUTPUT_DIRECTORY", inputRelativePath.getFile(tempOutputDirectory).getParentFile().getAbsolutePath()); return augmentedArguments; } JavaccProgramInvoker(Project project, Configuration classpath, File tempOutputDirectory); @Override ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments); @Override String getProgramName(); @Override String supportedSuffix(); static final String SUPPORTED_FILE_SUFFIX; }