Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aedec2e5 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

[Spa] Gradle and Android Gradle Plugin Upgrade

Gradle: Upgraded from version 8.12.1 to 8.13
Android Gradle Plugin (AGP): Upgraded from version 8.10.1 to 8.11.0

Build Script Modernization and Centralization:
The root `build.gradle.kts` file has been substantially refactored to
use the modern, stable AGP APIs and to centralize configuration.
Modern AGP APIs: The build script now uses the
`com.android.build.api.dsl` interfaces (`CommonExtension`,
`ApplicationExtension`, `LibraryExtension`) instead of the older
`com.android.build.gradle.BaseExtension`. This is the recommended
practice for modern AGP versions, providing more stable and explicit
APIs.

Bug: 373245944
Flag: EXEMPT gradle only
Test: gradle build
Change-Id: I3b1688753f7859ee3e58ddd7066730f7dae85967
parent 559b2b6a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -11,5 +11,9 @@
  </component>
  <component name="VcsDirectoryMappings">
    <mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
    <mapping directory="$PROJECT_DIR$/../../../../../platform_testing" vcs="Git" />
  </component>
  <component name="VcsProjectSettings">
    <option name="detectVcsMappingsAutomatically" value="false" />
  </component>
</project>
 No newline at end of file
+22 −15
Original line number Diff line number Diff line
@@ -14,8 +14,12 @@
 * limitations under the License.
 */

import com.android.build.gradle.BaseExtension
import com.android.build.gradle.api.AndroidBasePlugin
import com.android.build.api.dsl.ApplicationExtension
import com.android.build.api.dsl.CommonExtension
import com.android.build.api.dsl.LibraryExtension
import com.android.build.gradle.AppPlugin
import com.android.build.gradle.BasePlugin
import com.android.build.gradle.LibraryPlugin

plugins {
    alias(libs.plugins.android.application) apply false
@@ -31,22 +35,25 @@ allprojects {
    extra["jetpackComposeVersion"] = "1.9.0-alpha04"
}

subprojects {
    layout.buildDirectory.set(file("$androidTop/out/gradle-spa/$name"))
allprojects {
    val projectBuildPath = path.replace(':', File.separatorChar)
    layout.buildDirectory = file("$androidTop/out/gradle-spa/$projectBuildPath/build")
}

    plugins.withType<AndroidBasePlugin> {
        configure<BaseExtension> {
            compileSdkVersion(36)
subprojects {
    plugins.withType<BasePlugin> {
        the(CommonExtension::class).apply { compileSdk = 36 }

            defaultConfig {
                targetSdk = 36
        configure<JavaPluginExtension> {
            toolchain { languageVersion.set(JavaLanguageVersion.of(libs.versions.jvm.get())) }
        }
    }

        configure<JavaPluginExtension> {
            toolchain {
                languageVersion.set(JavaLanguageVersion.of(libs.versions.jvm.get()))
            }
    plugins.withType<AppPlugin> {
        configure<ApplicationExtension> { defaultConfig { targetSdk = 36 } }
    }

    plugins.withType<LibraryPlugin> {
        configure<LibraryExtension> { testOptions { targetSdk = 36 } }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#

[versions]
agp = "8.10.1"
agp = "8.11.0"
dexmaker-mockito = "2.28.4"
jvm = "21"
kotlin = "2.1.10" # external/kotlinc/build.txt
−130 MiB

File deleted.

Loading