Skip to content

dhakehurst/kotlin.gradle.plugin.exportPublic

Repository files navigation

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()
    ...
}

About

gradle kotlin compiler plugin to 'JsExport' all public declarations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages