diff --git a/gradle-plugins/compose/build.gradle.kts b/gradle-plugins/compose/build.gradle.kts index b49fe5f0e61..68d83361684 100644 --- a/gradle-plugins/compose/build.gradle.kts +++ b/gradle-plugins/compose/build.gradle.kts @@ -30,6 +30,7 @@ val buildConfig = tasks.register("buildConfig", GenerateBuildConfig::class.java) generatedOutputDir.set(buildConfigDir) fieldsToGenerate.put("composeVersion", BuildProperties.composeVersion(project)) fieldsToGenerate.put("composeGradlePluginVersion", BuildProperties.deployVersion(project)) + fieldsToGenerate.put("DEFAULT_PROGUARD_VERSION", libs.versions.default.proguard.get()) } tasks.named("compileKotlin", KotlinCompilationTask::class) { dependsOn(buildConfig) diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/ProguardSettings.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/ProguardSettings.kt index a3459d40d5c..f20c42856ab 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/ProguardSettings.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/ProguardSettings.kt @@ -8,11 +8,12 @@ package org.jetbrains.compose.desktop.application.dsl import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.Property +import org.jetbrains.compose.ComposeBuildConfig import org.jetbrains.compose.internal.utils.notNullProperty import org.jetbrains.compose.internal.utils.nullableProperty import javax.inject.Inject -private const val DEFAULT_PROGUARD_VERSION = "7.2.2" +private const val DEFAULT_PROGUARD_VERSION = ComposeBuildConfig.DEFAULT_PROGUARD_VERSION abstract class ProguardSettings @Inject constructor( objects: ObjectFactory, diff --git a/gradle-plugins/gradle/libs.versions.toml b/gradle-plugins/gradle/libs.versions.toml index 5a2fc3056a3..ac09d1f9006 100644 --- a/gradle-plugins/gradle/libs.versions.toml +++ b/gradle-plugins/gradle/libs.versions.toml @@ -5,6 +5,9 @@ kotlin-poet = "1.16.0" plugin-android = "7.3.0" shadow-jar = "8.1.1" publish-plugin = "1.2.1" +# The default version of Proguard that will be used in Compose Desktop Gradle plugin +# to shrink and minimize the application in the Release build, the version can be overriden. +default-proguard = "7.2.2" [libraries] download-task = { module = "de.undercouch:gradle-download-task", version.ref = "gradle-download-plugin" }