Last active
August 29, 2015 14:20
-
-
Save double16/c27be33bacf83fa5d626 to your computer and use it in GitHub Desktop.
Gradle-Bower blog post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*= require_tree bower_components | |
*= require main | |
*= require mobile | |
*= require_self | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//= require_tree bower_components | |
//= require_self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "pet-store", | |
"description": "", | |
"version": "0.1.0", | |
"homepage": "https://github.com/double16/pet-store", | |
"license": "MIT", | |
"private": false, | |
"dependencies": { | |
"jquery": "~2.1.0", | |
"angular": "~1.3.15", | |
"angular-route": "~1.3.15", | |
"angular-loader": "~1.3.15", | |
"angular-animate": "~1.3.15", | |
"angular-cookies": "~1.3.15", | |
"angular-resource": "~1.3.15", | |
"angular-sanitize": "~1.3.15", | |
"angular-touch": "~1.3.15", | |
"angular-mocks": "~1.3.15", | |
"animate.css": "3.x" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task bowerInstall(type: NodeTask) { | |
script = file('node_modules/bower/bin/bower') | |
args = ["--config.storage.cache=${gradle.getGradleUserHomeDir()}/caches/bower/cache", | |
"--config.storage.packages=${gradle.getGradleUserHomeDir()}/caches/bower/packages", | |
"--config.storage.registry=${gradle.getGradleUserHomeDir()}/caches/bower/registry", | |
'install'] | |
inputs.files file('bower.json') | |
outputs.files file('bower_components') | |
dependsOn npmPackages | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
processResources.dependsOn bowerPackages | |
assetCompile.dependsOn bowerPackages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task bowerPackages() { | |
dependsOn bowerSyncJavascript, bowerSyncStylesheets | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task bowerSyncJavascript(type: Sync) { | |
from 'bower_components' | |
into "grails-app/assets/javascripts/bower_components" | |
exclude '**/*.min.js' | |
exclude '**/angular*/index.js' | |
exclude '**/angular*/ng*.js' | |
include 'jquery/dist/jquery.js' | |
include 'angular*/**/*.js' | |
dependsOn bowerInstall | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task bowerSyncStylesheets(type: Sync) { | |
from 'bower_components' | |
into "grails-app/assets/stylesheets/bower_components" | |
include 'angular*/**/*.css' | |
include 'animate.css/animate.css' | |
dependsOn bowerInstall | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clean.delete << file('grails-app/assets/javascripts/bower_components') | |
clean.delete << file('grails-app/assets/stylesheets/bower_components') | |
clean.delete << file('node_modules') | |
clean.delete << file('bower_components') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/node_modules | |
bower_components |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
dependencies { | |
classpath 'com.moowork.gradle:gradle-node-plugin:0.9' | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
version = '0.12.2' | |
npmVersion = '2.7.5' | |
download = true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task npmCacheConfig(type: NpmTask) { | |
description = "Configure the NPM cache" | |
def npmCacheDir = "${gradle.getGradleUserHomeDir()}/caches/npm" | |
outputs.files file(npmCacheDir) | |
args = [ 'config', 'set', 'cache', npmCacheDir ] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task npmPackages(type: NpmTask, dependsOn: npmCacheConfig) { | |
description = "Install Node.js packages" | |
args = [ 'install' ] | |
inputs.files file('package.json') | |
outputs.files file('node_modules') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"engines": { | |
"node": "0.12.x" | |
}, | |
"name": "pet-store", | |
"private": false, | |
"version": "0.1.0", | |
"description": "", | |
"repository": "https://github.com/double16/pet-store", | |
"license": "MIT", | |
"main": "", | |
"dependencies": { | |
"bower": "^1.4.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment