Skip to content

Commit 82e62fd

Browse files
committed
feat: added builtin.elements
1 parent 0aafe9a commit 82e62fd

2 files changed

Lines changed: 22 additions & 17 deletions

File tree

mmrpc-definition/src/commonMain/kotlin/builtin.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ object builtin : NamespaceObject() {
4040
val Experimental__message by prop(String)
4141
val Experimental by metadata(Experimental__message)
4242

43+
val elements = listOf(
44+
Any,
45+
Void,
46+
NULL,
47+
String,
48+
Boolean,
49+
TRUE,
50+
FALSE,
51+
Int32,
52+
UInt32,
53+
Int64,
54+
UInt64,
55+
Float32,
56+
Float64,
57+
Deprecated__message,
58+
Deprecated,
59+
Experimental__message,
60+
Experimental,
61+
)
62+
4363
/**
4464
* Namespace to be used for defining builtin faults.
4565
*/

mmrpc-gradle-plugin/src/main/kotlin/MmrpcKotlinGenerateSourcesTask.kt

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -276,23 +276,8 @@ open class MmrpcKotlinGenerateSourcesTask : DefaultTask() {
276276
}
277277

278278
val elements = buildSet {
279-
if (GenFeature.NO_BUILTIN !in features.get()) {
280-
this += builtin.Any
281-
this += builtin.Void
282-
this += builtin.NULL
283-
this += builtin.String
284-
this += builtin.Boolean
285-
this += builtin.TRUE
286-
this += builtin.FALSE
287-
this += builtin.Int32
288-
this += builtin.UInt32
289-
this += builtin.Int64
290-
this += builtin.UInt64
291-
this += builtin.Float32
292-
this += builtin.Float64
293-
this += builtin.Deprecated
294-
this += builtin.Experimental
295-
}
279+
if (GenFeature.NO_BUILTIN !in features.get())
280+
addAll(builtin.elements)
296281

297282
addAll(specSheet.elements)
298283
}

0 commit comments

Comments
 (0)