Skip to content
Draft
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
bazel-out
bazel-bin
bazel-controller-cdktf
bazel-testlogs

!gen/*/jsii/*.tgz

18 changes: 18 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

# gazelle:prefix github.com/sourcegraph/controller-cdktf
# gazelle:build_file_name BUILD.bazel
load("@bazel_gazelle//:def.bzl", "gazelle")

gazelle(name = "gazelle")

gazelle(
name = "gazelle-update-repos",
args = [
"-from_file=go.mod",
"-to_macro=deps.bzl%go_dependencies",
"-prune",
"-build_file_proto_mode=disable_global",
],
command = "update-repos",
)
68 changes: 68 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

http_archive(
name = "aspect_bazel_lib",
sha256 = "2518c757715d4f5fc7cc7e0a68742dd1155eaafc78fb9196b8a18e13a738cea2",
strip_prefix = "bazel-lib-1.28.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.28.0/bazel-lib-v1.28.0.tar.gz",
)

http_archive(
name = "io_bazel_rules_go",
sha256 = "6b65cb7917b4d1709f9410ffe00ecf3e160edf674b78c54a894471320862184f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.0/rules_go-v0.39.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.39.0/rules_go-v0.39.0.zip",
],
)

http_archive(
name = "bazel_gazelle",
sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
],
)

http_archive(
name = "com_google_protobuf",
sha256 = "6aff9834fd7c540875e1836967c8d14c6897e3785a2efac629f69860fb7834ff",
strip_prefix = "protobuf-3.15.0",
urls = [
"https://github.com/protocolbuffers/protobuf/archive/v3.15.0.tar.gz",
],
)

# Go toolchain setup
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("//:deps.bzl", "go_dependencies")

# gazelle:repository_macro deps.bzl%go_dependencies
go_dependencies()

go_rules_dependencies()

go_register_toolchains(
version = "1.20.3",
)

gazelle_dependencies()

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()
31 changes: 31 additions & 0 deletions deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
load("@bazel_gazelle//:deps.bzl", "go_repository")

"Bazel go dependencies"

def go_dependencies():
"""The go dependencies in this macro are auto-updated by gazelle
To update run,
bazel run //:gazelle-update-repos
"""
pass
go_repository(
name = "com_github_aws_constructs_go_constructs_v10",
build_file_proto_mode = "disable_global",
importpath = "github.com/aws/constructs-go/constructs/v10",
sum = "h1:XW89VuKlwwzgU77Nyzj30SPn2SFtDYkzfF+QN84b5bQ=",
version = "v10.2.69",
)
go_repository(
name = "com_github_aws_jsii_runtime_go",
build_file_proto_mode = "disable_global",
importpath = "github.com/aws/jsii-runtime-go",
sum = "h1:C8BMeDgDz4IcDvgKFPMDt2OUGsTiANVu/YZGtwUoJqE=",
version = "v1.87.0",
)
go_repository(
name = "com_github_hashicorp_terraform_cdk_go_cdktf",
build_file_proto_mode = "disable_global",
importpath = "github.com/hashicorp/terraform-cdk-go/cdktf",
sum = "h1:rpgeX9zQ9jhHoBc/qKEoVOAP/iVhwPN463UyhZKTwy0=",
version = "v0.16.3",
)
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
module github.com/sourcegraph/controller-cdktf

go 1.20

require (
github.com/aws/jsii-runtime-go v1.87.0
github.com/hashicorp/terraform-cdk-go/cdktf v0.16.3
github.com/aws/constructs-go/constructs/v10 v10.2.69
)