Skip to content

Commit

Permalink
Fix #3324: Created BUILD.bazel in oppialogger inside domain module (#…
Browse files Browse the repository at this point in the history
…3739)

* made build bazel files

* created build bazel files

* Update BUILD.bazel

* Update BUILD.bazel

* Update BUILD.bazel

* changed visibility

* revert changes

* add deps

* change deps

* add deps

* done changes

* Update domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/BUILD.bazel

Co-authored-by: Ben Henning <[email protected]>

* Update domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions/BUILD.bazel

Co-authored-by: Ben Henning <[email protected]>

Co-authored-by: Ben Henning <[email protected]>
  • Loading branch information
deepanshu731 and BenHenning authored Sep 27, 2021
1 parent baf7fd2 commit 15a7772
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,9 @@ kt_android_library(
":views",
"//data/src/main/java/org/oppia/android/data/backends/gae:network_config_prod_module",
"//data/src/main/java/org/oppia/android/data/backends/gae:prod_module",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:startup_listener",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions:logger_module",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/loguploader:worker_module",
"//model:arguments_java_proto_lite",
"//third_party:androidx_databinding_databinding-adapters",
"//third_party:androidx_databinding_databinding-common",
Expand Down
8 changes: 8 additions & 0 deletions domain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ load("//domain:domain_test.bzl", "domain_test")
# top-level module library.
MIGRATED_PROD_FILES = glob([
"src/main/java/org/oppia/android/domain/feedbackreporting/*.kt",
"src/main/java/org/oppia/android/domain/oppialogger/**/*.kt",
"src/main/java/org/oppia/android/domain/util/*.kt",
])

Expand Down Expand Up @@ -82,6 +83,10 @@ kt_android_library(
":dagger",
"//data/src/main/java/org/oppia/android/data/backends/gae/api",
"//data/src/main/java/org/oppia/android/data/persistence:cache_store",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:oppia_logger",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:startup_listener",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions:controller",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/loguploader:worker_factory",
"//domain/src/main/java/org/oppia/android/domain/util:asset",
"//domain/src/main/java/org/oppia/android/domain/util:extensions",
"//domain/src/main/java/org/oppia/android/domain/util:retriever",
Expand Down Expand Up @@ -134,6 +139,9 @@ TEST_DEPS = [
"//data/src/main/java/org/oppia/android/data/persistence:cache_store",
"//domain/src/main/java/org/oppia/android/domain/feedbackreporting:prod_module",
"//domain/src/main/java/org/oppia/android/domain/feedbackreporting:report_schema_version",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions:startup_listener",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/loguploader:worker_factory",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/loguploader:worker_module",
"//testing",
"//testing/src/main/java/org/oppia/android/testing/network:network",
"//testing/src/main/java/org/oppia/android/testing/network:test_module",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""
Package for providing logging support.
"""

load("@dagger//:workspace_defs.bzl", "dagger_rules")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")

kt_android_library(
name = "oppia_logger",
srcs = [
"OppiaLogger.kt",
],
visibility = ["//domain:__pkg__"],
deps = [
"//domain/src/main/java/org/oppia/android/domain/oppialogger/analytics:controller",
"//model:event_logger_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger",
],
)

kt_android_library(
name = "startup_listener",
srcs = [
"ApplicationStartupListener.kt",
],
visibility = ["//:oppia_api_visibility"],
)

kt_android_library(
name = "storage_module",
srcs = [
"LogStorageModule.kt",
],
visibility = ["//domain/src/main/java/org/oppia/android/domain/oppialogger:__subpackages__"],
deps = [
":dagger",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Package for providing logging support for analytics events.
"""

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")

kt_android_library(
name = "controller",
srcs = [
"AnalyticsController.kt",
],
visibility = ["//domain/src/main/java/org/oppia/android/domain/oppialogger:__subpackages__"],
deps = [
"//data/src/main/java/org/oppia/android/data/persistence:cache_store",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:storage_module",
"//model:event_logger_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/data:data_provider",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger",
"//utility/src/main/java/org/oppia/android/util/logging:event_logger",
"//utility/src/main/java/org/oppia/android/util/logging:exception_logger",
"//utility/src/main/java/org/oppia/android/util/networking:network_connection_util",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""
Package for providing logging support for exceptions.
"""

load("@dagger//:workspace_defs.bzl", "dagger_rules")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")

kt_android_library(
name = "controller",
srcs = [
"ExceptionsController.kt",
],
visibility = ["//domain:__subpackages__"],
deps = [
"//data/src/main/java/org/oppia/android/data/persistence:cache_store",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:storage_module",
"//model:event_logger_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/data:data_provider",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger",
"//utility/src/main/java/org/oppia/android/util/logging:exception_logger",
"//utility/src/main/java/org/oppia/android/util/networking:network_connection_util",
"//utility/src/main/java/org/oppia/android/util/system:oppia_clock",
],
)

kt_android_library(
name = "logger_module",
srcs = [
"UncaughtExceptionLoggerModule.kt",
],
visibility = ["//:oppia_api_visibility"],
deps = [
":dagger",
":startup_listener",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:startup_listener",
],
)

kt_android_library(
name = "startup_listener",
srcs = [
"UncaughtExceptionLoggerStartupListener.kt",
],
visibility = ["//:oppia_testing_visibility"],
deps = [
":controller",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:startup_listener",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
"""
Package for providing log uploading functionality.
"""

load("@dagger//:workspace_defs.bzl", "dagger_rules")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")

kt_android_library(
name = "initializer",
srcs = [
"LogUploadWorkManagerInitializer.kt",
],
deps = [
":worker",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:startup_listener",
"//third_party:androidx_work_work-runtime-ktx",
"//utility/src/main/java/org/oppia/android/util/logging:log_uploader",
],
)

kt_android_library(
name = "worker",
srcs = [
"LogUploadWorker.kt",
],
deps = [
"//domain/src/main/java/org/oppia/android/domain/oppialogger/analytics:controller",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions:controller",
"//third_party:androidx_work_work-runtime-ktx",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger",
"//utility/src/main/java/org/oppia/android/util/logging:event_logger",
"//utility/src/main/java/org/oppia/android/util/logging:exception_logger",
"//utility/src/main/java/org/oppia/android/util/threading:annotations",
],
)

kt_android_library(
name = "worker_factory",
srcs = [
"LogUploadWorkerFactory.kt",
],
visibility = ["//domain:__pkg__"],
deps = [
":worker",
"//third_party:androidx_work_work-runtime-ktx",
],
)

kt_android_library(
name = "worker_module",
srcs = [
"LogUploadWorkerModule.kt",
],
visibility = ["//:oppia_api_visibility"],
deps = [
":dagger",
":initializer",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:startup_listener",
],
)

dagger_rules()

0 comments on commit 15a7772

Please sign in to comment.