Repository: Automattic/pocket-casts-android
File: app/build.gradle.kts (Kotlin)

Code before:
        applicationId = project.property("applicationId").toString()
        multiDexEnabled = true
    }

    sourceSets {
        getByName("androidTest") {
            assets.srcDir(files("$rootDir/modules/services/model/schemas"))
        }
    }

    buildFeatures {
        buildConfig = true
        viewBinding = true
        compose = true
    }

    buildTypes {
        named("debug") {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_radioactive"
        }

        named("debugProd") {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_3"
        }

        maybeCreate("prototype").apply {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_prototype"

            isMinifyEnabled = true
            isShrinkResources = true
            proguardFiles.addAll(
                listOf(
                    getDefaultProguardFile("proguard-android-optimize.txt"),
                    rootProject.file("proguard-rules.pro"),
                    rootProject.file("proguard-rules-no-obfuscate.pro"),
                ),
            )
        }

        named("release") {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"

            if (!file("${project.rootDir}/sentry.properties").exists()) {
                println("WARNING: Sentry configuration file 'sentry.properties' not found. The ProGuard mapping files won't be uploaded.")
            }
        }
    }

    lint {
        checkDependencies = true
    }

Review comment (performance):
Question (❓): Why not add the `isMinifyEnabled` + `isShrinkResources` + `proguardFiles ` configuration on the root level `build.gradle.kts` file, just like it is done for the rest, to keep things consistent, there might be a reason I am not aware of: 🤔


`build.gradle.kts` (root)
```kts
    plugins.withType<AppPlugin>().configureEach {
        configure<BaseAppModuleExtension> {
            lint(configureLint)

            buildTypes {
                ...
                maybeCreate("prototype").apply {
                    isMinifyEnabled = true
                    proguardFiles.addAll(
                        listOf(
                            getDefaultProguardFile("proguard-android-optimize.txt"),
                            rootProject.file("proguard-rules.pro"),
                            rootProject.file("proguard-rules-no-obfuscate.pro"),
                        ),
                    )
                    isShrinkResources = true
                }
                ...
            }
        }
```

`build.gradle.kts` (app)
```kts
    buildTypes {
        ...
        named("prototype") {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_prototype"
        }
        ...
    }
```


Code after:
        applicationId = project.property("applicationId").toString()
        multiDexEnabled = true
    }

    sourceSets {
        getByName("androidTest") {
            assets.srcDir(files("$rootDir/modules/services/model/schemas"))
        }
    }

    buildFeatures {
        buildConfig = true
        viewBinding = true
        compose = true
    }

    buildTypes {
        named("debug") {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_radioactive"
        }

        named("debugProd") {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_3"
        }

        maybeCreate("prototype").apply {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_prototype"
        }

        named("release") {
            manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"

            if (!file("${project.rootDir}/sentry.properties").exists()) {
                println("WARNING: Sentry configuration file 'sentry.properties' not found. The ProGuard mapping files won't be uploaded.")
            }
        }
    }

    lint {
        checkDependencies = true
    }
}

dependencies {
    ksp(libs.dagger.hilt.compiler)
    ksp(libs.hilt.compiler)

    implementation(platform(libs.compose.bom))
    implementation(platform(libs.firebase.bom))

    implementation(libs.androidx.annotation)