Skip to content

Document how to use from Gradle #324

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ where possible options include:
-v, -version print version
```

# How to use from Gradle

Dukat will automatically run for npm dependencies by specifying the following in `build.gradle`:
```
kotlin.js.experimental.generateKotlinExternals=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only correct for Kotlin/JS Gradle plugin 1.3.x.
With 1.4 the property was renamed and you can now even configure per dependency whether to run Dukat on it or not.
But do you really think this belongs in the Dukat documentation?
I think this is more suited in the Kotlin/JS Gradle Plugin documentation and actually it is documented there: https://kotlinlang.org/docs/reference/js-external-declarations-with-dukat.html

```

The version of dukat can be specified in build.gradle.kts by adding the following:
```
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
...
NodeJsRootPlugin.apply(project).apply {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of applying the root plugin manually, you should just configure the extension like

configure<NodeJsRootExtension> {
    versions.dukat.version = "0.5.7"
}

Which should probably also be shown in the Kotlin/JS Gradle plugin documentation.

versions.dukat.version = "SPECIFIC-VERSION"
}
```

# How to setup and build

1. clone this project
Expand Down