Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.36 KB

File metadata and controls

46 lines (36 loc) · 1.36 KB

Build Status Gradle Plugin Portal

net.akehurst.kotlin.gradle.plugin

  • exportPublic
  • jsIntegration

Latest Kotlin uses DCE to minimise JS module code size. Their suggestion is to add @JsExport annotation to all classes that you want to export. I don't like this. I think anything marked with public visibility should be exported. This plugin make that happen.

Add the plugin

plugins {
    id("net.akehurst.kotlin.gradle.plugin.exportPublic") version("<latest version>")
}

By default it exports all public declarations. To limit this add some configuration

exportPublic {
    exportPatterns.set(
        listOf(
            "<qualified name glob>",
            "some.package.name.**"
        )
    )
}

This is a kotlin compiler plugin, published as a gradle-plugin, thus the gradlePluginPortal must be added as a repository in order for dependencies to be resolved.

repositories {
    mavenCentral()
    gradlePluginPortal()
    ...
}