Skip to content

Instantly share code, notes, and snippets.

@kgmyshin
Created October 28, 2017 04:42
Show Gist options
  • Save kgmyshin/4dfc8f807e6f07fc82082f999afbe348 to your computer and use it in GitHub Desktop.
Save kgmyshin/4dfc8f807e6f07fc82082f999afbe348 to your computer and use it in GitHub Desktop.
kotlin系jarをclasspathに含めるかどうかで変わる -> というより gradle plugin実行時のClassLoader.getSystemClassLoaderの振る舞いが変わる?
val classLoader = URLClassLoader(
arrayOf(クラスファイル群パス),
ClassLoader.getSystemClassLoader()
)
val clazz = classLoader.loadClass("クラス名")
println("clazz.annotations.size: " + clazz.declaredAnnotations.size + " ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment