You can run any Yarn commands in your gradle scripts by using this plugin.
This plugin downloads any version of Yarn
into your .gradle
directory and you can use them from there.
Releases of this plugin are hosted at Gradle Plugin Portal.
If you use Gradle > 2.1, setup the plugin like this:
plugins {
id "me.taku_k.yarn" version "0.1.1"
}
Otherwise:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.me.taku_k.gradle.yarn:gradle-yarn-plugin:0.1.1"
}
}
apply plugin: "me.taku_k.yarn"
This task downloads a custom version of yarn
script from
GitHub - Yarn.
The directory where the script is saved is under the .gradle/yarn
in default setting.
This task installs packages that package.json
depends on.
If you would like to use a specified version of yarn
,
"yarn" extension block is like this:
yarn {
version = '0.17.9'
}