use of com.google.devtools.j2objc.file.RegularInputFile in project j2objc by google.
the class GenerationTest method preprocessFiles.
protected void preprocessFiles(String... fileNames) {
GenerationBatch batch = new GenerationBatch(options);
for (String fileName : fileNames) {
batch.addSource(new RegularInputFile(tempDir.getPath() + File.separatorChar + fileName, fileName));
}
new InputFilePreprocessor(parser).processInputs(batch.getInputs());
}
use of com.google.devtools.j2objc.file.RegularInputFile in project j2objc by google.
the class TranslationProcessorTest method testDuplicateSourceFileOnSourcepath.
public void testDuplicateSourceFileOnSourcepath() throws IOException {
options.setBuildClosure(true);
// Have src/main/java precede tmp dir in source path.
options.fileUtil().insertSourcePath(0, getTempDir() + "/src/main/java");
options.fileUtil().appendSourcePath(getTempDir());
addSourceFile("class Test { Foo f; }", "Test.java");
addSourceFile("class Foo { void foo1() {} }", "Foo.java");
addSourceFile("class Foo { void foo2() {} }", "src/main/java/Foo.java");
GenerationBatch batch = new GenerationBatch(options);
batch.addSource(new RegularInputFile(getTempDir() + "/Test.java", "Test.java"));
batch.addSource(new RegularInputFile(getTempDir() + "/src/main/java/Foo.java", "Foo.java"));
TranslationProcessor processor = new TranslationProcessor(J2ObjC.createParser(options), null);
processor.processInputs(batch.getInputs());
processor.processBuildClosureDependencies();
String translation = getTranslatedFile("Foo.h");
assertTranslation(translation, "- (void)foo2;");
assertNotInTranslation(translation, "foo1");
}
Aggregations