builder.addClassPath(classes); builder.addClassPath(cp);
builder.addClassPath(classes); builder.addClassPath(cp);
@Test public void testGetResourceFromClassPath() throws Exception { File fic = File.createTempFile("test", ".jar"); fic.deleteOnExit(); JavaArchive jar = ShrinkWrap.create(JavaArchive.class); jar.addAsResource(new StringAsset("the_resource"), "resource.txt"); jar.as(ZipExporter.class).exportTo(fic, true); JarFileSystem classpath = new JarFileSystem(new JarFile(fic)); RAMFileSystem output = new RAMFileSystem(); Compiler compiler = Compiler.builder(). javaCompiler(compilerProvider). config(new CompilerConfig().force(true)). addClassPath(classpath). sourcePath(new RAMFileSystem()). output(output).build(); GetResource processor = new GetResource(StandardLocation.CLASS_PATH, FileKey.newResourceName("", "resource.txt")); compiler.addAnnotationProcessor(processor); compiler.compile(); processor.assertResource("the_resource"); }
sourceOutput(classOutput). classOutput(classOutput). addClassPath(classPath).build(); compiler.addAnnotationProcessor(new MainProcessor()); compiler.compile();
sourceOutput(classOutput). classOutput(classOutput). addClassPath(classPath).build(); compiler.addAnnotationProcessor(new MainProcessor()); compiler.compile();
@Test public void testGetResourceFromClassPath() throws Exception { File fic = File.createTempFile("test", ".jar"); fic.deleteOnExit(); JavaArchive jar = ShrinkWrap.create(JavaArchive.class); jar.addAsResource(new StringAsset("the_resource"), "resource.txt"); jar.as(ZipExporter.class).exportTo(fic, true); JarFileSystem classpath = new JarFileSystem(new JarFile(fic)); RAMFileSystem output = new RAMFileSystem(); Compiler compiler = Compiler.builder(). javaCompiler(compilerProvider). config(new CompilerConfig().force(true)). addClassPath(classpath). sourcePath(new RAMFileSystem()). output(output).build(); GetResource processor = new GetResource(StandardLocation.CLASS_PATH, FileKey.newResourceName("", "resource.txt")); compiler.addAnnotationProcessor(processor); compiler.compile(); processor.assertResource("the_resource"); }
final Compiler.Builder builder() { Compiler.Builder builder = Compiler.builder(); builder.javaCompiler(javaCompiler); builder.processor(processorFactory); builder.addClassPath(classPath); builder.sourcePath(sourcePath); builder.sourceOutput(sourceOutput); builder.classOutput(classOutput); builder.config(config); return builder; }
final Compiler.Builder builder() { Compiler.Builder builder = Compiler.builder(); builder.javaCompiler(javaCompiler); builder.processor(processorFactory); builder.addClassPath(classPath); builder.sourcePath(sourcePath); builder.sourceOutput(sourceOutput); builder.classOutput(classOutput); builder.config(config); return builder; }
public Builder addClassPath(Iterable<ReadFileSystem<?>> classPaths) { for (ReadFileSystem<?> classPath : classPaths) { addClassPath(classPath); } return this; }
public Builder addClassPath(Iterable<ReadFileSystem<?>> classPaths) { for (ReadFileSystem<?> classPath : classPaths) { addClassPath(classPath); } return this; }