-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07acc19
commit 8f7b46f
Showing
4 changed files
with
28 additions
and
91 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
bridge/src/main/resources/META-INF/services/com.github.sbt.avro.AvroCompiler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
com.github.sbt.avro.AvroCompilerBridge |
85 changes: 0 additions & 85 deletions
85
plugin/src/main/java/com/github/sbt/avro/ChildFirstClassLoader.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
plugin/src/main/scala/com/github/sbt/avro/AvroCompilerPluginClassLoader.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.github.sbt.avro | ||
|
||
import java.net.{URL, URLClassLoader} | ||
|
||
private object AvroCompilerPluginClassLoader { | ||
private val JvmPrefixes = Array("java.", "jdk.") | ||
private val CompilerInterface = classOf[AvroCompiler].getName | ||
} | ||
|
||
private class AvroCompilerPluginClassLoader(urls: Array[URL], parent: ClassLoader) | ||
extends URLClassLoader(urls) { | ||
import AvroCompilerPluginClassLoader.* | ||
|
||
override def findClass(name: String): Class[?] = { | ||
if (JvmPrefixes.exists(name.startsWith) || CompilerInterface == name) { | ||
parent.loadClass(name) | ||
} else { | ||
super.findClass(name) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters