private Builder( ReadFileSystem<?> sourcePath, ReadWriteFileSystem<?> sourceOutput, ReadWriteFileSystem<?> classOutput, List<ReadFileSystem<?>> classPaths) { Provider<JavaCompiler> javaCompiler = new Provider<JavaCompiler>() { public JavaCompiler get() { return ToolProvider.getSystemJavaCompiler(); } }; this.processor = null; this.javaCompiler = javaCompiler; this.sourcePath = sourcePath; this.sourceOutput = sourceOutput; this.classOutput = classOutput; this.classPaths = classPaths; this.config = new CompilerConfig(); }
private Builder( ReadFileSystem<?> sourcePath, ReadWriteFileSystem<?> sourceOutput, ReadWriteFileSystem<?> classOutput, List<ReadFileSystem<?>> classPaths) { Provider<JavaCompiler> javaCompiler = new Provider<JavaCompiler>() { public JavaCompiler get() { return ToolProvider.getSystemJavaCompiler(); } }; this.processor = null; this.javaCompiler = javaCompiler; this.sourcePath = sourcePath; this.sourceOutput = sourceOutput; this.classOutput = classOutput; this.classPaths = classPaths; this.config = new CompilerConfig(); }
public CompileStrategy( ReadWriteFileSystem<I> sourcePath, ReadWriteFileSystem<O> sourceOutput, ReadWriteFileSystem<O> classOutput) { // this.classPath = new LinkedList<ReadFileSystem<?>>(); this.sourcePath = sourcePath; this.sourceOutput = sourceOutput; this.classOutput = classOutput; this.config = new CompilerConfig().force(true); }
public CompileStrategy( ReadWriteFileSystem<I> sourcePath, ReadWriteFileSystem<O> sourceOutput, ReadWriteFileSystem<O> classOutput) { // this.classPath = new LinkedList<ReadFileSystem<?>>(); this.sourcePath = sourcePath; this.sourceOutput = sourceOutput; this.classOutput = classOutput; this.config = new CompilerConfig().force(true); }
@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"); }
@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"); }
builder(). javaCompiler(compilerProvider). config(new CompilerConfig().withProcessorOption("juzu.error_reporting", "formal")). sourcePath(fs). output(new RAMFileSystem()).
builder(). javaCompiler(compilerProvider). config(new CompilerConfig().withProcessorOption("juzu.error_reporting", "formal")). sourcePath(fs). output(new RAMFileSystem()).