Created
April 8, 2015 17:57
-
-
Save gregturn/ed71c6f6a8c1efa6ae74 to your computer and use it in GitHub Desktop.
CSS and SASS inside gradle
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
| import org.apache.tools.ant.taskdefs.condition.Os | |
| apply plugin: 'java' | |
| apply plugin: 'com.github.robfletcher.compass' | |
| jar { | |
| from 'dist' | |
| eachFile { details -> | |
| details.path = details.path.startsWith('META-INF') ?: 'static/'+details.path | |
| } | |
| // Jar contains duplicate empty folders, see Gradle issue: | |
| // http://issues.gradle.org/browse/GRADLE-1830 | |
| // so we need to set includeEmptyDirs to false | |
| includeEmptyDirs = false | |
| } | |
| task npmInstall(type:Exec) { | |
| // be Gradle-like and suppress boilerplate logging | |
| logging.captureStandardOutput LogLevel.INFO | |
| // but we do always want to see downloads in the log | |
| logging.captureStandardError LogLevel.LIFECYCLE | |
| inputs.files "package.json", "bower.json" | |
| outputs.dir "node_modules" | |
| if(Os.isFamily(Os.FAMILY_WINDOWS)) { | |
| commandLine 'cmd', '/c', 'npm', 'install' | |
| } else { | |
| commandLine 'npm', 'install' | |
| } | |
| } | |
| task npmBuild(dependsOn: npmInstall, type:Exec) { | |
| logging.captureStandardOutput LogLevel.INFO | |
| logging.captureStandardError LogLevel.INFO | |
| inputs.dir "src" | |
| inputs.file "gulpfile.js" | |
| outputs.dir "dist" | |
| if(Os.isFamily(Os.FAMILY_WINDOWS)) { | |
| commandLine 'cmd', '/c', 'npm', 'run', 'build' | |
| } else { | |
| commandLine 'npm', 'run', 'build' | |
| } | |
| } | |
| task npmSass(dependsOn: npmBuild, type:Exec) { | |
| logging.captureStandardOutput LogLevel.INFO | |
| logging.captureStandardError LogLevel.INFO | |
| } | |
| jar.dependsOn npmBuild | |
| idea.module { | |
| // see .gitignore | |
| excludeDirs += [ | |
| file('dist'), | |
| file('src/lib'), | |
| file('node_modules') | |
| ] | |
| } | |
| compass { | |
| cssDir = file("dist/css-new") | |
| sassDir = file("src/sass") | |
| } | |
| dependencies { | |
| jrubyExec group: 'rubygems', name: 'sass-css-importer', version: '1.0.0.beta.0' | |
| } |
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
| @import url(CSS:../pui-v1.4.0/pivotal-ui.css); |
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
| @import "CSS:../pui-v1.4.0/pivotal-ui.css"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment