Comments (10)
I haven't tried maven yet, but Gradle is using maven repositories, and the artifacts are on google maven repository, it should work out of box on maven. You need to add google maven repository to your project and use artifact ID "org.jetbrains.kotlin:kotlin-symbol-processing-api:1.4-M1-dev-experimental-20200610".
from ksp.
But for using the processors you write in maven, this will be non-trivial as currently there is only gradle plugin support.
from ksp.
Not sure if this falls under the same question but currently i'm using KSP to process some JAXB generated classes:
- JAXB generates classes in Java
- my KSP based plugin then generates more kotlin classes based on those
- gradle compiles the generated java and kotlin sources and packages them into a jar
com.company.codegen:myLibrary:1.0.0
would the KSP generated classes be visible/usable by the consumer of the JAR?
from ksp.
Following up on this. If i package up the XJC generated classes and the KSP generated classes and install the package into my local .m2, then i'm able to access all generated artifacts (XJC and KSP) in both maven and gradle project without modifying the source sets.
from ksp.
@i-walker There is this project in github, which does exactly this.
https://github.com/Dyescape/kotlin-maven-symbol-processing
I tried it and works and the solution seems easy and clean. I have zero idea how it is done though.
My problem is, that I need to add a parameter and I don't find a way to do it.
Any ideas?
from ksp.
Thanks @teras it worked fine 🙌🏾
from ksp.
For future reference: it's even possible to add options. The documentation of kotlin-maven-symbol-processing has been updated to demonstrate just this.
from ksp.
@i-walker There is this project in github, which does exactly this. https://github.com/Dyescape/kotlin-maven-symbol-processing I tried it and works and the solution seems easy and clean. I have zero idea how it is done though. My problem is, that I need to add a parameter and I don't find a way to do it. Any ideas?
I haven't tested this myself, but please feel free to close the issue if the solution works.
I've ported my projects to gradle and no longer need maven support. Regardless though, i'm happy this works 🙂
from ksp.
Anyone have an existing sample on github?
from ksp.
@BreimerR https://github.com/MorphiaOrg/critter/blob/master/tests/maven/kotlin/pom.xml#L51
from ksp.
Related Issues (20)
- [KSP2] Annotation value is missing in nested annotations
- Configuration kspKotlin<ios target>ProcessorClasspath was resolved during configuration time after updating to Kotlin 2.2 RC1
- [KSP2] Type annotation value is missing in nested annotations
- [KSP2] Annotation arguments with default values are missing
- [KSP2] Couldn't find enum values in annotation args
- KSP2 cannot load Android lint checks jar due to `FileTooBigException` HOT 1
- [KSP2] Couldn't find type values in annotation args HOT 1
- [KSP2] Hilt incompatibility: `Did you forget to apply the Gradle Plugin?`
- [KSP2] KSAnnotations with KClass properties with a default value always resolve to error types HOT 1
- [KSP2] KSAnnotations with annotation properties with a default value always resolve to null HOT 1
- ksp configurations do not resolve versions from gradle platform
- [KSP2] Kotlin `Function*` types reports inconsistent package and qualified names
- [KSP2] Intersection types are not modeled
- Typealias annotation parameters are resolved as "alias target", not the type alias itself
- [Help Wanted] Cannot get build directory using codegenerator
- Stack overflow when resolving the type of typealias + cycles
- [KSP2] Modifier.FUN is missing in functional interfaces
- KSP2: KtInvalidLifetimeOwnerAccessException: Access to invalid KtAlwaysAccessibleLifetimeToken: PSI has changed since creation
- [ksp] [Hilt] Cannot update Dagger/Hilt to 2.49
- [KSP2] Nullable type arg type becomes non-null after replace() call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ksp.