Skip to content

Commit

Permalink
gazelle + formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrikSD committed Dec 24, 2024
1 parent 4172bd3 commit 2788752
Show file tree
Hide file tree
Showing 27 changed files with 1,173 additions and 1,052 deletions.
3 changes: 3 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load("@gazelle//:def.bzl", "gazelle")

gazelle(name = "gazelle")
13 changes: 13 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ bazel_dep(name = "rules_jvm_external", version = "6.6")
bazel_dep(name = "contrib_rules_jvm", version = "0.27.0")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "gazelle", version = "0.37.0")

include("//infra/containers:containers.MODULE.bazel")

Expand All @@ -12,25 +13,37 @@ maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
# Version variables
# renovate: datasource=maven depName=com.google.inject:guice-bom
GUICE_VERSION = "7.0.0"

# renovate: datasource=maven depName=org.jboss.resteasy:resteasy-bom
RESTEASY_VERSION = "7.0.0.Alpha4"

# renovate: datasource=maven depName=org.eclipse.jetty:jetty-bom
JETTY_VERSION = "11.0.24"

# renovate: datasource=maven depName=org.glassfish.jersey:jersey-bom
JERSEY_VERSION = "4.0.0-M1"

# renovate: datasource=maven depName=org.flywaydb:flyway-core
FLYWAY_VERSION = "10.22.0"

# renovate: datasource=maven depName=com.fasterxml.jackson:jackson-bom
JACKSON_VERSION = "2.18.2"

# renovate: datasource=maven depName=org.jooq:jooq
JOOQ_VERSION = "3.19.15"

# renovate: datasource=maven depName=org.postgresql:postgresql
POSTGRES_VERSION = "42.7.4"

# renovate: datasource=maven depName=org.assertj:assertj-core
ASSERTJ_VERSION = "3.26.3"

JUNIT_VERSION = "5.10.3"

JUNIT_PLATFORM_VERSION = "1.10.3"

MOCKITO_VERSION = "5.12.0"

TESTCONTAINERS_VERSION = "1.19.8"

maven.install(
Expand Down
1,942 changes: 985 additions & 957 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion infra/containers/distroless/distroless.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ oci.pull(
"linux/arm64/v8",
"linux/s390x",
"linux/ppc64le",
]
],
)
use_repo(
oci,
Expand Down
5 changes: 2 additions & 3 deletions infra/containers/grafana/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ oci_image(
oci_load(
name = "load",
image = ":image",
repo_tags = ["grafana"]
repo_tags = ["grafana"],
)

oci_push(
name = "push",
image = ":image",
remote_tags = ["latest"],
repository = "ghcr.io/amriksd/grafana",
remote_tags = ["latest"]
)

5 changes: 2 additions & 3 deletions infra/containers/home-assistant/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ oci_image(
oci_load(
name = "load",
image = ":image",
repo_tags = ["home-assistant"]
repo_tags = ["home-assistant"],
)

oci_push(
name = "push",
image = ":image",
remote_tags = ["latest"],
repository = "ghcr.io/amriksd/home-assistant",
remote_tags = ["latest"]
)

8 changes: 6 additions & 2 deletions infra/containers/home-assistant/home-assistant.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ oci.pull(
digest = "sha256:e79a34c6093dcd730232d264c3ffc32dc09409f415a6cb0f8580cea148dfb6bf",
image = "docker.io/homeassistant/home-assistant",
platforms = [
"linux/arm64/v8", "linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/386"
"linux/arm64/v8",
"linux/amd64",
"linux/arm/v6",
"linux/arm/v7",
"linux/386",
],
)
use_repo(
oci,
"home-assistant",
"home-assistant_linux_386",
"home-assistant_linux_amd64",
"home-assistant_linux_arm64_v8",
"home-assistant_linux_arm_v6",
"home-assistant_linux_arm_v7",
"home-assistant_linux_arm64_v8",
)
2 changes: 1 addition & 1 deletion infra/containers/nginx/nginx.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ oci.pull(
"linux/mips64le",
"linux/ppc64le",
"linux/s390x",
]
],
)
use_repo(
oci,
Expand Down
5 changes: 2 additions & 3 deletions infra/containers/registry/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ oci_image(
oci_load(
name = "load",
image = ":image",
repo_tags = ["registry"]
repo_tags = ["registry"],
)

oci_push(
name = "push",
image = ":image",
remote_tags = ["latest"],
repository = "ghcr.io/amriksd/registry",
remote_tags = ["latest"]
)

27 changes: 27 additions & 0 deletions projects/Leetcode/Go/136-single-number/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "lib",
srcs = ["136-single-number.go"],
importpath = "",
visibility = ["//visibility:public"],
)

go_test(
name = "lib_test",
srcs = ["136-single-number_test.go"],
embed = [":lib"],
)

go_library(
name = "go_lib",
srcs = ["136-single-number.go"],
importpath = "github.com/amriksd/code/projects/Leetcode/go",
visibility = ["//visibility:public"],
)

go_test(
name = "go_test",
srcs = ["136-single-number_test.go"],
embed = [":go_lib"],
)
27 changes: 27 additions & 0 deletions projects/Leetcode/Go/1732-find-highest-altitude/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "lib",
srcs = ["1732-find-highest-altitude.go"],
importpath = "",
visibility = ["//visibility:public"],
)

go_test(
name = "lib_test",
srcs = ["1732-find-highest-altitude_test.go"],
embed = [":lib"],
)

go_library(
name = "go_lib",
srcs = ["1732-find-highest-altitude.go"],
importpath = "github.com/amriksd/code/projects/Leetcode/go",
visibility = ["//visibility:public"],
)

go_test(
name = "go_test",
srcs = ["1732-find-highest-altitude_test.go"],
embed = [":go_lib"],
)
4 changes: 2 additions & 2 deletions projects/Leetcode/Java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ filegroup(
name = "srcs",
srcs = glob(["**"]) + [
"//projects/Leetcode/Java/src/main/java/uk/co/amrik/leetcode:srcs",
"//projects/Leetcode/Java/src/test/java/uk/co/amrik/leetcode:srcs"
]
"//projects/Leetcode/Java/src/test/java/uk/co/amrik/leetcode:srcs",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ java_library(
java_binary(
name = "lc-binary",
main_class = "uk.co.amrik.leetcode.Leetcode",
runtime_deps = [":lc-library"]
runtime_deps = [":lc-library"],
)

filegroup(
Expand Down
24 changes: 10 additions & 14 deletions projects/Leetcode/Java/src/test/java/uk/co/amrik/leetcode/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,48 @@ java_test(
name = "LeetcodeTest",
srcs = ["LeetcodeTest.java"],
deps = [
"@maven//:junit_junit"
]
"@maven//:junit_junit",
],
)

java_test(
name = "TwoSumTest",
srcs = ["TwoSumTest.java"],

deps = [
"//projects/Leetcode/Java/src/main/java/uk/co/amrik/leetcode:lc-library",
"@maven//:junit_junit",
"@maven//:org_assertj_assertj_core"
]
"@maven//:org_assertj_assertj_core",
],
)

java_test(
name = "MergeAlternatelyTest",
srcs = ["MergeAlternatelyTest.java"],

deps = [
"//projects/Leetcode/Java/src/main/java/uk/co/amrik/leetcode:lc-library",
"@maven//:junit_junit",
"@maven//:org_assertj_assertj_core"
]
"@maven//:org_assertj_assertj_core",
],
)

java_test(
name = "MoveZerosTest",
srcs = ["MoveZerosTest.java"],

deps = [
"//projects/Leetcode/Java/src/main/java/uk/co/amrik/leetcode:lc-library",
"@maven//:junit_junit",
"@maven//:org_assertj_assertj_core"
]
"@maven//:org_assertj_assertj_core",
],
)

java_test(
name = "IsSubsequenceTest",
srcs = ["IsSubsequenceTest.java"],

deps = [
"//projects/Leetcode/Java/src/main/java/uk/co/amrik/leetcode:lc-library",
"@maven//:junit_junit",
"@maven//:org_assertj_assertj_core"
]
"@maven//:org_assertj_assertj_core",
],
)

filegroup(
Expand Down
2 changes: 1 addition & 1 deletion projects/steel/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain")
load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_test")

load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain")
default_java_toolchain(
name = "my_java_toolchain",
source_version = "21",
Expand Down
3 changes: 1 addition & 2 deletions projects/steel/src/main/java/uk/co/amrik/steel/API/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ filegroup(
srcs = glob(["**/*.java"]),
)


java_library(
name = "API",
srcs = [
":api_base",
],
deps = [
"@maven//:jakarta_platform_jakarta_jakartaee_web_api",
]
],
)
6 changes: 3 additions & 3 deletions projects/steel/src/main/java/uk/co/amrik/steel/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@rules_java//java:defs.bzl", "java_binary", "java_library")

package(default_visibility = ["//visibility:public"])

Expand All @@ -24,8 +24,8 @@ COMMON_DEPS = [

java_binary(
name = "ProjectSteel",
main_class = "uk.co.amrik.steel.Steel",
srcs = [":srcs"],
main_class = "uk.co.amrik.steel.Steel",
deps = [":steel_lib"] + COMMON_DEPS,
)

Expand All @@ -38,4 +38,4 @@ java_library(
filegroup(
name = "srcs",
srcs = ["BUILD"] + glob(["**/*.java"]),
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ filegroup(
name = "middleware_annotations",
srcs = glob(["annotations/**/*.java"]),
)

filegroup(
name = "middleware_filters",
srcs = glob(["filters/**/*.java"]),
)


java_library(
name = "middleware",
srcs = [
Expand All @@ -20,5 +20,5 @@ java_library(
],
deps = [
"@maven//:jakarta_platform_jakarta_jakartaee_web_api",
]
],
)
24 changes: 12 additions & 12 deletions projects/steel/src/main/java/uk/co/amrik/steel/order/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain")
load("@rules_java//java:defs.bzl", "java_library")

default_java_toolchain(
name = "my_java_toolchain",
Expand All @@ -22,21 +22,21 @@ filegroup(
java_library(
name = "order",
srcs = [
":order_api_v1",
":order_root",
":order_api_v1"
],
deps = [
"//projects/steel/src/main/java/uk/co/amrik/steel/persistence",
"//projects/steel/src/main/java/uk/co/amrik/steel/API",
"@maven//:com_google_inject_guice",
"//projects/steel/src/main/java/uk/co/amrik/steel/persistence",
"@maven//:com_google_inject_extensions_guice_servlet",
"@maven//:com_google_inject_guice",
"@maven//:jakarta_platform_jakarta_jakartaee_web_api",
"@maven//:org_glassfish_jersey_core_jersey_server",
"@maven//:org_glassfish_jersey_containers_jersey_container_servlet_core",
"@maven//:org_glassfish_jersey_core_jersey_server",
"@maven//:org_glassfish_jersey_inject_jersey_hk2",
"@maven//:org_glassfish_jersey_media_jersey_media_json_jackson",
"@maven//:org_jooq_jooq"
]
"@maven//:org_jooq_jooq",
],
)

filegroup(
Expand All @@ -48,13 +48,13 @@ java_library(
name = "order_test_lib",
srcs = [":order_test_srcs"],
deps = [
"//projects/steel/src/main/java/uk/co/amrik/steel/API",
"//projects/steel/src/main/java/uk/co/amrik/steel/order",
"//projects/steel/src/main/java/uk/co/amrik/steel/persistence",
"//projects/steel/src/main/java/uk/co/amrik/steel/API",
"@maven//:org_junit_jupiter_junit_jupiter_api",
"@maven//:org_junit_jupiter_junit_jupiter_engine",
"@maven//:com_google_inject_guice",
"@maven//:org_assertj_assertj_core",
"@maven//:org_jooq_jooq",
"@maven//:com_google_inject_guice"
"@maven//:org_junit_jupiter_junit_jupiter_api",
"@maven//:org_junit_jupiter_junit_jupiter_engine",
],
)
)
Loading

0 comments on commit 2788752

Please sign in to comment.