Skip to content

Commit

Permalink
Add generated classes to repo (#223)
Browse files Browse the repository at this point in the history
* Add generated classes to repo

* mark generated api as linguist generated

* Remove empty companion objects in generated api

* Add comment on api files to warn those are generated
  • Loading branch information
piiertho committed Aug 11, 2020
1 parent fd88249 commit d8e8d90
Show file tree
Hide file tree
Showing 628 changed files with 120,854 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
old/* linguist-generated=true
old/* linguist-generated=true
godot-kotlin/godot-library/src/nativeGen/kotlin/* linguist-generated=true
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/godot/codegen/Class.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Class @JsonCreator constructor(

generateEnums(classTypeBuilder)

val baseCompanion = if (!isSingleton) TypeSpec.companionObjectBuilder() else null
val baseCompanion = if (!isSingleton && constants.isNotEmpty()) TypeSpec.companionObjectBuilder() else null

generateConstants(baseCompanion ?: classTypeBuilder)

Expand All @@ -83,6 +83,7 @@ class Class @JsonCreator constructor(
}

fileBuilder
.addComment("THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD")
.build()
.writeTo(outputDir)
}
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/godot/codegen/generationEntry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ infix fun File.generateApiFrom(jsonSource: File) {
this.parentFile.mkdirs()

iCallFileSpec
.addComment("THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD")
.build()
.writeTo(this)

Expand Down
1 change: 0 additions & 1 deletion godot-kotlin/godot-library/src/nativeGen/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD
package godot

import godot.core.Godot.shouldInitPtr
import godot.core.Plane
import godot.core.Signal1
import godot.core.Vector3
import godot.core.signal
import godot.icalls._icall_Boolean
import godot.icalls._icall_Long
import godot.icalls._icall_Mesh
import godot.icalls._icall_Plane
import godot.icalls._icall_String
import godot.icalls._icall_Unit_Long
import godot.icalls._icall_Vector3
import godot.internal.utils.getConstructor
import godot.internal.utils.getMethodBind
import kotlin.Any
import kotlin.Boolean
import kotlin.Long
import kotlin.String

open class ARVRAnchor internal constructor(
_ignore: Any?
) : Spatial(_ignore) {
val meshUpdated: Signal1<Mesh> by signal("mesh")

open var anchorId: Long
get() {
val mb = getMethodBind("ARVRAnchor","get_anchor_id")
return _icall_Long(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("ARVRAnchor","set_anchor_id")
_icall_Unit_Long(mb, this.ptr, value)
}

constructor() : this(null) {
if (shouldInitPtr()) {
this.ptr = getConstructor("ARVRAnchor", "ARVRAnchor")
}

}

open fun getAnchorId(): Long {
val mb = getMethodBind("ARVRAnchor","get_anchor_id")
return _icall_Long( mb, this.ptr)
}

open fun getAnchorName(): String {
val mb = getMethodBind("ARVRAnchor","get_anchor_name")
return _icall_String( mb, this.ptr)
}

open fun getIsActive(): Boolean {
val mb = getMethodBind("ARVRAnchor","get_is_active")
return _icall_Boolean( mb, this.ptr)
}

open fun getMesh(): Mesh {
val mb = getMethodBind("ARVRAnchor","get_mesh")
return _icall_Mesh( mb, this.ptr)
}

open fun getPlane(): Plane {
val mb = getMethodBind("ARVRAnchor","get_plane")
return _icall_Plane( mb, this.ptr)
}

open fun getSize(): Vector3 {
val mb = getMethodBind("ARVRAnchor","get_size")
return _icall_Vector3( mb, this.ptr)
}

open fun setAnchorId(anchorId: Long) {
val mb = getMethodBind("ARVRAnchor","set_anchor_id")
_icall_Unit_Long( mb, this.ptr, anchorId)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD
package godot

import godot.core.Godot.shouldInitPtr
import godot.internal.utils.getConstructor
import kotlin.Any

open class ARVRCamera internal constructor(
_ignore: Any?
) : Camera(_ignore) {
constructor() : this(null) {
if (shouldInitPtr()) {
this.ptr = getConstructor("ARVRCamera", "ARVRCamera")
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD
package godot

import godot.ARVRPositionalTracker
import godot.core.Godot.shouldInitPtr
import godot.core.Signal1
import godot.core.signal
import godot.icalls._icall_Boolean
import godot.icalls._icall_Double
import godot.icalls._icall_Double_Long
import godot.icalls._icall_Long
import godot.icalls._icall_Long_Long
import godot.icalls._icall_Mesh
import godot.icalls._icall_String
import godot.icalls._icall_Unit_Double
import godot.icalls._icall_Unit_Long
import godot.internal.utils.getConstructor
import godot.internal.utils.getMethodBind
import kotlin.Any
import kotlin.Boolean
import kotlin.Double
import kotlin.Long
import kotlin.String

open class ARVRController internal constructor(
_ignore: Any?
) : Spatial(_ignore) {
val buttonPressed: Signal1<Long> by signal("button")

val buttonRelease: Signal1<Long> by signal("button")

val meshUpdated: Signal1<Mesh> by signal("mesh")

open var controllerId: Long
get() {
val mb = getMethodBind("ARVRController","get_controller_id")
return _icall_Long(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("ARVRController","set_controller_id")
_icall_Unit_Long(mb, this.ptr, value)
}

open var rumble: Double
get() {
val mb = getMethodBind("ARVRController","get_rumble")
return _icall_Double(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("ARVRController","set_rumble")
_icall_Unit_Double(mb, this.ptr, value)
}

constructor() : this(null) {
if (shouldInitPtr()) {
this.ptr = getConstructor("ARVRController", "ARVRController")
}

}

open fun getControllerId(): Long {
val mb = getMethodBind("ARVRController","get_controller_id")
return _icall_Long( mb, this.ptr)
}

open fun getControllerName(): String {
val mb = getMethodBind("ARVRController","get_controller_name")
return _icall_String( mb, this.ptr)
}

open fun getHand(): ARVRPositionalTracker.TrackerHand {
val mb = getMethodBind("ARVRController","get_hand")
return ARVRPositionalTracker.TrackerHand.from( _icall_Long( mb, this.ptr))
}

open fun getIsActive(): Boolean {
val mb = getMethodBind("ARVRController","get_is_active")
return _icall_Boolean( mb, this.ptr)
}

open fun getJoystickAxis(axis: Long): Double {
val mb = getMethodBind("ARVRController","get_joystick_axis")
return _icall_Double_Long( mb, this.ptr, axis)
}

open fun getJoystickId(): Long {
val mb = getMethodBind("ARVRController","get_joystick_id")
return _icall_Long( mb, this.ptr)
}

open fun getMesh(): Mesh {
val mb = getMethodBind("ARVRController","get_mesh")
return _icall_Mesh( mb, this.ptr)
}

open fun getRumble(): Double {
val mb = getMethodBind("ARVRController","get_rumble")
return _icall_Double( mb, this.ptr)
}

open fun isButtonPressed(button: Long): Long {
val mb = getMethodBind("ARVRController","is_button_pressed")
return _icall_Long_Long( mb, this.ptr, button)
}

open fun setControllerId(controllerId: Long) {
val mb = getMethodBind("ARVRController","set_controller_id")
_icall_Unit_Long( mb, this.ptr, controllerId)
}

open fun setRumble(rumble: Double) {
val mb = getMethodBind("ARVRController","set_rumble")
_icall_Unit_Double( mb, this.ptr, rumble)
}
}

0 comments on commit d8e8d90

Please sign in to comment.