Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.

Latest commit

 

History

History
20 lines (14 loc) · 809 Bytes

index.md

File metadata and controls

20 lines (14 loc) · 809 Bytes
layout title
default
Plugins

Since version 0.4.1, JTransc supports a plugin system using the plain Java's ServiceLoader.

You must add to your JAR this file: META-INF.services/com.jtransc.plugin.JTranscPlugin

With the fqname of your implementation. That class should extend the abstract class com.jtransc.plugin.JTranscPlugin.

You can see some examples of plugins to discover the API at that moment:

  • jtransc-core/src/com/jtrans/plugin/jna/JnaJTranscPlugin.kt
  • jtransc-core/src/com/jtrans/plugin/meta/MetaReflectionJTranscPlugin.kt
  • jtransc-core/src/com/jtrans/plugin/service/ServiceLoaderJTranscPlugin.kt

The plugin system allows to reference classes/methods/fields, to modify the program (adding classes, methods, fields or modifying them) before or after the ThreeShaking phase.