Skip to content

Commit 22dd6d0

Browse files
committed
Review fixes
1 parent b0d1112 commit 22dd6d0

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ComposeResourcesGeneration.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ private fun Project.configureResourceAccessorsGeneration(
153153
task.packagingDir.set(packagingDir)
154154
}
155155
task.onlyIf { shouldGenerateCode.get() }
156-
task.generateResourceContentHashAnnotation.set(false)
157156
}
158157

159158
//register generated source set

gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/GenerateResourceAccessorsTask.kt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ import java.nio.file.Path
1515
import kotlin.io.path.relativeTo
1616

1717
/**
18-
* Defines a property responsible for enabling or disabling
19-
* generation of @ResourceContentHash annotation for resource accessors.
18+
* Configuration for resource accessors generation.
19+
*
20+
* ### Properties
21+
* - `generateResourceContentHashAnnotation`:
22+
* A property that defines whether to generate @ResourceContentHash annotation for resource accessors.
2023
*/
21-
interface ResourceContentHashAnnotationGenerationConfiguration {
22-
@get:Input
24+
interface ResourceAccessorsConfiguration {
2325
val generateResourceContentHashAnnotation: Property<Boolean>
2426
}
2527

26-
internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(),
27-
ResourceContentHashAnnotationGenerationConfiguration
28-
{
28+
internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(), ResourceAccessorsConfiguration {
2929
@get:Input
3030
abstract val packageName: Property<String>
3131

@@ -42,6 +42,9 @@ internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(),
4242
@get:Input
4343
abstract val makeAccessorsPublic: Property<Boolean>
4444

45+
@get:Input
46+
abstract override val generateResourceContentHashAnnotation: Property<Boolean>
47+
4548
@get:InputFiles
4649
@get:SkipWhenEmpty
4750
@get:PathSensitive(PathSensitivity.RELATIVE)
@@ -50,6 +53,10 @@ internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(),
5053
@get:OutputDirectory
5154
abstract val codeDir: DirectoryProperty
5255

56+
init {
57+
generateResourceContentHashAnnotation.convention(false)
58+
}
59+
5360
override fun safeAction() {
5461
val kotlinDir = codeDir.get().asFile
5562
val rootResDir = resDir.get()

gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ class ResourcesTest : GradlePluginTestBase() {
589589
file("build.gradle.kts").appendText(
590590
"""
591591
tasks.configureEach {
592-
if (this is org.jetbrains.compose.resources.ResourceContentHashAnnotationGenerationConfiguration) {
592+
if (this is org.jetbrains.compose.resources.ResourceAccessorsConfiguration) {
593593
generateResourceContentHashAnnotation.set(true)
594594
}
595595
}

0 commit comments

Comments
 (0)