Skip to content

Conversation

pjBooms
Copy link
Collaborator

@pjBooms pjBooms commented Aug 28, 2025

The API is going to be used from Compose Hot Reload.

Release Notes

N/A

@pjBooms pjBooms requested review from terrakok and igordmn August 28, 2025 16:36
@pjBooms pjBooms force-pushed the pjBooms/resource-content-hash-annotation-gradle-api branch from 73190cc to 1c4def7 Compare August 29, 2025 10:23
@pjBooms pjBooms force-pushed the pjBooms/resource-content-hash-annotation-gradle-api branch from 1c4def7 to b0d1112 Compare August 29, 2025 10:26
.map { it.toBoolean() }
.orElse(false)
)
task.generateResourceContentHashAnnotation.set(false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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

@get:Input
abstract val generateResourceContentHashAnnotation: Property<Boolean>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an init block with:

init {
  generateResourceContentHashAnnotation.convention(false)
}

https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html#convention(T)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

* Defines a property responsible for enabling or disabling
* generation of @ResourceContentHash annotation for resource accessors.
*/
interface ResourceContentHashAnnotationGenerationConfiguration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to ResourceAccessorsConfiguration

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 26 to 28
internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(),
ResourceContentHashAnnotationGenerationConfiguration
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal abstract class GenerateResourceAccessorsTask :
    IdeaImportTask(),
    ResourceContentHashAnnotationGenerationConfiguration {
    //...
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fits to one line now

Comment on lines 34 to 36
@get:Input
abstract val generateResourceContentHashAnnotation: Property<Boolean>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you delete it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need inputs here (not in the interface)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is inherited from the interface. What is wrong with such properties?

@pjBooms pjBooms force-pushed the pjBooms/resource-content-hash-annotation-gradle-api branch from 31f30e0 to 22dd6d0 Compare August 29, 2025 12:29
* Configuration for resource accessors generation.
*
* ### Properties
* - `generateResourceContentHashAnnotation`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not by KDoc format. It needs to be moved this way:

/**
 * Configuration for resource accessors generation.
 */
interface ResourceAccessorsConfiguration {
    /**
     * A property that defines whether to generate `@ResourceContentHash` annotation for resource accessors.
     */
    val generateResourceContentHashAnnotation: Property<Boolean>
}

Please, also describe what is ResourceContentHash and why it is needed to override the behavior. Even if it is only for one client, maintainers should understand why this is added.

@@ -14,7 +14,18 @@ import java.io.File
import java.nio.file.Path
import kotlin.io.path.relativeTo

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify Release Notes, with an example how to set this new property

@MatkovIvan MatkovIvan changed the title Provide public API for ResourceContentHash annotation generation. Provide public API for ResourceContentHash annotation generation Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants