Skip to content

Commit

Permalink
chore(java-maven): upgrade to bzlmod (#332)
Browse files Browse the repository at this point in the history
Also add TODOs in the other WORKSPACE files I still need to migrate.
  • Loading branch information
alexeagle authored Oct 10, 2023
1 parent e504dc2 commit c024032
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
1 change: 1 addition & 0 deletions android/firebase-cloud-messaging/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# FIXME(alexeagle): move to bzlmod
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Requires ANDROID_HOME set to the path of your Android SDK.
Expand Down
1 change: 1 addition & 0 deletions android/jetpack-compose/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# FIXME(alexeagle): move to bzlmod
workspace(name = "bazel_android_sample_project")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand Down
1 change: 1 addition & 0 deletions android/ndk/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# FIXME(alexeagle): move to bzlmod
workspace(name = "bazel_android_sample_project")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand Down
1 change: 1 addition & 0 deletions android/robolectric-testing/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# FIXME(alexeagle): move to bzlmod
workspace(name = "bazel_android_sample_project")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand Down
1 change: 1 addition & 0 deletions java-maven/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --enable_bzlmod
1 change: 1 addition & 0 deletions java-maven/.bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.3.2
17 changes: 17 additions & 0 deletions java-maven/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"Bazel dependencies"

bazel_dep(name = "rules_jvm_external", version = "5.3")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
"junit:junit:4.12",
"com.google.guava:guava:28.0-jre",
],
fetch_sources = True,
repositories = [
"http://uk.maven.org/maven2",
"https://jcenter.bintray.com/",
],
)
use_repo(maven, "maven")
27 changes: 1 addition & 26 deletions java-maven/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_JVM_EXTERNAL_TAG = "2.5"

RULES_JVM_EXTERNAL_SHA = "249e8129914be6d987ca57754516be35a14ea866c616041ff0cd32ea94d2f3a1"

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,
)

load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
artifacts = [
"junit:junit:4.12",
"com.google.guava:guava:28.0-jre",
],
fetch_sources = True,
repositories = [
"http://uk.maven.org/maven2",
"https://jcenter.bintray.com/",
],
)
# Marker file that this is the root of a Bazel workspace.
2 changes: 2 additions & 0 deletions java-tutorial/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This directory contains the sources for an example project as part of the Java Tutorial found at
<https://bazel.build/start/java>.

0 comments on commit c024032

Please sign in to comment.