-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from ty1824/indentOption
Add option for indentation to processor. Add Kotlinter gradle plugin
- Loading branch information
Showing
62 changed files
with
658 additions
and
593 deletions.
There are no files selected for viewing
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,32 @@ | ||
# dialector-kt-processor | ||
|
||
A Kotlin Symbol Processor for dialector-kt that generates Node implementations and builders for annotated Node interfaces. | ||
|
||
## Usage | ||
This module provides a plugin for [Kotlin Symbol Processor](https://kotlinlang.org/docs/ksp-overview.html) that processes | ||
annotated interfaces extending `Node` and generates implementations along with convenient builder DSLs. | ||
|
||
Add the Kotlin Symbol Processor (KSP) plugin to your gradle build | ||
``` | ||
plugins { | ||
... | ||
kotlin("jvm") version("1.7.10") | ||
id("com.google.devtools.ksp") version("1.7.10-1.0.6") // Be sure to use a KSP version that is compatible with your Kotlin version!! | ||
... | ||
} | ||
``` | ||
|
||
Add KSP configuration to set the output package for your generated code | ||
``` | ||
ksp { | ||
arg("dev.dialector.targetPackage", "org.example.output") // Required | ||
arg("dev.dialector.indent", " ") // Optional, the indent pattern used for codegen. Defaults to 4 spaces. | ||
} | ||
``` | ||
|
||
If you are using IntelliJ, add the following to ensure your generated code is indexed & compiled. | ||
``` | ||
sourceSets.getByName("main").java | ||
srcDir("build/generated/ksp/main/kotlin") | ||
} | ||
``` |
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 was deleted.
Oops, something went wrong.
371 changes: 208 additions & 163 deletions
371
dialector-kt-processor/src/main/kotlin/dev/dialector/processor/DialectorSymbolProcessor.kt
Large diffs are not rendered by default.
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
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
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
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
5 changes: 3 additions & 2 deletions
5
dialector-kt/src/main/kotlin/dev/dialector/semantic/SemanticDsl.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,8 +1,9 @@ | ||
package dev.dialector.semantic | ||
|
||
|
||
interface SemanticAnalysisContext { | ||
fun <S : SemanticSystem> getSystem(definition: SemanticSystemDefinition<S>): S | ||
|
||
fun <A, D> query(data: SemanticDataDefinition<*, A, D>, argument: A): Query<A, D> | ||
} | ||
} | ||
|
||
interface SemanticDsl |
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
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
Oops, something went wrong.