Skip to content

Commit

Permalink
Run buildifier --lint=fix -r . (#126)
Browse files Browse the repository at this point in the history
This fixes future Bazel incompatibilities.
Updated WORKSPACE files manually.
  • Loading branch information
laurentlb authored Oct 22, 2019
1 parent cc4b351 commit 7f1b8f1
Show file tree
Hide file tree
Showing 22 changed files with 92 additions and 18 deletions.
33 changes: 26 additions & 7 deletions android/firebase-cloud-messaging/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Requires ANDROID_HOME set to the path of your Android SDK.
android_sdk_repository(
name = "androidsdk",
name = "androidsdk",
)

RULES_JVM_EXTERNAL_TAG = "2.8"

RULES_JVM_EXTERNAL_SHA = "79c9850690d7614ecdb72d68394f994fef7534b292c4867ce5e7dec0aa7bdfad"

http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
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,
)

Expand All @@ -23,19 +24,37 @@ maven_install(
"com.android.support:appcompat-v7:26.1.0",
"com.android.support.constraint:constraint-layout:1.0.2",
],
fetch_sources = True,
repositories = [
"https://jcenter.bintray.com/",
"https://maven.google.com",
],
fetch_sources = True,
)

TOOLS_ANDROID_COMMIT = "0e864ba5a86958513658250de587416d8e17c481"

http_archive(
name = "tools_android",
strip_prefix = "tools_android-" + TOOLS_ANDROID_COMMIT,
url = "https://github.com/bazelbuild/tools_android/archive/%s.tar.gz" % TOOLS_ANDROID_COMMIT,
sha256 = "57c50d6331ba578fc8adfcede20ef12b437cb4cc2edf60c852e4b834eefee5fc",
name = "tools_android",
sha256 = "57c50d6331ba578fc8adfcede20ef12b437cb4cc2edf60c852e4b834eefee5fc",
strip_prefix = "tools_android-" + TOOLS_ANDROID_COMMIT,
url = "https://github.com/bazelbuild/tools_android/archive/%s.tar.gz" % TOOLS_ANDROID_COMMIT,
)

load("@tools_android//tools/googleservices:defs.bzl", "google_services_workspace_dependencies")

google_services_workspace_dependencies()

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_android",
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
strip_prefix = "rules_android-0.1.1",
)

http_archive(
name = "rules_cc",
url = "https://github.com/bazelbuild/rules_cc/archive/624b5d59dfb45672d4239422fa1e3de1822ee110.zip",
sha256 = "8c7e8bf24a2bf515713445199a677ee2336e1c487fa1da41037c6026de04bbc3",
strip_prefix = "rules_cc-624b5d59dfb45672d4239422fa1e3de1822ee110",
)
1 change: 1 addition & 0 deletions android/firebase-cloud-messaging/app/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_android//android:rules.bzl", "android_binary")
load("@tools_android//tools/googleservices:defs.bzl", "google_services_xml")

GOOGLE_SERVICES_XML = google_services_xml(
Expand Down
8 changes: 8 additions & 0 deletions android/ndk/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ android_ndk_repository(name = "androidndk")
GMAVEN_TAG = "20180625-1"

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

http_archive(
name = "gmaven_rules",
strip_prefix = "gmaven_rules-%s" % GMAVEN_TAG,
Expand All @@ -15,3 +16,10 @@ http_archive(
load("@gmaven_rules//:gmaven.bzl", "gmaven_rules")

gmaven_rules()

http_archive(
name = "rules_android",
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
strip_prefix = "rules_android-0.1.1",
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
)
2 changes: 2 additions & 0 deletions android/ndk/app/src/main/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_android//android:rules.bzl", "android_binary", "android_library")
load("@gmaven_rules//:defs.bzl", "gmaven_artifact")

android_library(
Expand Down
2 changes: 2 additions & 0 deletions cpp-tutorial/stage1/main/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")

cc_binary(
name = "hello-world",
srcs = ["hello-world.cc"],
Expand Down
2 changes: 2 additions & 0 deletions cpp-tutorial/stage2/main/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

cc_library(
name = "hello-greet",
srcs = ["hello-greet.cc"],
Expand Down
2 changes: 2 additions & 0 deletions cpp-tutorial/stage3/lib/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "hello-time",
srcs = ["hello-time.cc"],
Expand Down
2 changes: 2 additions & 0 deletions cpp-tutorial/stage3/main/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

cc_library(
name = "hello-greet",
srcs = ["hello-greet.cc"],
Expand Down
4 changes: 3 additions & 1 deletion java-maven/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_test")

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

java_library(
Expand All @@ -18,7 +20,7 @@ java_test(
test_class = "com.example.myproject.TestApp",
deps = [
":java-maven-lib",
"@maven//:junit_junit",
"@maven//:com_google_guava_guava",
"@maven//:junit_junit",
],
)
5 changes: 3 additions & 2 deletions java-maven/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
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,
)

Expand All @@ -17,9 +18,9 @@ maven_install(
"junit:junit:4.12",
"com.google.guava:guava:28.0-jre",
],
fetch_sources = True,
repositories = [
"http://uk.maven.org/maven2",
"https://jcenter.bintray.com/",
],
fetch_sources = True,
)
2 changes: 2 additions & 0 deletions java-tutorial/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_binary")

java_binary(
name = "ProjectRunner",
srcs = glob(["src/main/java/com/example/*.java"]),
Expand Down
2 changes: 2 additions & 0 deletions java-tutorial/src/main/java/com/example/cmdline/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_binary")

java_binary(
name = "runner",
srcs = ["Runner.java"],
Expand Down
16 changes: 16 additions & 0 deletions rules/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "rules_python",
sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.1/rules_python-0.0.1.tar.gz",
)

load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

# Only needed if using the packaging rules.
load("@rules_python//python:pip.bzl", "pip_repositories")

pip_repositories()
6 changes: 3 additions & 3 deletions rules/actions_run/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ sh_binary(
config_setting(
name = "on_linux",
constraint_values = [
"@platforms//os:linux"
"@platforms//os:linux",
],
)

config_setting(
name = "on_windows",
constraint_values = [
"@platforms//os:windows"
"@platforms//os:windows",
],
)
)
1 change: 1 addition & 0 deletions rules/aspect/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load(":file_collector.bzl", "file_collector")

cc_library(
Expand Down
1 change: 1 addition & 0 deletions rules/depsets/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_python//python:defs.bzl", "py_binary")
load(":foo.bzl", "foo_binary", "foo_library")

# Our hypothetical Foo compiler.
Expand Down
1 change: 1 addition & 0 deletions rules/expand_template/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")
load("//expand_template:hello.bzl", "hello")

# Generates a C++ source file that says "Hello John!".
Expand Down
2 changes: 1 addition & 1 deletion rules/shell_command/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Build with:
# bazel build //shell_command:*

load(":rules.bzl", "emit_size", "convert_to_uppercase")
load(":rules.bzl", "convert_to_uppercase", "emit_size")

emit_size(
name = "foo",
Expand Down
10 changes: 8 additions & 2 deletions tutorial/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

http_archive(
name = "build_bazel_rules_apple",
strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3",
sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e",
strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3",
url = "https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz",
)

Expand Down Expand Up @@ -44,3 +43,10 @@ load(
java_appengine_repositories()

android_sdk_repository(name = "androidsdk")

http_archive(
name = "rules_android",
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
strip_prefix = "rules_android-0.1.1",
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
)
2 changes: 2 additions & 0 deletions tutorial/android/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_android//android:rules.bzl", "android_binary", "android_library")

# The final binary rule, which builds the APK and sets the application manifest,
# as well as any other resources needed by the application.
# The package for the R class for resources is normally inferred from the
Expand Down
1 change: 1 addition & 0 deletions tutorial/backend/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_binary")
load("@io_bazel_rules_appengine//appengine:appengine.bzl", "appengine_war")

package(default_visibility = ["//visibility:public"])
Expand Down
5 changes: 3 additions & 2 deletions tutorial/ios-app/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_cc//cc:defs.bzl", "objc_library")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application")

objc_library(
Expand All @@ -18,8 +19,8 @@ ios_application(
"ipad",
],
infoplists = [":UrlGet/UrlGet-Info.plist"],
launch_storyboard = "UrlGet/UrlGetViewController.xib",
minimum_os_version = "8.0",
visibility = ["//visibility:public"],
deps = [":UrlGetClasses"],
minimum_os_version = "8.0",
launch_storyboard = "UrlGet/UrlGetViewController.xib",
)

0 comments on commit 7f1b8f1

Please sign in to comment.