Skip to content

A fully functional Android app built entirely with Kotlin and Jetpack Compose

Replace unused variable with simpler method calls

Simon Marquis1341f7c2c591
diff --git a/app-nia-catalog/build.gradle.kts b/app-nia-catalog/build.gradle.kts
index 7a8d61339..1f9ac1e2a 100644
--- a/app-nia-catalog/build.gradle.kts
+++ b/app-nia-catalog/build.gradle.kts
@@ -55,7 +55,7 @@ android {
namespace = "com.google.samples.apps.niacatalog"
buildTypes {
- val release by getting {
+ release {
// To publish on the Play store a private signing key is required, but to allow anyone
// who clones the code to sign and run the release variant, use the debug signing key.
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 70160f3e1..e172ed8bb 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -39,7 +39,7 @@ android {
}
buildTypes {
- val debug by getting {
+ debug {
applicationIdSuffix = NiaBuildType.DEBUG.applicationIdSuffix
}
val release by getting {
@@ -52,7 +52,7 @@ android {
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
signingConfig = signingConfigs.getByName("debug")
}
- val benchmark by creating {
+ create("benchmark") {
// Enable all the optimizations from release build through initWith(release).
initWith(release)
matchingFallbacks.add("release")
diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts
index fa8aeefb0..fb46ae63f 100644
--- a/benchmarks/build.gradle.kts
+++ b/benchmarks/build.gradle.kts
@@ -39,7 +39,7 @@ android {
// This benchmark buildType is used for benchmarking, and should function like your
// release build (for example, with minification on). It's signed with a debug key
// for easy local/CI testing.
- val benchmark by creating {
+ create("benchmark") {
// Keep the build type debuggable so we can attach a debugger if needed.
isDebuggable = true
signingConfig = signingConfigs.getByName("debug")
diff --git a/core/datastore/build.gradle.kts b/core/datastore/build.gradle.kts
index 6fecb37d4..a9ec7a78f 100644
--- a/core/datastore/build.gradle.kts
+++ b/core/datastore/build.gradle.kts
@@ -41,10 +41,10 @@ protobuf {
generateProtoTasks {
all().forEach { task ->
task.builtins {
- val java by registering {
+ register("java") {
option("lite")
}
- val kotlin by registering {
+ register("kotlin") {
option("lite")
}
}