| import org.gradle.api.tasks.Exec | |
| defaultTasks 'bower' | |
| // Get the path for the locally installed binaries | |
| task npmBin << { | |
| new ByteArrayOutputStream().withStream { os -> | |
| def result = exec { | |
| executable = 'npm' | |
| args = ['bin'] | |
| standardOutput = os | |
| } | |
| ext.binPath = os.toString().trim() + "/" | |
| } | |
| } | |
| // Install packages from package.json | |
| task npm(type: Exec) { | |
| description = "Grab NodeJS dependencies (from package.json)" | |
| commandLine = ["npm", "install"] | |
| inputs.file "package.json" | |
| outputs.dir "node_modules" | |
| tasks.npmBin.execute() | |
| } | |
| // Install the bower components for front-end library management | |
| task bower(dependsOn: 'npm', type: Exec){ | |
| commandLine "${npmBin.binPath}bower", 'install' | |
| } |
Showing posts with label bower. Show all posts
Showing posts with label bower. Show all posts
Friday, January 29, 2016
GRADLE & NODE NPM - gradle task for execute npm install and bower install
https://gist.github.com/spikeheap/8558786
Wednesday, November 25, 2015
BOWER - difference between tilde(~) and caret(^) before version number
In the simplest terms, the tilde matches the most recent minor version (the middle number). ~1.2.3 will match all 1.2.x versions but will miss 1.3.0.
The caret, on the other hand, is more relaxed. It will update you to the most recent major version (the first number). ^1.2.3 will match any 1.x.x release including 1.3.0, but will hold off on 2.0.0.
More is here.
Subscribe to:
Posts (Atom)