-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add js exports generation #844
Conversation
skiko/build.gradle.kts
Outdated
outputs.file(skikoTestMjs) | ||
} | ||
|
||
listOf(main, test).forEach { |
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.
Do we need this piece at all?
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.
I rebased on master, therefore this comment doesn't link anymore to the code.
This part is indeed needed:
KotlinCompilerPluginSupportPlugin
has a method fun getPluginArtifact()
which we override. We return SubpluginArtifact(SkikoArtifacts.groupId, IMPORT_GENERATOR)
with null version. Therefore by default it tries to get the same version as koltin version.
Since our compiler plugin is not published, we need to substitute this implicit dependency.
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.
Also I moved it to buildSrc
skiko/build.gradle.kts
Outdated
} | ||
|
||
abstract class AbstractImportGeneratorCompilerPluginSupportPlugin( |
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.
it seems it might sense to keep this in buildSrc
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.
Moved to buildSrc.
78fba00
to
23b3541
Compare
This contribution was made by @ilgonmic ! Thank you Ilya!
Description:
To ensure that setup.mjs file contains correct exports, we better generate it than maintain manually.
It's done by a compiler plugin, which looks at WasmImport annotations and takes the name value from it.
P.S. our build.gradle.kts is quite big already (~1.8k lines). I tried to move new part to buildSrc, but I didn't manage to make work. I'll try to think about it separately.
UPD: a separate PR to split the build.gradle.kts into smaller parts - #845