If I need an hook immediately after the generation...
# javascript
e
If I need an hook immediately after the generation of .d.ts files, what would the correct Gradle task be?
a
The type of the task should be
KotlinJsIrLink
e
Perfect, thanks Artem.
Seems like something is overriding my changes to the types.
Copy code
> Task :parsers:compileDevelopmentLibraryKotlinJs
> Task :parsers:compileDevelopmentLibraryKotlinJsUpdateTsTypes UP-TO-DATE
> Task :parsers:jsDevelopmentLibraryCompileSync UP-TO-DATE
> Task :parsers:jsDevelopmentLibraryValidateGeneratedByCompilerTypeScript
My task
compileDevelopmentLibraryKotlinJsUpdateTsTypes
is executed immediately after the link one, but one of the two that comes after is copying over the files again, or regenerating the types.
Solved. I removed the new task registration, and instead executed the file changes inside a
doLast
Copy code
binaries.withType<JsIrBinary>().configureEach {
  linkTask.configure {
    ...
    doLast {
      updateTypeScriptTypes(destinationDirectory)
    }
  }
}