Skip to content

Commit e66295b

Browse files
committed
add initial bazel config
1 parent 125d09d commit e66295b

File tree

5 files changed

+128
-0
lines changed

5 files changed

+128
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
bazel-out
2+
bazel-bin
3+
bazel-controller-cdktf
4+
bazel-testlogs
5+
16
!gen/*/jsii/*.tgz
27

BUILD.bazel

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
# gazelle:prefix github.com/sourcegraph/controller-cdktf
4+
# gazelle:build_file_name BUILD.bazel
5+
load("@bazel_gazelle//:def.bzl", "gazelle")
6+
7+
gazelle(name = "gazelle")
8+
9+
gazelle(
10+
name = "gazelle-update-repos",
11+
args = [
12+
"-from_file=go.mod",
13+
"-to_macro=deps.bzl%go_dependencies",
14+
"-prune",
15+
"-build_file_proto_mode=disable_global",
16+
],
17+
command = "update-repos",
18+
)

WORKSPACE

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2+
3+
http_archive(
4+
name = "bazel_skylib",
5+
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
6+
urls = [
7+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
8+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
9+
],
10+
)
11+
12+
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
13+
14+
bazel_skylib_workspace()
15+
16+
http_archive(
17+
name = "aspect_bazel_lib",
18+
sha256 = "2518c757715d4f5fc7cc7e0a68742dd1155eaafc78fb9196b8a18e13a738cea2",
19+
strip_prefix = "bazel-lib-1.28.0",
20+
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.28.0/bazel-lib-v1.28.0.tar.gz",
21+
)
22+
23+
http_archive(
24+
name = "io_bazel_rules_go",
25+
sha256 = "6b65cb7917b4d1709f9410ffe00ecf3e160edf674b78c54a894471320862184f",
26+
urls = [
27+
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.0/rules_go-v0.39.0.zip",
28+
"https://github.com/bazelbuild/rules_go/releases/download/v0.39.0/rules_go-v0.39.0.zip",
29+
],
30+
)
31+
32+
http_archive(
33+
name = "bazel_gazelle",
34+
sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
35+
urls = [
36+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
37+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
38+
],
39+
)
40+
41+
http_archive(
42+
name = "com_google_protobuf",
43+
sha256 = "6aff9834fd7c540875e1836967c8d14c6897e3785a2efac629f69860fb7834ff",
44+
strip_prefix = "protobuf-3.15.0",
45+
urls = [
46+
"https://github.com/protocolbuffers/protobuf/archive/v3.15.0.tar.gz",
47+
],
48+
)
49+
50+
# Go toolchain setup
51+
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
52+
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
53+
load("//:deps.bzl", "go_dependencies")
54+
55+
# gazelle:repository_macro deps.bzl%go_dependencies
56+
go_dependencies()
57+
58+
go_rules_dependencies()
59+
60+
go_register_toolchains(
61+
version = "1.20.3",
62+
)
63+
64+
gazelle_dependencies()
65+
66+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
67+
68+
protobuf_deps()

deps.bzl

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
load("@bazel_gazelle//:deps.bzl", "go_repository")
2+
3+
"Bazel go dependencies"
4+
5+
def go_dependencies():
6+
"""The go dependencies in this macro are auto-updated by gazelle
7+
To update run,
8+
bazel run //:gazelle-update-repos
9+
"""
10+
pass
11+
go_repository(
12+
name = "com_github_aws_constructs_go_constructs_v10",
13+
build_file_proto_mode = "disable_global",
14+
importpath = "github.com/aws/constructs-go/constructs/v10",
15+
sum = "h1:XW89VuKlwwzgU77Nyzj30SPn2SFtDYkzfF+QN84b5bQ=",
16+
version = "v10.2.69",
17+
)
18+
go_repository(
19+
name = "com_github_aws_jsii_runtime_go",
20+
build_file_proto_mode = "disable_global",
21+
importpath = "github.com/aws/jsii-runtime-go",
22+
sum = "h1:C8BMeDgDz4IcDvgKFPMDt2OUGsTiANVu/YZGtwUoJqE=",
23+
version = "v1.87.0",
24+
)
25+
go_repository(
26+
name = "com_github_hashicorp_terraform_cdk_go_cdktf",
27+
build_file_proto_mode = "disable_global",
28+
importpath = "github.com/hashicorp/terraform-cdk-go/cdktf",
29+
sum = "h1:rpgeX9zQ9jhHoBc/qKEoVOAP/iVhwPN463UyhZKTwy0=",
30+
version = "v0.16.3",
31+
)

go.mod

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
module github.com/sourcegraph/controller-cdktf
22

33
go 1.20
4+
5+
require (
6+
github.com/aws/jsii-runtime-go v1.87.0
7+
github.com/hashicorp/terraform-cdk-go/cdktf v0.16.3
8+
github.com/aws/constructs-go/constructs/v10 v10.2.69
9+
)

0 commit comments

Comments
 (0)