-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add new symbol processor #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
e87d1b9
to
1e0f062
Compare
1e0f062
to
e5eb429
Compare
e5eb429
to
f847241
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
f847241
to
87e6f47
Compare
87e6f47
to
a5e6cc6
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
a5e6cc6
to
0bd02bd
Compare
e13837b
to
829b5ab
Compare
e8f0f46
to
17eb0cc
Compare
17eb0cc
to
f310733
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the annotation processor from Java annotation processing tool (APT/kapt) to Kotlin Symbol Processing (KSP). This represents a significant modernization effort, moving from the legacy annotation processing model to KSP's more efficient and Kotlin-native approach.
- Replaces the entire annotation processor infrastructure with KSP implementation
- Updates build configurations across modules to use KSP instead of kapt
- Adds comprehensive test suite using kotlin-compile-testing
Reviewed Changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
sample/src/main/kotlin/co/anitrend/support/query/builder/sample/data/entity/pet/PetEntity.kt | Replaces wildcard import with explicit Room annotation imports |
sample/build.gradle.kts | Migrates from kapt to KSP, adds explicit project dependencies |
processor/src/test/kotlin/**/*.kt | Adds new test infrastructure for KSP processor testing |
processor/src/main/kotlin/**/Candidate.kt | Rewrites candidate model to work with KSP symbols instead of javax elements |
processor/src/main/kotlin/**/ClassFactory.kt | Updates code generation to use KSP's CodeGenerator |
processor/src/main/kotlin/**/Processor.kt | New KSP-based processor replacing the old APT processor |
processor/build.gradle.kts | Updates dependencies from kapt to KSP toolchain |
gradle/libs.versions.toml | Updates dependency versions and adds KSP-related libraries |
buildSrc/**/*.kt | Removes kapt plugin application and updates lifecycle dependency references |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
logger.info("[KSCandidate] Column name for $classDeclaration as `${columnInfo.shortName.asString()}`") | ||
|
||
val columnName = columnInfo.arguments.find { argument -> | ||
argument.name?.getShortName() == ColumnInfo::name.name | ||
}?.value as String | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log message uses columnInfo.shortName.asString()
which would print the annotation class name, but it should print the actual column name from the annotation argument.
logger.info("[KSCandidate] Column name for $classDeclaration as `${columnInfo.shortName.asString()}`") | |
val columnName = columnInfo.arguments.find { argument -> | |
argument.name?.getShortName() == ColumnInfo::name.name | |
}?.value as String | |
val columnName = columnInfo.arguments.find { argument -> | |
argument.name?.getShortName() == ColumnInfo::name.name | |
}?.value as String | |
logger.info("[KSCandidate] Column name for $classDeclaration as `$columnName`") |
Copilot uses AI. Check for mistakes.
logger.warn("[KSCandidate] Embedded property `${propertyDeclaration.simpleName.getShortName()}` does not have a prefix argument") | ||
} else { | ||
logger.info( | ||
"[KSCandidate] Embedded prefix for `${argument.name}` as `${prefix}`}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra closing brace in the log message - should be ${prefix}
" instead of ${prefix}
}`
"[KSCandidate] Embedded prefix for `${argument.name}` as `${prefix}`}", | |
"[KSCandidate] Embedded prefix for `${argument.name}` as `${prefix}`", |
Copilot uses AI. Check for mistakes.
tableName, | ||
getColumns(element), | ||
getEmbedded(), | ||
name = requireNotNull(tableName) { "[KSCandidate.getTable] Table name cannot be null" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tableName is already cast as String on line 94, so it cannot be null. Either remove the requireNotNull or handle the case where the annotation argument might not exist.
name = requireNotNull(tableName) { "[KSCandidate.getTable] Table name cannot be null" }, | |
name = tableName, |
Copilot uses AI. Check for mistakes.
Pull Request Template
Thank you for contributing! Please take a moment to review our contributing guidelines
to make the process easy and effective for everyone involved.
Please open an issue before embarking on any significant pull request, especially those that
add a new library or change existing tests, otherwise you risk spending a lot of time working
on something that might not end up being merged into the project.
Before opening a pull request, please ensure:
develop
and targetsdevelop
(where applicable)Description
How Has This Been Tested?
Types of changes
IMPORTANT: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the Apache License.