Skip to content

Commit

Permalink
fix (build): Explicitly specify default_java_toolchain
Browse files Browse the repository at this point in the history
I had hoped this may fix
bazelbuild/bazel#21119,
it unfortunately does not - but I'll still keep it.
  • Loading branch information
vorburger committed Jan 28, 2024
1 parent b145707 commit e9c048f
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ common --extra_toolchains=@local_jdk//:all
# https://bazel.build/docs/bazel-and-java#java-versions
build --java_language_version=21
build --tool_java_language_version=21
build --java_runtime_version=remotejdk_21
build --tool_java_runtime_version=remotejdk_21

# https://bazel.build/docs/user-manual#java_runtime_version
build --java_runtime_version=21
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0
7.0.2
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ repos:
rev: v4.0.0-alpha.8
hooks:
- id: prettier
# NOT markdown, because we use markdownlint for that
types_or: [css, html, javascript, json, json5, scss, ts, tsx, yaml]
exclude: ^docs/use|core/impl/src/test/resources|.devcontainer/devcontainer.json
additional_dependencies:
- [email protected]

- repo: https://github.com/pre-commit/mirrors-csslint
rev: v1.0.5
Expand Down
10 changes: 1 addition & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
// https://github.com/bazelbuild/vscode-bazel/issues/261
"bazel.queriesShareServer": true,

"cSpell.words": [
"Bazel",
"bazelisk",
"Classpath",
"Enola",
"Intelli",
"protolint",
"textproto"
],
"cSpell.words": ["Bazel", "bazelisk", "Classpath", "Enola", "Intelli", "protolint", "textproto"],

"editor.formatOnType": true,
"editor.formatOnSave": true,
Expand Down
76 changes: 64 additions & 12 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# see ./tools/java_toolchain/BUILD
# see https://github.com/bazelbuild/bazel/issues/20877, NB the "_definition" suffix!
register_toolchains("//tools/java_toolchain:repository_default_java_toolchain_definition")

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

GRPC_JAVA_VERSION = "1.61.0"
Expand Down
39 changes: 39 additions & 0 deletions tools/java_toolchain/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2023 The Enola <https://enola.dev> Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# https://github.com/bazelbuild/bazel/issues/21119
# https://bazel.build/docs/bazel-and-java#config-compilation-toolchains

# NB: This is "activated" by register_toolchains() in WORKSPACE.bazel!

load(
"@bazel_tools//tools/jdk:default_java_toolchain.bzl",
"BASE_JDK9_JVM_OPTS",
"DEFAULT_JAVACOPTS",
"DEFAULT_TOOLCHAIN_CONFIGURATION",
"default_java_toolchain",
)

default_java_toolchain(
name = "repository_default_java_toolchain",
configuration = DEFAULT_TOOLCHAIN_CONFIGURATION, # One of predefined configurations
# Other parameters are from java_toolchain rule:
java_runtime = "@rules_java//toolchains:remotejdk_21", # JDK to use for compilation and toolchain's tools execution
javacopts = DEFAULT_JAVACOPTS + ["--enable_preview"], # Additional javac options
jvm_opts = BASE_JDK9_JVM_OPTS + ["--enable_preview"], # Additional JDK options
source_version = "21",
target_version = "21",
)
31 changes: 6 additions & 25 deletions web/ui-soy/src/main/resources/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,11 @@

<script src="/ui/static/main.js"></script>

<link
href="/ui/static/main.css"
media="screen"
rel="stylesheet"
type="text/css" />
<link href="/ui/static/main.css" media="screen" rel="stylesheet" type="text/css" />

<link href="https://fonts.googleapis.com" rel="preconnect" />
<link crossorigin href="https://fonts.gstatic.com" rel="preconnect" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto&display=swap"
rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet" />

<link
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"
Expand All @@ -50,26 +44,15 @@
<span class="material-symbols-outlined">menu</span>
<span>Enola πŸ•΅πŸΎβ€β™€οΈ</span>
<span style="width: 100%">
<input
incremental="true"
name="q"
placeholder="Search..."
size="70"
type="search" />
<input incremental="true" name="q" placeholder="Search..." size="70" type="search" />
</span>
<a href="https://www.enola.dev"
><span
class="material-symbols-outlined"
style="float: right; color: #ccc">
help
</span></a
><span class="material-symbols-outlined" style="float: right; color: #ccc"> help </span></a
>
</div>

<div class="main">
<div style="float: right; padding-top: 1em">
<a href="#">name</a>: <input value="demo" />
</div>
<div style="float: right; padding-top: 1em"><a href="#">name</a>: <input value="demo" /></div>

<div style="float: let">
<h1>😞 404 πŸ’€</h1>
Expand All @@ -79,9 +62,7 @@ <h1>😞 404 πŸ’€</h1>
<ul>
<li>
<tt>/ui/entity/{ns}/{entity}/{paths+}</tt>, e.g.
<a href="/ui/entity/demo.book/ABC/0-13-140731-7/1"
>demo.book_kind/ABC/0-13-140731-7/1</a
>
<a href="/ui/entity/demo.book/ABC/0-13-140731-7/1">demo.book_kind/ABC/0-13-140731-7/1</a>
</li>
</ul>
</div>
Expand Down
3 changes: 1 addition & 2 deletions web/ui-soy/src/main/resources/static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ body {
padding: 0.3em;
border-style: solid;
color: darkolivegreen;
font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
"Lucida Sans", Arial, sans-serif;
font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
}

0 comments on commit e9c048f

Please sign in to comment.