Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into new-onboarding-s…
Browse files Browse the repository at this point in the history
…creen

# Conflicts:
#	app/src/sharedTest/java/org/oppia/android/app/databinding/BUILD.bazel
  • Loading branch information
adhiamboperes committed Jun 2, 2024
2 parents 7c69c15 + 3c7713d commit 0a7c600
Show file tree
Hide file tree
Showing 487 changed files with 8,642 additions and 16,595 deletions.
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# TODO(#1532): Rename file to 'BUILD' post-Gradle.

load("@dagger//:workspace_defs.bzl", "dagger_rules")
load("//:build_flavors.bzl", "AVAILABLE_FLAVORS", "define_oppia_aab_binary_flavor", "transform_android_manifest")
load("//:version.bzl", "MAJOR_VERSION", "MINOR_VERSION", "OPPIA_DEV_KITKAT_VERSION_CODE", "OPPIA_DEV_VERSION_CODE")

Expand Down Expand Up @@ -137,3 +138,5 @@ package_group(
define_oppia_aab_binary_flavor(flavor = flavor)
for flavor in AVAILABLE_FLAVORS
]

dagger_rules()
60 changes: 44 additions & 16 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file lists and imports all external dependencies needed to build Oppia Andr

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
load("//third_party:versions.bzl", "HTTP_DEPENDENCY_VERSIONS", "get_maven_dependencies")
load("//third_party:versions.bzl", "HTTP_DEPENDENCY_VERSIONS", "MAVEN_REPOSITORIES", "get_maven_dependencies")

# Android SDK configuration. For more details, see:
# https://docs.bazel.build/versions/master/be/android.html#android_sdk_repository
Expand All @@ -15,6 +15,22 @@ android_sdk_repository(
build_tools_version = "29.0.2",
)

# Oppia's backend proto API definitions.
git_repository(
name = "oppia_proto_api",
commit = HTTP_DEPENDENCY_VERSIONS["oppia_proto_api"]["version"],
remote = "https://github.com/oppia/oppia-proto-api",
shallow_since = "1716846301 -0700",
)

load("@oppia_proto_api//repo:deps.bzl", "initializeDepsForWorkspace")

initializeDepsForWorkspace()

load("@oppia_proto_api//repo:toolchains.bzl", "initializeToolchainsForWorkspace")

initializeToolchainsForWorkspace()

# Add support for JVM rules: https://github.com/bazelbuild/rules_jvm_external
http_archive(
name = "rules_jvm_external",
Expand All @@ -30,15 +46,12 @@ http_archive(
urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % HTTP_DEPENDENCY_VERSIONS["rules_kotlin"]["version"]],
)

# TODO(#1535): Remove once rules_kotlin is released because these lines become unnecessary
load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")

kt_download_local_dev_dependencies()

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")

kotlin_repositories()

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

kt_register_toolchains()

# The proto_compiler and proto_java_toolchain bindings load the protos rules needed for the model
Expand Down Expand Up @@ -96,8 +109,9 @@ load("@dagger//:workspace_defs.bzl", "DAGGER_ARTIFACTS", "DAGGER_REPOSITORIES")
# Add support for Robolectric: https://github.com/robolectric/robolectric-bazel
http_archive(
name = "robolectric",
strip_prefix = "robolectric-bazel-4.5",
urls = ["https://github.com/robolectric/robolectric-bazel/archive/4.5.tar.gz"],
sha256 = HTTP_DEPENDENCY_VERSIONS["robolectric"]["sha"],
strip_prefix = "robolectric-bazel-%s" % HTTP_DEPENDENCY_VERSIONS["robolectric"]["version"],
urls = ["https://github.com/robolectric/robolectric-bazel/archive/%s.tar.gz" % HTTP_DEPENDENCY_VERSIONS["robolectric"]["version"]],
)

load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")
Expand All @@ -109,6 +123,7 @@ git_repository(
name = "tools_android",
commit = "00e6f4b7bdd75911e33c618a9bc57bab7a6e8930",
remote = "https://github.com/bazelbuild/tools_android",
shallow_since = "1594238320 -0400",
)

load("@tools_android//tools/googleservices:defs.bzl", "google_services_workspace_dependencies")
Expand Down Expand Up @@ -137,7 +152,7 @@ git_repository(
name = "kotlitex",
commit = "43139c140833c7120f351d63d74b42c253d2b213",
remote = "https://github.com/oppia/kotlitex",
shallow_since = "1647554845 -0700",
shallow_since = "1675741075 -0800",
)

bind(
Expand All @@ -147,6 +162,7 @@ bind(

http_archive(
name = "protobuf_tools",
sha256 = HTTP_DEPENDENCY_VERSIONS["protobuf_tools"]["sha"],
strip_prefix = "protobuf-%s" % HTTP_DEPENDENCY_VERSIONS["protobuf_tools"]["version"],
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v{0}/protobuf-all-{0}.zip".format(HTTP_DEPENDENCY_VERSIONS["protobuf_tools"]["version"])],
)
Expand Down Expand Up @@ -178,16 +194,28 @@ http_jar(
# Note to developers: new dependencies should be added to //third_party:versions.bzl, not here.
maven_install(
artifacts = DAGGER_ARTIFACTS + get_maven_dependencies(),
duplicate_version_warning = "error",
fail_if_repin_required = True,
fetch_sources = True,
maven_install_json = "//third_party:maven_install.json",
repositories = DAGGER_REPOSITORIES + [
"https://maven.fabric.io/public",
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
override_targets = {
"com.google.guava:guava": "@//third_party:com_google_guava_guava",
},
repositories = DAGGER_REPOSITORIES + MAVEN_REPOSITORIES,
strict_visibility = True,
)

load("@maven//:defs.bzl", "pinned_maven_install")

pinned_maven_install()

http_jar(
name = "guava_android",
sha256 = HTTP_DEPENDENCY_VERSIONS["guava_android"]["sha"],
urls = [
"{0}/com/google/guava/guava/{1}-android/guava-{1}-android.jar".format(
url_base,
HTTP_DEPENDENCY_VERSIONS["guava_android"]["version"],
)
for url_base in DAGGER_REPOSITORIES + MAVEN_REPOSITORIES
],
)
13 changes: 3 additions & 10 deletions app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ order to build with Bazel.
- All binding adapters must be written in Java.
"""

load("@dagger//:workspace_defs.bzl", "dagger_rules")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@tools_android//tools/crashlytics:defs.bzl", "crashlytics_android_library")
load("@tools_android//tools/googleservices:defs.bzl", "google_services_xml")
load("//app:app_test.bzl", "app_test")
Expand Down Expand Up @@ -628,7 +627,6 @@ kt_android_library(
srcs = LISTENERS,
custom_package = "org.oppia.android.app",
deps = [
":dagger",
"//domain/src/main/java/org/oppia/android/domain/audio:cellular_audio_dialog_controller",
"//model/src/main/proto:arguments_java_proto_lite",
"//model/src/main/proto:question_java_proto_lite",
Expand Down Expand Up @@ -673,7 +671,6 @@ kt_android_library(
srcs = ANNOTATIONS,
custom_package = "org.oppia.android.app",
deps = [
":dagger",
"//app/src/main/java/org/oppia/android/app/activity:activity_scope",
"//app/src/main/java/org/oppia/android/app/fragment:fragment_scope",
],
Expand All @@ -691,7 +688,6 @@ kt_android_library(
],
deps = [
":annotations",
":dagger",
":listeners",
":resources",
"//app/src/main/java/org/oppia/android/app/shim:intent_factory_shim",
Expand Down Expand Up @@ -735,7 +731,6 @@ android_library(
enable_data_binding = True,
manifest = "src/main/DatabindingAdaptersManifest.xml",
deps = [
":dagger",
":resources",
":view_models",
"//app/src/main/java/org/oppia/android/app/translation:app_language_activity_injector_provider",
Expand Down Expand Up @@ -772,11 +767,11 @@ kt_android_library(
visibility = ["//visibility:public"],
deps = [
":binding_adapters",
":dagger",
":databinding_resources",
":resources",
":view_models",
":views",
"//:dagger",
"//app/src/main/java/org/oppia/android/app/activity:activity_intent_factories_shim",
"//app/src/main/java/org/oppia/android/app/activity:injectable_auto_localized_app_compat_activity",
"//app/src/main/java/org/oppia/android/app/activity:injectable_system_localized_app_compat_activity",
Expand Down Expand Up @@ -852,9 +847,9 @@ kt_android_library(
# keep sorted
TEST_DEPS = [
":app",
":dagger",
":resources",
":test_deps",
"//:dagger",
"//app/src/main/java/org/oppia/android/app/application:application_component",
"//app/src/main/java/org/oppia/android/app/application:application_injector",
"//app/src/main/java/org/oppia/android/app/application:application_injector_provider",
Expand Down Expand Up @@ -1024,5 +1019,3 @@ android_library(
"//third_party:org_checkerframework_checker-qual",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Constructs for setting up activities for injection in the Dagger graph.
"""

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

# TODO(#59): Define these exported files as separate libraries from top-level targets.
exports_files([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
Constructs for setting up activity routing support in the Dagger graph.
"""

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

# TODO(#59): Define these exported files as separate libraries from top-level targets.
exports_files([
Expand All @@ -19,11 +18,9 @@ kt_android_library(
],
visibility = ["//:oppia_api_visibility"],
deps = [
":dagger",
"//:dagger",
"//model/src/main/proto:arguments_java_proto_lite",
"//third_party:androidx_appcompat_appcompat",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Dagger graph.
Specific application implementations can be found in subpackages.
"""

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

kt_android_library(
name = "abstract_application",
Expand Down Expand Up @@ -82,7 +81,6 @@ kt_android_library(
"ApplicationStartupListenerModule.kt",
],
deps = [
":dagger",
"//app",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:startup_listener",
],
Expand Down Expand Up @@ -134,5 +132,3 @@ android_library(
"//utility/src/main/java/org/oppia/android/util/parser/image:repository_glide_module",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import org.oppia.android.domain.platformparameter.PlatformParameterAlphaModule
import org.oppia.android.domain.platformparameter.PlatformParameterSingletonModule
import org.oppia.android.domain.platformparameter.syncup.PlatformParameterSyncUpWorkerModule
import org.oppia.android.domain.question.QuestionModule
import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule
import org.oppia.android.domain.workmanager.WorkManagerConfigurationModule
import org.oppia.android.util.accessibility.AccessibilityProdModule
import org.oppia.android.util.caching.AssetModule
Expand Down Expand Up @@ -82,7 +81,7 @@ import javax.inject.Singleton
ImageParsingModule::class, HtmlParserEntityTypeModule::class, CachingModule::class,
QuestionModule::class, AccessibilityProdModule::class, ImageClickInputModule::class,
LogStorageModule::class, IntentFactoryShimModule::class, ViewBindingShimModule::class,
PrimeTopicAssetsControllerModule::class, ExpirationMetaDataRetrieverModule::class,
ExpirationMetaDataRetrieverModule::class,
RatioInputModule::class, UncaughtExceptionLoggerModule::class,
ApplicationStartupListenerModule::class, LogReportWorkerModule::class,
WorkManagerConfigurationModule::class, HintsAndSolutionConfigModule::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
This package contains the root application definitions for alpha builds of the app.
"""

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

kt_android_library(
name = "alpha_application",
Expand All @@ -14,7 +13,7 @@ kt_android_library(
visibility = ["//:oppia_binary_visibility"],
deps = [
":alpha_build_flavor_module",
":dagger",
"//:dagger",
"//app",
"//app/src/main/java/org/oppia/android/app/application:abstract_application",
"//app/src/main/java/org/oppia/android/app/application:application_component",
Expand All @@ -36,9 +35,7 @@ kt_android_library(
"//app/src/test/java/org/oppia/android/app/application/alpha:__pkg__",
],
deps = [
":dagger",
"//:dagger",
"//model/src/main/proto:version_java_proto_lite",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import org.oppia.android.domain.platformparameter.PlatformParameterAlphaKenyaMod
import org.oppia.android.domain.platformparameter.PlatformParameterSingletonModule
import org.oppia.android.domain.platformparameter.syncup.PlatformParameterSyncUpWorkerModule
import org.oppia.android.domain.question.QuestionModule
import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule
import org.oppia.android.domain.workmanager.WorkManagerConfigurationModule
import org.oppia.android.util.accessibility.AccessibilityProdModule
import org.oppia.android.util.caching.AssetModule
Expand Down Expand Up @@ -83,7 +82,7 @@ import javax.inject.Singleton
ImageParsingModule::class, HtmlParserEntityTypeModule::class, CachingModule::class,
QuestionModule::class, AccessibilityProdModule::class, ImageClickInputModule::class,
LogStorageModule::class, IntentFactoryShimModule::class, ViewBindingShimModule::class,
PrimeTopicAssetsControllerModule::class, ExpirationMetaDataRetrieverModule::class,
ExpirationMetaDataRetrieverModule::class,
RatioInputModule::class, UncaughtExceptionLoggerModule::class,
ApplicationStartupListenerModule::class, LogReportWorkerModule::class,
WorkManagerConfigurationModule::class, HintsAndSolutionConfigAlphaKenyaModule::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ This package contains the root application definitions for a Kenya user study sp
of the app.
"""

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

kt_android_library(
name = "alpha_kenya_application",
Expand All @@ -14,7 +13,7 @@ kt_android_library(
],
visibility = ["//:oppia_binary_visibility"],
deps = [
":dagger",
"//:dagger",
"//app",
"//app/src/main/java/org/oppia/android/app/application:abstract_application",
"//app/src/main/java/org/oppia/android/app/application:application_component",
Expand All @@ -26,5 +25,3 @@ kt_android_library(
"//utility/src/main/java/org/oppia/android/util/networking:prod_module",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
This package contains the root application definitions for beta builds of the app.
"""

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

kt_android_library(
name = "beta_application",
Expand All @@ -17,7 +16,7 @@ kt_android_library(
"//app/src/test/java/org/oppia/android/app/application/beta:__pkg__",
],
deps = [
":dagger",
"//:dagger",
"//app",
"//app/src/main/java/org/oppia/android/app/application:abstract_application",
"//app/src/main/java/org/oppia/android/app/application:application_component",
Expand All @@ -28,5 +27,3 @@ kt_android_library(
"//utility/src/main/java/org/oppia/android/util/networking:prod_module",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import org.oppia.android.domain.platformparameter.PlatformParameterModule
import org.oppia.android.domain.platformparameter.PlatformParameterSingletonModule
import org.oppia.android.domain.platformparameter.syncup.PlatformParameterSyncUpWorkerModule
import org.oppia.android.domain.question.QuestionModule
import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule
import org.oppia.android.domain.workmanager.WorkManagerConfigurationModule
import org.oppia.android.util.accessibility.AccessibilityProdModule
import org.oppia.android.util.caching.AssetModule
Expand Down Expand Up @@ -82,7 +81,7 @@ import javax.inject.Singleton
ImageParsingModule::class, HtmlParserEntityTypeModule::class, CachingModule::class,
QuestionModule::class, AccessibilityProdModule::class, ImageClickInputModule::class,
LogStorageModule::class, IntentFactoryShimModule::class, ViewBindingShimModule::class,
PrimeTopicAssetsControllerModule::class, ExpirationMetaDataRetrieverModule::class,
ExpirationMetaDataRetrieverModule::class,
RatioInputModule::class, UncaughtExceptionLoggerModule::class,
ApplicationStartupListenerModule::class, LogReportWorkerModule::class,
WorkManagerConfigurationModule::class, HintsAndSolutionConfigModule::class,
Expand Down
Loading

0 comments on commit 0a7c600

Please sign in to comment.