Class TeavmPlugin

  • All Implemented Interfaces:
    org.gradle.api.Plugin<org.gradle.api.Project>

    public class TeavmPlugin
    extends java.lang.Object
    implements org.gradle.api.Plugin<org.gradle.api.Project>
    TeaVM plugin. Compiles java/kotlin/scala sources into javascript.

    Plugin registers 'teavm' extension. Extension declares source sets to use (by default, main, kotlin and scala). Additional classes and source directories could be configured with special properties (also, default source sets could be flushed to rely only on custom locations).

    Extension configures production compilation. For development, some options are duplicate in 'devOptions': when `dev = true` these options override default values (dev mode).

    Plugin could use any teavm version: by default, version would be auto-detected from user classpath (by teavm-classlib jar). If jar not found, then `version` setting would be used. Auto-detection could be disabled with 'autoVersion = false'.

    IMPORTANT: plugin is compiled with exact teavm version and so only compatible teavm version could be used instead. Also, new options appeared in new teavm would be impossible to use (until plugin would be compiled with new version).

    NOTE: dev and debug servers are only available in IDEA plugin

    Debug extension option could be used to print all paths resolved by plugin (plugin debugging).

    Special "mixedResources" mode allows using static resources like html files (for flavour) inside source directories.

    Since:
    27.12.2022
    • Constructor Summary

      Constructors 
      Constructor Description
      TeavmPlugin()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(org.gradle.api.Project project)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TeavmPlugin

        public TeavmPlugin()
    • Method Detail

      • apply

        public void apply​(org.gradle.api.Project project)
        Specified by:
        apply in interface org.gradle.api.Plugin<org.gradle.api.Project>