Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
Remove references to GRAIL
Browse files Browse the repository at this point in the history
On repo name:
Bazel rule name conventions have changed to use `rules_*` format, which
removes the `com_grail_` prefix from the workspace name.

On copyright:
Other Bazel projects at GRAIL always had the copyright to the Bazel
Authors for ease of community participation. This project, being one of
the earlier ones, did not catch on.
  • Loading branch information
Siddhartha Bagaria committed Feb 6, 2024
1 parent bc8a4da commit fa872dd
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .ycm_extra_conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright 2018 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,20 @@ For example,
In your WORKSPACE file:
```python
http_archive(
name = "com_grail_bazel_compdb",
name = "rules_compdb",
strip_prefix = "bazel-compilation-database-0.5.2",
urls = ["https://github.com/grailbio/bazel-compilation-database/archive/0.5.2.tar.gz"],
)

load("@com_grail_bazel_compdb//:deps.bzl", "bazel_compdb_deps")
bazel_compdb_deps()
load("@rules_compdb//:deps.bzl", "rules_compdb_deps")
rules_compdb_deps()
```

In your BUILD file located in any package:
```python
## Replace workspace_name and dir_path as per your setup.
load("@com_grail_bazel_compdb//:defs.bzl", "compilation_database")
load("@com_grail_bazel_output_base_util//:defs.bzl", "OUTPUT_BASE")
load("@rules_compdb//:defs.bzl", "compilation_database")
load("@bazel_output_base_util//:defs.bzl", "OUTPUT_BASE")

compilation_database(
name = "example_compdb",
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

workspace(name = "com_grail_bazel_compdb")
workspace(name = "rules_compdb")

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

Expand Down
2 changes: 1 addition & 1 deletion aspects.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions defs.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@com_grail_bazel_compdb//:aspects.bzl", "CompilationAspect", "compilation_database_aspect")
load("@rules_compdb//:aspects.bzl", "CompilationAspect", "compilation_database_aspect")

def _compilation_database_impl(ctx):
# Generates a single compile_commands.json file with the
Expand All @@ -36,7 +36,7 @@ def _compilation_database_impl(ctx):

content = compilation_db.to_list()
if ctx.attr.unique:
content = list({element.file:element for element in content}.values())
content = list({element.file: element for element in content}.values())
content = json.encode(content)
content = content.replace("__EXEC_ROOT__", exec_root)
content = content.replace("-isysroot __BAZEL_XCODE_SDKROOT__", "")
Expand Down
6 changes: 3 additions & 3 deletions deps.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@com_grail_bazel_compdb//:tools.bzl", "setup_tools")
load("@rules_compdb//:tools.bzl", "setup_tools")

def bazel_compdb_deps():
def rules_compdb_deps():
setup_tools()
2 changes: 1 addition & 1 deletion generate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3

# Copyright 2021 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion generate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2017 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions tests/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,8 +43,8 @@ filegroup(
srcs = ["b"],
)

load("@com_grail_bazel_compdb//:defs.bzl", "compilation_database")
load("@com_grail_bazel_output_base_util//:defs.bzl", "OUTPUT_BASE")
load("@rules_compdb//:defs.bzl", "compilation_database")
load("@bazel_output_base_util//:defs.bzl", "OUTPUT_BASE")

compilation_database(
name = "compdb",
Expand Down
10 changes: 5 additions & 5 deletions tests/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

workspace(name = "com_grail_bazel_compdb_tests")
workspace(name = "rules_compdb_tests")

local_repository(
name = "com_grail_bazel_compdb",
name = "rules_compdb",
path = "..",
)

load("@com_grail_bazel_compdb//:deps.bzl", "bazel_compdb_deps")
load("@rules_compdb//:deps.bzl", "rules_compdb_deps")

bazel_compdb_deps()
rules_compdb_deps()
2 changes: 1 addition & 1 deletion tests/a.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017 GRAIL, Inc.
// Copyright 2024 The Bazel Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/a.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017 GRAIL, Inc.
// Copyright 2024 The Bazel Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/b.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017 GRAIL, Inc.
// Copyright 2024 The Bazel Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
14 changes: 14 additions & 0 deletions tests/bazel.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 The Bazel 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
#
# http://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.

# Use bazelisk to catch migration problems.
if command -v bazelisk >/dev/null; then
# bazelisk is installed on Github Actions VMs.
Expand Down
14 changes: 14 additions & 0 deletions tests/check_migration.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright 2024 The Bazel 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
#
# http://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.

set -exuo pipefail

cd "$(dirname "${BASH_SOURCE[0]}")"
Expand Down
14 changes: 14 additions & 0 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright 2024 The Bazel 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
#
# http://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.

set -euo pipefail

cd "$(dirname "${BASH_SOURCE[0]}")"
Expand Down
14 changes: 14 additions & 0 deletions tests/stdlib.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2024 The Bazel 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
//
// http://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.

// Test program to check system includes in YCM semantic completion.
// See https://github.com/grailbio/bazel-compilation-database/issues/36

Expand Down
4 changes: 2 additions & 2 deletions tools.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 GRAIL, Inc.
# Copyright 2024 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,5 +39,5 @@ bazel_output_base_util = repository_rule(

def setup_tools():
bazel_output_base_util(
name = "com_grail_bazel_output_base_util",
name = "bazel_output_base_util",
)

0 comments on commit fa872dd

Please sign in to comment.