Skip to content

Commit 4fe0079

Browse files
committed
pref: Support for configuring includeProperty in the IncludeAnnotation
1 parent 94a8aae commit 4fe0079

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

buildSrc/src/main/kotlin/IProject.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import love.forte.gradle.common.core.project.ProjectDetail
22
import love.forte.gradle.common.core.project.Version
3-
import love.forte.gradle.common.core.project.minus
43
import love.forte.gradle.common.core.project.version
54

65
object IProject : ProjectDetail() {
@@ -9,7 +8,7 @@ object IProject : ProjectDetail() {
98
const val DESCRIPTION = "Generate platform-compatible functions for Kotlin suspend functions"
109
const val HOMEPAGE = "https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin"
1110

12-
override val version: Version = version(0, 9, 0) - version("beta1")
11+
override val version: Version = version(0, 9, 0)
1312

1413
override val homepage: String get() = HOMEPAGE
1514

compiler/suspend-transform-plugin/src/main/kotlin/love/forte/plugin/suspendtrans/SuspendTransformConfiguration.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ data class Transformer(
9595
/**
9696
* 如果是生成属性的话,是否复制源函数上的注解到新的属性上
9797
*
98-
* @since 0.8.0
98+
* @since 0.9.0
9999
*/
100100
var copyAnnotationsToSyntheticProperty: Boolean = false
101101
}
@@ -142,6 +142,8 @@ data class IncludeAnnotation(
142142
) {
143143
/**
144144
* 如果是追加,是否追加到property上
145+
*
146+
* @since 0.9.0
145147
*/
146148
var includeProperty: Boolean = false
147149
}
@@ -311,7 +313,11 @@ open class SuspendTransformConfiguration {
311313
originFunctionIncludeAnnotations = listOf(),
312314
copyAnnotationsToSyntheticFunction = true,
313315
copyAnnotationExcludes = listOf(jsAsyncAnnotationInfo.classInfo),
314-
syntheticFunctionIncludeAnnotations = listOf(IncludeAnnotation(jsApi4JsAnnotationInfo))
316+
syntheticFunctionIncludeAnnotations = listOf(
317+
IncludeAnnotation(jsApi4JsAnnotationInfo).apply {
318+
includeProperty = true
319+
}
320+
)
315321
)
316322
//endregion
317323

0 commit comments

Comments
 (0)