Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import %workspace%/tools/preset.bazelrc

# Load user-specific settings, if any
try-import %workspace%/user.bazelrc
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.7.1
20 changes: 20 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Bazel CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
- name: "Build & Test"
shell: bash
run: bazel test --config=ci //...
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/bazel-*
bin/
build/
.dub
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ repos:
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
# Check formatting and lint for starlark code
- repo: https://github.com/keith/pre-commit-buildifier
rev: 8.5.1
hooks:
- id: buildifier
- id: buildifier-lint
# Enforce that commit messages allow for later changelog generation
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.13.9
Expand Down
27 changes: 27 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("@rules_d//d:defs.bzl", "d_library", "d_test")
load("@rules_d//dub:defs.bzl", "dub_lock_dependencies")

d_library(
name = "asynchronous",
srcs = glob(["src/**/*.d"]),
imports = ["src"],
visibility = ["//visibility:public"],
deps = ["@dub//libasync:async"],
)

d_test(
name = "asynchronous_test",
srcs = glob([
"src/**/*.d",
"test/**/*.d",
]),
deps = [":asynchronous"],
)

dub_lock_dependencies(
name = "dub_dependencies",
src = "dub.selections.json",
dub_selections_lock = "dub.selections.lock.json",
skip_ssl_verification = True,
tags = ["manual"],
)
22 changes: 22 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module(
name = "asynchronous",
version = "0.7.0",
)

bazel_dep(name = "rules_d", version = "0.8.1")

bazel_dep(name = "bazelrc-preset.bzl", version = "1.9.2", dev_dependency = True)

# Select first d toolchain available for the current platform.
d = use_extension("@rules_d//d:extensions.bzl", "d")
d.toolchain(d_version = "dmd-2.112.0")
d.toolchain(d_version = "ldc-1.41.0")
use_repo(d, "d_toolchains")

register_toolchains("@d_toolchains//:all")

dub = use_extension("@rules_d//dub:extensions.bzl", "dub")
dub.from_dub_selections(
dub_selections_lock = "//:dub.selections.lock.json",
)
use_repo(dub, "dub")
3,837 changes: 3,837 additions & 0 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions dub.selections.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"_comment": "This file is auto-generated with `bazel run //:dub_dependencies.update`. Do not edit.",
"fileVersion": 1,
"packages": {
"libasync": {
"buildFileContent": "load(\"@rules_d//d:defs.bzl\", \"d_library\")\n\nd_library(\n name = \"async\",\n srcs = [\"source/libasync/bufferedtcp.d\", \"source/libasync/dns.d\", \"source/libasync/event.d\", \"source/libasync/events.d\", \"source/libasync/file.d\", \"source/libasync/internals/epoll.d\", \"source/libasync/internals/freelist.d\", \"source/libasync/internals/kqueue.d\", \"source/libasync/internals/logging.d\", \"source/libasync/internals/path.d\", \"source/libasync/internals/queue.d\", \"source/libasync/internals/socket_compat.d\", \"source/libasync/internals/validator.d\", \"source/libasync/internals/win32.d\", \"source/libasync/notifier.d\", \"source/libasync/package.d\", \"source/libasync/posix.d\", \"source/libasync/posix2.d\", \"source/libasync/signal.d\", \"source/libasync/socket.d\", \"source/libasync/tcp.d\", \"source/libasync/test.d\", \"source/libasync/threads.d\", \"source/libasync/timer.d\", \"source/libasync/types.d\", \"source/libasync/udp.d\", \"source/libasync/uds.d\", \"source/libasync/watcher.d\", \"source/libasync/windows.d\"],\n imports = [\"source\"],\n visibility = [\"//visibility:public\"],\n deps = [\"@%DUB_REPOSITORY_NAME%//memutils\"],\n)\n",
"integrity": "sha256-6MEf61fewLMGq3zGPrOCvRxJraCgvYujDeLO96+R9ng=",
"url": "https://code.dlang.org/packages/libasync/0.9.7.zip",
"version": "0.9.7"
},
"memutils": {
"buildFileContent": "load(\"@rules_d//d:defs.bzl\", \"d_library\")\n\nd_library(\n name = \"memutils\",\n srcs = [\"source/memutils/all.d\", \"source/memutils/allocators.d\", \"source/memutils/circularbuffer.d\", \"source/memutils/constants.d\", \"source/memutils/cryptosafe.d\", \"source/memutils/debugger.d\", \"source/memutils/dictionarylist.d\", \"source/memutils/freelist.d\", \"source/memutils/hashmap.d\", \"source/memutils/helpers.d\", \"source/memutils/memory.d\", \"source/memutils/pool.d\", \"source/memutils/rbtree.d\", \"source/memutils/refcounted.d\", \"source/memutils/scoped.d\", \"source/memutils/securepool.d\", \"source/memutils/tests.d\", \"source/memutils/unique.d\", \"source/memutils/utils.d\", \"source/memutils/vector.d\"],\n imports = [\"source\"],\n visibility = [\"//visibility:public\"],\n)\n",
"integrity": "sha256-/7IvdkJDI/3DV8V3Eum2CK87npL1Q5/f9ErFBHZQChk=",
"url": "https://code.dlang.org/packages/memutils/1.0.11.zip",
"version": "1.0.11"
}
}
}
8 changes: 8 additions & 0 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@bazelrc-preset.bzl", "bazelrc_preset")

bazelrc_preset(
name = "preset",
doc_link_template = "https://registry.build/flag/bazel?filter={flag}",
strict = True,
tags = ["manual"],
)
Loading
Loading