-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BuildTools
authored and
BuildTools
committed
Dec 9, 2022
1 parent
6da3b4e
commit 30a57e6
Showing
16 changed files
with
93 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/dsl/CodeBuilder.kt → ...kotlin/me/deotime/kpoetdsl/CodeBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package dsl | ||
package me.deotime.kpoetdsl | ||
|
||
import com.squareup.kotlinpoet.CodeBlock | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/dsl/Cozy.kt → src/main/kotlin/me/deotime/kpoetdsl/Cozy.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package dsl | ||
package me.deotime.kpoetdsl | ||
|
||
import kotlin.reflect.KProperty | ||
|
||
|
12 changes: 6 additions & 6 deletions
12
src/main/kotlin/dsl/FileBuilder.kt → ...kotlin/me/deotime/kpoetdsl/FileBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/main/kotlin/dsl/ParameterBuilder.kt → ...n/me/deotime/kpoetdsl/ParameterBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/main/kotlin/dsl/PropertyBuilder.kt → ...in/me/deotime/kpoetdsl/PropertyBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
src/main/kotlin/dsl/TypeBuilder.kt → ...kotlin/me/deotime/kpoetdsl/TypeBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package me.deotime.kpoetdsl.test | ||
|
||
import me.deotime.kpoetdsl.invoke | ||
import me.deotime.kpoetdsl.kotlin | ||
import me.deotime.kpoetdsl.type | ||
import me.deotime.kpoetdsl.utils.typeParameter | ||
|
||
fun main() { | ||
|
||
val dsl = kotlin { | ||
name("Calculator") packaged "idk" | ||
|
||
val typeParam = typeParameter<Number>("T") | ||
type("Calculator") { | ||
kind { Class } | ||
property { | ||
name("glitch") | ||
type<String>() | ||
initializer { | ||
+"%T().toString()"(Any::class) | ||
} | ||
} | ||
typeParameters { | ||
+typeParam | ||
} | ||
function { | ||
operator { Plus } | ||
receiver(typeParam) | ||
returns(typeParam) | ||
parameter("other") { type(typeParam) } | ||
comment("This function will add two numbers") | ||
comment("together, and then return that value.") | ||
code { | ||
+"return this + other" | ||
} | ||
|
||
|
||
} | ||
} | ||
} | ||
dsl.writeTo(System.out) | ||
} |
2 changes: 1 addition & 1 deletion
2
...ain/kotlin/dsl/utils/CollectionBuilder.kt → ...otime/kpoetdsl/utils/CollectionBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package dsl.utils | ||
package me.deotime.kpoetdsl.utils | ||
|
||
interface CollectionBuilder<T> { | ||
operator fun T.unaryPlus() | ||
|
4 changes: 2 additions & 2 deletions
4
src/main/kotlin/dsl/utils/Required.kt → ...lin/me/deotime/kpoetdsl/utils/Required.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/dsl/utils/Uses.kt → .../kotlin/me/deotime/kpoetdsl/utils/Uses.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package dsl.utils | ||
package me.deotime.kpoetdsl.utils | ||
|
||
sealed interface Uses { | ||
object Name : Uses | ||
|
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/dsl/utils/typeVariables.kt → ...e/deotime/kpoetdsl/utils/typeVariables.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/kotlin/dsl/utils/utils.kt → ...kotlin/me/deotime/kpoetdsl/utils/utils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters