Skip to content

Commit 490ae17

Browse files
authored
bzlmod + rust - scala (#186)
1 parent a5f23a7 commit 490ae17

File tree

41 files changed

+21846
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+21846
-430
lines changed

.bazelrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
startup --output_base=~/.bazelout
2+
# common --incompatible_enable_proto_toolchain_resolution
23
common --color=yes
3-
common --enable_bzlmod=false
4+
common --noenable_workspace
5+
common --enable_bzlmod=true
46

57
build --cxxopt='-std=c++17'
68
build --host_cxxopt='-std=c++17'
@@ -13,4 +15,8 @@ build --tool_java_runtime_version=remotejdk_21
1315

1416
build --strategy=Scalac=worker
1517

18+
# layering check fails because golf_service:handlers depends on :protobuf for json_util.h
19+
# this is weird because :protobuf hdrs glob **/*.h which includes json_util.h
20+
# build --features=layering_check
21+
1622
test --test_verbose_timeout_warnings

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.2.0
1+
7.2.1

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
- run:
2424
name: CC Lint
2525
command: scripts/format-cc-check
26-
- run:
27-
name: Scala Lint
28-
command: scripts/format-scala-check
26+
# - run:
27+
# name: Scala Lint
28+
# command: scripts/format-scala-check
2929
- run:
3030
name: Run Build
3131
command: bazel build //...
@@ -35,9 +35,9 @@ jobs:
3535
- run:
3636
name: Run Java Tests
3737
command: bazel test //jvm/src/test/java/...
38-
- run:
39-
name: Run Scala Tests
40-
command: bazel test //jvm/src/test/scala/...
38+
# - run:
39+
# name: Run Scala Tests
40+
# command: bazel test //jvm/src/test/scala/...
4141
- run:
4242
name: Run Go Tests
4343
command: bazel test //go/...

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ out
77
.bsp
88
.bazelbsp
99
.metals
10+
vcpkg_installed
11+
conan
12+
rust-project.json

.ijwb/.bazelproject

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ additional_languages:
1717
go
1818

1919
java_language_level: 17
20+
21+
build_flags:
22+
--enable_workspace

.vscode/tasks.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Generate rust-project.json",
6+
"command": "bazel",
7+
"args": ["run", "@rules_rust//tools/rust_analyzer:gen_rust_project"],
8+
"options": {
9+
"cwd": "${workspaceFolder}"
10+
},
11+
"group": "build",
12+
"problemMatcher": [],
13+
"presentation": {
14+
"reveal": "never",
15+
"panel": "dedicated"
16+
},
17+
"runOptions": {
18+
"runOn": "folderOpen"
19+
}
20+
}
21+
]
22+
}

BUILD

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,24 @@
1-
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier", "buildifier_test")
2-
load("@io_bazel_rules_scala//scala:scala_toolchain.bzl", "scala_toolchain")
3-
4-
scala_toolchain(
5-
name = "diagnostics_reporter_toolchain_impl",
6-
enable_diagnostics_report = True,
7-
visibility = ["//visibility:public"],
8-
)
9-
10-
toolchain(
11-
name = "diagnostics_reporter_toolchain",
12-
toolchain = "diagnostics_reporter_toolchain_impl",
13-
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type",
14-
visibility = ["//visibility:public"],
15-
)
1+
load("@buildifier_prebuilt//:rules.bzl", "buildifier", "buildifier_test")
162

173
buildifier(
184
name = "buildifier",
19-
exclude_patterns = ["./.bazelbsp/*"],
5+
exclude_patterns = [
6+
"./.bazelbsp/*",
7+
"./vcpkg_installed/*",
8+
],
9+
lint_mode = "fix",
2010
)
2111

2212
buildifier_test(
2313
name = "buildifier_test",
2414
size = "small",
2515
timeout = "short",
26-
exclude_patterns = ["./.bazelbsp/*"],
16+
exclude_patterns = [
17+
"./.bazelbsp/*",
18+
"./vcpkg_installed/*",
19+
],
2720
lint_mode = "warn",
2821
mode = "diff",
2922
no_sandbox = True,
30-
workspace = "//:WORKSPACE",
31-
)
32-
33-
alias(
34-
name = "go-images",
35-
actual = "//go/images",
36-
visibility = ["//visibility:public"],
23+
workspace = "//:MODULE.bazel",
3724
)

0 commit comments

Comments
 (0)