-
Notifications
You must be signed in to change notification settings - Fork 0
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
Working example with kotlin-multiplatform #1
Comments
Hi avwie, I'm not sure I understand your use case. If you are using Kotlin multi-platform doesn't the Kotlin compiler already generate JavaScript for you? This plugin is meant to be used together with a TypeScript based frontend (for example, an angular based UI), so that you do not have to rewrite your definitions on the backend, and frontend. It's like a 'Swagger lite' kind of tool. |
Hi ayedo, you are exactly right. I generate a JS common library which I use in the frontend. As I use Typescript in my frontend I would really like Typescript definitions and I came upon your project. However, when using the I think I lack in gradle experience, because I can't get your Gradle plugin to work. Because with the |
OK. Do you get an exception, or some message in the console? The plugin depends on a library that is not published on Maven-Central, and therefore the A future version of the plugin might bundle the dependencies as a fat JAR, so that the |
I'm having (maybe) a similar problem. Maybe some of what I've seen will shed some light on this. I'm also doing a mutlti-platform app, but I'm not doing JS. Just Android and iOS. I have some typedefs that I want to share from kotlin to a webview. I originally used the default My project is an android app, and has a second module that contains the files I want to create typedefs from. The main module is called "app" (default in android studio). The module I want is called "WebViewEventProxy" When I ran it with the default settings it ran without issue, but created an empty d.ts file because it didn't see my files. when I log
If I manually set the class path to:
It seems to run and find my files, but it fails because it can't find a class. @avwie this might fix your issue. This seems to work, but is there a more correct way in gradle to get this module path (other than hard coding it)? The other issue I'm having I think has to do with using the kotlinx serialize which uses reflection. Is there a way to tell it to ignore that or do I need to include the plugin in some way? This is the error I receive:
The class it's failing to create typedefs for looks like this:
I also tried adding:
but then I get the errror
thanks in advance for any help. |
thanks for your detailed description, but without reproduction it's kind of difficult to pinpoint the problem. Do you have a public repository, or a minimal project which I could look into? |
Is it possible to generate a working example with kotlin-multiplatform project? Preferably with a build.gradle.kts file.
I've tried a lot of different ways to make it work, but I can not get ts-defs from
commonMain
.The text was updated successfully, but these errors were encountered: