-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Provide public API for ResourceContentHash annotation generation #5402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Provide public API for ResourceContentHash annotation generation #5402
Conversation
73190cc
to
1c4def7
Compare
1c4def7
to
b0d1112
Compare
.map { it.toBoolean() } | ||
.orElse(false) | ||
) | ||
task.generateResourceContentHashAnnotation.set(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to ResourceAccessorsConfiguration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(), | ||
ResourceContentHashAnnotationGenerationConfiguration | ||
{ |
There was a problem hiding this comment.
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 {
//...
}
There was a problem hiding this comment.
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
@get:Input | ||
abstract val generateResourceContentHashAnnotation: Property<Boolean> | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?
31f30e0
to
22dd6d0
Compare
* Configuration for resource accessors generation. | ||
* | ||
* ### Properties | ||
* - `generateResourceContentHashAnnotation`: |
There was a problem hiding this comment.
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 | |||
|
There was a problem hiding this comment.
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
The API is going to be used from Compose Hot Reload.
Release Notes
N/A