Skip to content

Commit

Permalink
Update Bazel to 7.1.1 and rules_jvm_external to 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkumar9t2 committed May 6, 2024
1 parent 013103d commit 839b9ea
Show file tree
Hide file tree
Showing 8 changed files with 5,837 additions and 10,218 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ build --verbose_failures
# Action Env
build --incompatible_strict_action_env
build --repo_env=RJE_VERBOSE=true
common --noincompatible_disallow_unsound_directory_outputs

common --experimental_google_legacy_api

common --enable_bzlmod=false

# Workers
build --experimental_worker_multiplex

Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.2
7.1.1
1 change: 0 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
workspace(name = "grab_bazel_common")

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

bazel_common_dependencies()
Expand Down
16,029 changes: 5,824 additions & 10,205 deletions bazel_common_maven_install.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions rules/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ def http_archive(name, **kwargs):
maybe(_http_archive, name = name, **kwargs)

def _maven():
RULES_JVM_EXTERNAL_TAG = "4.4.2"
RULES_JVM_EXTERNAL_SHA = "735602f50813eb2ea93ca3f5e43b1959bd80b213b836a07a62a29d757670b77b"
RULES_JVM_EXTERNAL_TAG = "5.3"
RULES_JVM_EXTERNAL_SHA = "d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac"

http_archive(
name = "rules_jvm_external",
sha256 = RULES_JVM_EXTERNAL_SHA,
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG),
)

DAGGER_TAG = "2.46.1"
Expand Down
2 changes: 1 addition & 1 deletion rules/setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def bazel_common_setup(
"org.json:json:20210307",
],
repositories = DAGGER_REPOSITORIES + [
"https://jcenter.bintray.com/",
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
strict_visibility = True,
resolve_timeout = 3500,
maven_install_json = maven_install_json,
fetch_sources = True,
)
Expand Down
7 changes: 3 additions & 4 deletions tools/maven/src/main/kotlin/com/grab/maven/MavenInstallPin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ import java.io.File
class MavenInstallPin : CliktCommand() {

private val mavenRepoName by option(
"-M",
"-m",
"--maven_repo",
help = "Name of the maven_install repo to run pinning"
).required()

private val workingDir = System.getenv("BUILD_WORKSPACE_DIRECTORY")
?: error("Missing BUILD_WORKSPACE_DIRECTORY environment")
private val workingDir = System.getenv("BUILD_WORKSPACE_DIRECTORY") ?: error("Missing BUILD_WORKSPACE_DIRECTORY environment")

private val bazelInvoker = BazelInvokerFactory.create(workingDir = workingDir)


@Suppress("SameParameterValue")
private fun file(name: String) = File(workingDir, name)

override fun run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import java.io.File
class WorkspaceUpdater(
private val workspace: File
) {

private val pinnedMavenInstallAttr = "pinned_maven_install ="
private val pinBazelCommonArtifacts = "pin_bazel_common_artifacts()"
private val pinBazelCommonArtifacts = "pin_bazel_common_dependencies()"

fun pin() {
with(workspace) {
Expand All @@ -16,7 +15,7 @@ class WorkspaceUpdater(
"$pinnedMavenInstallAttr False",
"$pinnedMavenInstallAttr True"
).replace(
"#+pin_bazel_common_artifacts\\(\\)".toRegex(),
"#+pin_bazel_common_dependencies\\(\\)".toRegex(),
pinBazelCommonArtifacts
)
)
Expand Down

0 comments on commit 839b9ea

Please sign in to comment.