Giter Site home page Giter Site logo

bazel_rules_dokka's Introduction

bazel_rules_dokka

Bazel rules for Dokka (documentation engine for Kotlin)

CI GitHub license

Features

  • Easy docs generation
  • Default javadoc support
  • Extension point for generating other doc types

Usage

WORKSPACE configuration

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_DOKKA_VERSION = "..."
RULES_DOKKA_SHA = "..."

http_archive(
    name = "rules_dokka",
    sha256 = RULES_DOKKA_SHA,
    strip_prefix = "bazel_rules_dokka-{v}".format(v = RULES_DOKKA_VERSION),
    url = "https://github.com/Bencodes/bazel_rules_dokka/archive/v{v}.tar.gz".format(v = RULES_DOKKA_VERSION),
)

load("@rules_dokka//dokka:dependencies.bzl", "rules_dokka_dependencies")
rules_dokka_dependencies()

load("@rules_dokka//dokka:toolchains.bzl", "rules_dokka_toolchains")
rules_dokka_toolchains()

BUILD configuration

load("@rules_dokka//dokka:defs.bzl", "dokka")

dokka(
    name = "sample_dokka_docs",
    srcs = glob(["src/main/kotlin/**/*.kt"]),
)

Supported dokka-cli arguments

See the Dokka docs for more information.

dokka(
    name = "dokka_javadoc_test",
    srcs = [ ... ],
    moduleName = "name goes here",
    moduleDisplayName = "display name goes here",
    offlineMode = False,
    failOnWarning = False,
    noStdlibLink = False,
    noJdkLink = False,
    jdkVersion = "1.8",
    includeNonPublic = False,
    skipEmptyPackages = False,
    skipDeprecated = False,
    reportUndocumented = False,
    plugins = [
        ...
    ],
)

Building

$ bazel build //sample:sample_dokka_docs

Advanced

Customizing the Dokka version

Call rules_dokka_toolchains with the dokka_version provided:

rules_dokka_toolchains(dokka_version = "1.4.0-rc")

Plugins

Download the Dokka Jeykell maven plugins by adding the following to your WORKSPACE. Don't forget to include the transitive dependencies!

DOKKA_VERSION = "1.4.0-rc"

maven_install(
    name = "sample_deps",
    artifacts = [
        maven.artifact("org.jetbrains.dokka", "jekyll-plugin", DOKKA_VERSION),
        ...
    ],
)

Override the plugins attribute in your BUILD file with your own Dokka plugin and provide the classpath jars:

dokka(
    name = "sample_dokka_docs",
    srcs = glob(["src/main/kotlin/**/*.kt"]),
    plugins = [
        "@sample_deps//:org_jetbrains_dokka_jekyll_plugin",
        ...
    ],
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.