Skip to content

Commit

Permalink
Update dependencies and unify rules under //rules (#114)
Browse files Browse the repository at this point in the history
Fixes #114
  • Loading branch information
arunkumar9t2 committed Oct 19, 2023
1 parent 78a0a8a commit fa25ce9
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.0
6.3.2
File renamed without changes.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ bazel_common_dependencies()

load("@grab_bazel_common//android:initialize.bzl", "bazel_common_initialize")

bazel_common_initialize(
bazel_common_setup(
patched_android_tools = True, # Optionally use patched android_tools jars
buildifier_version = "5.1.0",
buildifier_version = "6.3.3",
)

load("@grab_bazel_common//android:maven.bzl", "pin_bazel_common_artifacts")
load("@grab_bazel_common//android:maven.bzl", "pin_bazel_common_dependencies")

pin_bazel_common_artifacts()
pin_bazel_common_dependencies()

load("@grab_bazel_common//:workspace_defs.bzl", "GRAB_BAZEL_COMMON_ARTIFACTS")

Expand Down
14 changes: 7 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
workspace(name = "grab_bazel_common")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@grab_bazel_common//android:repositories.bzl", "bazel_common_dependencies")
load("@grab_bazel_common//rules:repositories.bzl", "bazel_common_dependencies")

bazel_common_dependencies()

load("@grab_bazel_common//android:initialize.bzl", "bazel_common_initialize")
load("@grab_bazel_common//rules:setup.bzl", "bazel_common_setup")

bazel_common_initialize(
buildifier_version = "6.0.1",
bazel_common_setup(
buildifier_version = "6.3.3",
pinned_maven_install = True,
)

load("@grab_bazel_common//android:maven.bzl", "pin_bazel_common_artifacts")
load("@grab_bazel_common//rules:maven.bzl", "pin_bazel_common_dependencies")

pin_bazel_common_artifacts()
pin_bazel_common_dependencies()

android_sdk_repository(
name = "androidsdk",
Expand All @@ -23,7 +23,7 @@ android_sdk_repository(
load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@grab_bazel_common//:workspace_defs.bzl", "GRAB_BAZEL_COMMON_ARTIFACTS")

# Artifacts that need to be present on the consumer under @maven. They can be overriden
# Artifacts that need to be present on the consumer under @maven. They can be overridden
# by the consumer's maven_install rule.
maven_install(
artifacts = GRAB_BAZEL_COMMON_ARTIFACTS,
Expand Down
2 changes: 1 addition & 1 deletion android/maven.bzl → rules/maven.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@bazel_common_maven//:defs.bzl", _pinned_maven_install = "pinned_maven_install")

def pin_bazel_common_artifacts():
def pin_bazel_common_dependencies():
_pinned_maven_install()
4 changes: 2 additions & 2 deletions android/repositories.bzl → rules/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def _maven():
)

def _kotlin():
RULES_KOTLIN_VERSION = "1.8-RC-12"
RULES_KOTLIN_VERSION = "1.8.1"

RULES_KOTLIN_SHA = "8e5c8ab087e0fa3fbb58e1f6b99d8fe40f75bac44994c3d208eba723284465d6"
RULES_KOTLIN_SHA = "a630cda9fdb4f56cf2dc20a4bf873765c41cf00e9379e8d59cd07b24730f4fde"

http_archive(
name = "io_bazel_rules_kotlin",
Expand Down
12 changes: 11 additions & 1 deletion android/initialize.bzl → rules/setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@ load(
"register_common_toolchains",
_buildifier_version = "buildifier_version",
)

# Internal
load("@grab_bazel_common//:workspace_defs.bzl", "GRAB_BAZEL_COMMON_ARTIFACTS")
load("@grab_bazel_common//tools/buildifier:defs.bzl", "BUILDIFIER_DEFAULT_VERSION")
load("@grab_bazel_common//android/tools:defs.bzl", "android_tools")

# Dagger
load("@bazel_common_dagger//:workspace_defs.bzl", "DAGGER_ARTIFACTS", "DAGGER_REPOSITORIES")

# Rules Jvm External
load("@rules_jvm_external//:defs.bzl", "maven_install")

# Kotlin
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "kotlinc_version")

# Proto
# load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")

# Setup android databinding compilation and optionally use patched android tools jar
Expand All @@ -29,7 +39,7 @@ def _kotlin():
)
native.register_toolchains("//:kotlin_toolchain")

def bazel_common_initialize(
def bazel_common_setup(
patched_android_tools = True,
buildifier_version = BUILDIFIER_DEFAULT_VERSION,
pinned_maven_install = True):
Expand Down
4 changes: 2 additions & 2 deletions tools/buildifier/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.
""""""

BUILDIFIER_DEFAULT_VERSION = "5.1.0"
BUILDIFIER_RELEASE_URL_TEMPLATE = "https://github.com/bazelbuild/buildtools/releases/download/{version}/buildifier-{os}-{arch}"
BUILDIFIER_DEFAULT_VERSION = "6.3.3"
BUILDIFIER_RELEASE_URL_TEMPLATE = "https://github.com/bazelbuild/buildtools/releases/download/v{version}/buildifier-{os}-{arch}"

BuildifierVersionInfo = provider(
"Provides information about the buildifier release",
Expand Down

0 comments on commit fa25ce9

Please sign in to comment.