Skip to content

Commit

Permalink
Drop enum value constants (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
raniejade committed Aug 11, 2020
1 parent c756676 commit 9aa5c42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion buildSrc/src/main/kotlin/godot/codegen/Class.kt
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ class Class @JsonCreator constructor(
}

private fun generateConstants(baseCompanion: TypeSpec.Builder) {
constants.forEach { (key, value) ->
// for easy lookup
val allEnumValues = enums.flatMap { it.values.keys }
.toSet()
constants.filter { !allEnumValues.contains(it.key) }
.forEach { (key, value) ->
baseCompanion.addProperty(
PropertySpec
.builder(key, Long::class)
Expand Down

0 comments on commit 9aa5c42

Please sign in to comment.