kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/web/site/BUILD (about)

     1  load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
     2  load("@bazelruby_rules_ruby//ruby:defs.bzl", "ruby_binary")
     3  load(":site_docs.bzl", "jekyll_build", "site_docs")
     4  
     5  ruby_binary(
     6      name = "doc_header",
     7      srcs = ["doc_header.rb"],
     8      tags = ["manual"],
     9      visibility = ["//visibility:public"],
    10      deps = ["@website_bundle//:asciidoctor"],
    11  )
    12  
    13  site_docs(
    14      name = "_docs",
    15      srcs = [
    16          "//kythe/docs:kythe-compatible-compilers",
    17          "//kythe/docs:kythe-compilation-database",
    18          "//kythe/docs:kythe-configurable-extraction",
    19          "//kythe/docs:kythe-kzip",
    20          "//kythe/docs:kythe-overview",
    21          "//kythe/docs:kythe-storage",
    22          "//kythe/docs:kythe-uri-spec",
    23          "//kythe/docs:kythe-verifier",
    24          "//kythe/docs:kythes-command-line-tool",
    25          "//kythe/docs:modeling-libraries",
    26          "//kythe/docs:schema-overview",
    27      ],
    28      tags = ["manual"],
    29      deps = [":schema"],
    30  )
    31  
    32  site_docs(
    33      name = "schema",
    34      srcs = [
    35          "//kythe/docs/schema",
    36          "//kythe/docs/schema:callgraph",
    37          "//kythe/docs/schema:indexing-generated-code",
    38          "//kythe/docs/schema:influences-relation",
    39          "//kythe/docs/schema:marked-source",
    40          "//kythe/docs/schema:modules",
    41          "//kythe/docs/schema:verifierstyle",
    42          "//kythe/docs/schema:writing-an-indexer",
    43      ],
    44      rename_files = {
    45          "schema.html": "index.html",
    46      },
    47      tags = ["manual"],
    48  )
    49  
    50  jekyll_build(
    51      name = "site",
    52      srcs = [":site_sources"],
    53      tags = ["manual"],
    54  )
    55  
    56  filegroup(
    57      name = "site_sources",
    58      srcs = glob(
    59          ["**"],
    60          exclude = [
    61              "README.adoc",
    62              "Gemfile.lock",
    63              "Gemfile",
    64              "build.sh",
    65              "sync_docs.sh",
    66              "check_links*.sh",
    67              "site_docs.bzl",
    68              "BUILD",
    69              "doc_header.rb",
    70              "_site*/**",
    71              "_vendor/**",
    72              "_docs/**",
    73              ".bundle/**",
    74              "asciidoc-pygments.css",
    75          ],
    76      ) + [":_docs"],
    77      tags = ["manual"],
    78  )
    79  
    80  filegroup(
    81      name = "site_files",
    82      srcs = [
    83          ":site",
    84          ":site_sources",
    85      ],
    86      tags = ["manual"],
    87  )
    88  
    89  sh_test(
    90      name = "check_links_test",
    91      srcs = ["check_links_test.sh"],
    92      data = [
    93          ":site_files",
    94          # Similarly :bin/jekyll is a plain file, :jekyll is a ruby library
    95          # and we need the toolchain.
    96          "@org_ruby_lang_ruby_toolchain//:ruby_bin",
    97          "@website_bundle//:bin/jekyll",
    98          "@website_bundle//:jekyll",
    99      ],
   100      env = {
   101          "JEKYLL_BIN": "$(location @website_bundle//:bin/jekyll)",
   102      },
   103      tags = [
   104          "arc-ignore",
   105          "local",
   106          "manual",
   107      ],
   108  )
   109  
   110  # Can be run via `bazel run //kythe/website:serve`
   111  # to manually verify the website contents.
   112  sh_binary(
   113      name = "serve",
   114      srcs = ["serve.sh"],
   115      data = [
   116          ":site_files",
   117          # Similarly :bin/jekyll is a plain file, :jekyll is a ruby library
   118          # and we need the toolchain.
   119          "@org_ruby_lang_ruby_toolchain//:ruby_bin",
   120          "@website_bundle//:bin/jekyll",
   121          "@website_bundle//:jekyll",
   122      ],
   123      env = {
   124          "JEKYLL_BIN": "$(location @website_bundle//:bin/jekyll)",
   125      },
   126      tags = ["manual"],
   127  )
   128  
   129  bzl_library(
   130      name = "site_docs_bzl",
   131      srcs = ["site_docs.bzl"],
   132      deps = [
   133          "//kythe/docs:asciidoc_bzl",
   134          "@bazel_skylib//lib:paths",
   135          "@bazel_skylib//lib:shell",
   136      ],
   137  )