Skip to content

Commit

Permalink
Manual cherry-pick of #1876 (#1906)
Browse files Browse the repository at this point in the history
* Manual cherry-pick of 74db288
(#1876).

* Fix branch-specific issues.

* Update references to app module tests in old main.yml file on release
branch.
  • Loading branch information
BenHenning authored Sep 25, 2020
1 parent a1445a5 commit 77b48cb
Show file tree
Hide file tree
Showing 1,191 changed files with 6,118 additions and 6,038 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Robolectric tests - FAQ, Help, Mydownloads, Parser, ProfileProgress, RecyclerView, State, Story, Utility tests
# We require 'sudo' to avoid an error of the existing android sdk. See https://github.com/actions/starter-workflows/issues/58
run: |
sudo ./gradlew :app:testDebugUnitTest --tests org.oppia.app.faq* --tests org.oppia.app.help* --tests org.oppia.app.mydownloads* --tests org.oppia.app.parser* --tests org.oppia.app.player.state* --tests org.oppia.app.profileprogress* --tests org.oppia.app.recyclerview* --tests org.oppia.app.splash* --tests org.oppia.app.story* --tests org.oppia.app.utility* --tests org.oppia.app.topic.questionplayer*
sudo ./gradlew :app:testDebugUnitTest --tests org.oppia.android.app.faq* --tests org.oppia.android.app.help* --tests org.oppia.android.app.mydownloads* --tests org.oppia.android.app.parser* --tests org.oppia.android.app.player.state* --tests org.oppia.android.app.profileprogress* --tests org.oppia.android.app.recyclerview* --tests org.oppia.android.app.splash* --tests org.oppia.android.app.story* --tests org.oppia.android.app.utility* --tests org.oppia.android.app.topic.questionplayer*
- name: Upload App Test Reports
uses: actions/upload-artifact@v2
if: ${{ always() }} # IMPORTANT: Upload reports regardless of status
Expand Down
6 changes: 3 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# TODO(#1640): Move binary manifest to top-level package post-Gradle.
android_binary(
name = "oppia",
custom_package = "org.oppia.app",
custom_package = "org.oppia.android",
enable_data_binding = True,
manifest = "//app:src/main/AndroidManifest.xml",
manifest_values = {
"applicationId": "org.oppia.app",
"applicationId": "org.oppia.android",
"versionCode": "4",
"versionName": "0.4-alpha-94fc517da5",
"minSdkVersion": "19",
"targetSdkVersion": "29",
},
multidex = "legacy",
multidex = "native", # TODO(#1875): Re-enable legacy for optimized release builds.
deps = [
"//app",
],
Expand Down
49 changes: 33 additions & 16 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
"""
This file lists and imports all external dependencies needed to build Oppia Android.
'''
"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
Expand All @@ -16,60 +16,72 @@ android_sdk_repository(

# Add support for JVM rules: https://github.com/bazelbuild/rules_jvm_external
RULES_JVM_EXTERNAL_TAG = "2.9"

RULES_JVM_EXTERNAL_SHA = "e5b97a31a3e8feed91636f42e19b11c49487b85e5de2f387c999ea14d77c7f45"

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

# Add support for Kotlin: https://github.com/bazelbuild/rules_kotlin.
RULES_KOTLIN_VERSION = "legacy-1.4.0-rcx-oppia-exclusive-rc01"

RULES_KOTLIN_SHA = "600f3d916eda5531dd70614ec96dc92b4ac24da0e1d815eb94559976e9bea8aa"

http_archive(
name = "io_bazel_rules_kotlin",
urls = ["https://github.com/oppia/rules_kotlin/archive/%s.zip" % RULES_KOTLIN_VERSION],
type = "zip",
strip_prefix = "rules_kotlin-%s" % RULES_KOTLIN_VERSION,
sha256 = RULES_KOTLIN_SHA,
name = "io_bazel_rules_kotlin",
sha256 = RULES_KOTLIN_SHA,
strip_prefix = "rules_kotlin-%s" % RULES_KOTLIN_VERSION,
type = "zip",
urls = ["https://github.com/oppia/rules_kotlin/archive/%s.zip" % 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")

kotlin_repositories()

kt_register_toolchains()

'''
"""
The proto_compiler and proto_java_toolchain bindings load the protos rules needed for the model
module while helping us avoid the unnecessary compilation of protoc. Referecences:
- https://github.com/google/startup-os/blob/5f30a62/WORKSPACE#L179-L187
- https://github.com/bazelbuild/bazel/issues/7095
'''
"""

bind(
name = "proto_compiler",
actual = "//tools:protoc"
actual = "//tools:protoc",
)

bind(
name = "proto_java_toolchain",
actual = "//tools:java_toolchain"
actual = "//tools:java_toolchain",
)

load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")

rules_java_dependencies()

rules_java_toolchains()

# Add support for Dagger
DAGGER_TAG = "2.28.1"

DAGGER_SHA = "9e69ab2f9a47e0f74e71fe49098bea908c528aa02fa0c5995334447b310d0cdd"

http_archive(
name = "dagger",
strip_prefix = "dagger-dagger-%s" % DAGGER_TAG,
sha256 = DAGGER_SHA,
strip_prefix = "dagger-dagger-%s" % DAGGER_TAG,
urls = ["https://github.com/google/dagger/archive/dagger-%s.zip" % DAGGER_TAG],
)

Expand All @@ -78,10 +90,12 @@ load("@dagger//:workspace_defs.bzl", "DAGGER_ARTIFACTS", "DAGGER_REPOSITORIES")
# Add support for Robolectric: https://github.com/robolectric/robolectric-bazel
http_archive(
name = "robolectric",
urls = ["https://github.com/oppia/robolectric-bazel/archive/4.x-oppia-exclusive-rc02.tar.gz"],
strip_prefix = "robolectric-bazel-4.x-oppia-exclusive-rc02",
urls = ["https://github.com/oppia/robolectric-bazel/archive/4.x-oppia-exclusive-rc02.tar.gz"],
)

load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")

robolectric_repositories()

# Add support for Firebase Crashlytics
Expand All @@ -92,6 +106,7 @@ git_repository(
)

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

google_services_workspace_dependencies()

git_repository(
Expand All @@ -101,8 +116,8 @@ git_repository(
)

bind(
name = "databinding_annotation_processor",
actual = "//tools/android:compiler_annotation_processor",
name = "databinding_annotation_processor",
actual = "//tools/android:compiler_annotation_processor",
)

load("@rules_jvm_external//:defs.bzl", "maven_install")
Expand Down Expand Up @@ -131,6 +146,7 @@ maven_install(
"androidx.navigation:navigation-ui:2.0.0",
"androidx.navigation:navigation-ui-ktx:2.0.0",
"androidx.recyclerview:recyclerview:1.0.0",
"androidx.room:room-runtime:2.2.5",
"androidx.test.espresso:espresso-contrib:3.1.0",
"androidx.test.espresso:espresso-core:3.2.0",
"androidx.test.espresso:espresso-intents:3.1.0",
Expand All @@ -147,6 +163,7 @@ maven_install(
"com.google.firebase:firebase-analytics:17.5.0",
"com.google.firebase:firebase-crashlytics:17.1.1",
"com.google.gms:google-services:4.3.3",
"com.google.guava:guava:28.1-android",
"com.google.truth:truth:0.43",
"com.squareup.retrofit2:converter-gson:2.5.0",
"com.squareup.retrofit2:retrofit:2.9.0",
Expand Down
Loading

0 comments on commit 77b48cb

Please sign in to comment.