https://github.com/palantir/gradle-npm-run-plugin
https://github.com/palantir/gradle-npm-run-plugin
octo-correct-managed
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/palantir/gradle-npm-run-plugin
- Owner: palantir
- License: apache-2.0
- Created: 2016-03-24T16:33:01.000Z (about 9 years ago)
- Default Branch: develop
- Last Pushed: 2024-09-13T02:26:16.000Z (9 months ago)
- Last Synced: 2024-09-13T15:07:58.226Z (9 months ago)
- Topics: octo-correct-managed
- Language: Groovy
- Size: 206 KB
- Stars: 20
- Watchers: 206
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
gradle-npm-run-plugin
=====================
[](https://circleci.com/gh/palantir/gradle-npm-run-plugin)*WARNING:* This project is not used internally at Palantir and is no longer maintained. It will soon be archived.
A Gradle Plugin to create lifecycle tasks that trigger `npm run` commands.
Usage
-----
1. [Apply the plugin](https://plugins.gradle.org/plugin/com.palantir.npm-run)
1. Add `npm` to your `devDependencies` block in your `package.json`
1. Configure your `package.json` `scripts` blockThis 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:```bash
./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:```groovy
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](CONTRIBUTING.md) document.License
-------
This project is made available under the [Apache 2.0 License][license].[gradle-node-project]: https://github.com/srs/gradle-node-plugin
[license]: http://www.apache.org/licenses/LICENSE-2.0