diff --git a/WORKSPACE b/WORKSPACE index 605134eb309..20fb427a22b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -27,16 +27,14 @@ http_archive( ) # Add support for Kotlin: https://github.com/bazelbuild/rules_kotlin. -RULES_KOTLIN_VERSION = "legacy-1.4.0-rcx-oppia-exclusive-rc01" +RULES_KOTLIN_VERSION = "v1.5.0-alpha-2" -RULES_KOTLIN_SHA = "600f3d916eda5531dd70614ec96dc92b4ac24da0e1d815eb94559976e9bea8aa" +RULES_KOTLIN_SHA = "6194a864280e1989b6d8118a4aee03bb50edeeae4076e5bc30eef8a98dcd4f07" http_archive( 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], + urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % RULES_KOTLIN_VERSION], ) # TODO(#1535): Remove once rules_kotlin is released because these lines become unnecessary @@ -56,7 +54,6 @@ module while helping us avoid the unnecessary compilation of protoc. Referecence - 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", @@ -67,12 +64,33 @@ bind( actual = "//tools:java_toolchain", ) +# The rules_java contains the java_lite_proto_library rule used in the model module. +http_archive( + name = "rules_java", + sha256 = "220b87d8cfabd22d1c6d8e3cdb4249abd4c93dcc152e0667db061fb1b957ee68", + url = "https://github.com/bazelbuild/rules_java/releases/download/0.1.1/rules_java-0.1.1.tar.gz", +) + load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains") rules_java_dependencies() rules_java_toolchains() +# The rules_proto contains the proto_library rule used in the gitmodel module. +http_archive( + name = "rules_proto", + sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208", + strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313", + urls = ["https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz"], +) + +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") + +rules_proto_dependencies() + +rules_proto_toolchains() + # Add support for Dagger DAGGER_TAG = "2.28.1" diff --git a/build.gradle b/build.gradle index 98d32390176..e0c5e71e771 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.4.20' ext.fragment_version = '1.2.0-rc01' repositories { google() diff --git a/data/build.gradle b/data/build.gradle index 2c9daad6d35..54939d79b9a 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -67,7 +67,7 @@ dependencies { 'com.android.support:multidex:1.0.3', 'com.google.dagger:dagger:2.24', 'com.google.protobuf:protobuf-lite:3.0.0', - 'com.squareup.moshi:moshi-kotlin:1.8.0', + 'com.squareup.moshi:moshi-kotlin:1.11.0', 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.2', ) testImplementation( @@ -92,7 +92,7 @@ dependencies { ) androidTestImplementation('androidx.test:runner:1.2.0', 'androidx.test.espresso:espresso-core:3.2.0') - kapt("com.squareup.moshi:moshi-kotlin-codegen:1.8.0") + kapt("com.squareup.moshi:moshi-kotlin-codegen:1.11.0") kaptTest( 'com.google.dagger:dagger-compiler:2.24' ) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e579484d92e..4f11ea48e89 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip diff --git a/model/BUILD.bazel b/model/BUILD.bazel index 0012cee603b..fde7a743794 100644 --- a/model/BUILD.bazel +++ b/model/BUILD.bazel @@ -6,6 +6,8 @@ The proto_library() rule creates a proto file library to be used in multiple lan The java_lite_proto_library() rule takes in a proto_library target and generates java code. ''' load("//model:src/main/proto/format_import_proto_library.bzl", "format_import_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_java//java:defs.bzl", "java_lite_proto_library") # NOTE TO DEVELOPERS: When adding new protos, each proto will need to have both a proto_library # and java_lite_proto_library. See the examples below for context. Further, once the proto lite