-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,18 @@ import java.io.File | |
import java.nio.file.Path | ||
import kotlin.io.path.relativeTo | ||
|
||
internal abstract class GenerateResourceAccessorsTask : IdeaImportTask() { | ||
/** | ||
* Configuration for resource accessors generation. | ||
* | ||
* ### Properties | ||
* - `generateResourceContentHashAnnotation`: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
Please, also describe what is |
||
* A property that defines whether to generate @ResourceContentHash annotation for resource accessors. | ||
*/ | ||
interface ResourceAccessorsConfiguration { | ||
val generateResourceContentHashAnnotation: Property<Boolean> | ||
} | ||
|
||
internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(), ResourceAccessorsConfiguration { | ||
@get:Input | ||
abstract val packageName: Property<String> | ||
|
||
|
@@ -32,7 +43,7 @@ internal abstract class GenerateResourceAccessorsTask : IdeaImportTask() { | |
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
abstract override val generateResourceContentHashAnnotation: Property<Boolean> | ||
|
||
@get:InputFiles | ||
@get:SkipWhenEmpty | ||
|
@@ -42,6 +53,10 @@ internal abstract class GenerateResourceAccessorsTask : IdeaImportTask() { | |
@get:OutputDirectory | ||
abstract val codeDir: DirectoryProperty | ||
|
||
init { | ||
generateResourceContentHashAnnotation.convention(false) | ||
} | ||
|
||
override fun safeAction() { | ||
val kotlinDir = codeDir.get().asFile | ||
val rootResDir = resDir.get() | ||
|
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