diff --git a/bridge/src/main/java/com/github/sbt/avro/AvroCompilerBridge.java b/bridge/src/main/java/com/github/sbt/avro/AvroCompilerBridge.java index 1d41939..5c3e004 100644 --- a/bridge/src/main/java/com/github/sbt/avro/AvroCompilerBridge.java +++ b/bridge/src/main/java/com/github/sbt/avro/AvroCompilerBridge.java @@ -96,16 +96,11 @@ public void compileIdls(File[] idls, File target) throws Exception { @Override public void compileAvscs(File[] avscs, File target) throws Exception { - List files = new ArrayList<>(avscs.length); - for (File schema : avscs) { - System.out.println("Compiling Avro schema: " + schema); - files.add(schema); - } - Map schemas = parser.parseFiles(files); - + Map schemas = parser.parseFiles(Arrays.asList(avscs)); for (Map.Entry entry: schemas.entrySet()) { File file = entry.getKey(); Schema schema = entry.getValue(); + System.out.println("Compiling Avro schema: " + file + ":" + schema.getFullName()); SpecificCompiler compiler = new SpecificCompiler(schema); configureCompiler(compiler); compiler.compileToDestination(file, target); @@ -119,7 +114,7 @@ public void compileAvprs(File[] avprs, File target) throws Exception { Protocol protocol = Protocol.parse(avpr); SpecificCompiler compiler = new SpecificCompiler(protocol); configureCompiler(compiler); - compiler.compileToDestination(null, target); + compiler.compileToDestination(avpr, target); } } } diff --git a/plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala b/plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala index 0e13d4f..41b95af 100644 --- a/plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala +++ b/plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala @@ -242,8 +242,6 @@ object SbtAvro extends AutoPlugin { // - no previous cache and we have records to recompile // - input files have changed // - output files are missing - - // TODO Cache class loader val avroClassLoader = new AvroCompilerPluginClassLoader( (AvroCompiler / dependencyClasspath).value .map(toNioPath) @@ -287,7 +285,6 @@ object SbtAvro extends AutoPlugin { throw new AvroGenerateFailedException } finally { Thread.currentThread().setContextClassLoader(initLoader) - avroClassLoader.close() } } else { outReport.checked