Skip to content

IgorKey/gradle-npm-run-plugin

 
 

Repository files navigation

gradle-npm-run-plugin

Circle CI

A Gradle Plugin to create lifecycle tasks that trigger npm run commands.

Usage

  1. Apply the plugin
  2. Add npm to your devDependencies block in your package.json
  3. Configure your package.json scripts block

This will allow you to have a consistent Gradle task interface between your NPM + Java projects. You should be able to run commands like the following:

./gradlew build -x check

It will build your NPM package without running the tests.

Tasks

The following tasks are added:

  • clean - Runs npm run clean
  • test - Runs npm run test
  • check - Depends on :test
  • build - Runs npm run build and depends on :check. Builds the production-ready version of the assets.
  • buildDev - Runs npm run buildDev and depends on :check. Builds the development-mode version of the assets.

Configuration

You can configure the npm run * commands in your build.gradle. Here's an example:

npmRun {
    clean       "other-clean"       // defaults to "clean"
    test        "other-test"        // defaults to "test"
    build       "other-build"       // defaults to "build"
    buildDev    "other-buildDev"    // defaults to "buildDev"
}

Contributing

Before working on the code, if you plan to contribute changes, please read the CONTRIBUTING document.

License

This project is made available under the Apache 2.0 License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 97.9%
  • Shell 2.1%