• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

eriwen/gradle-css-plugin: Gradle plugin for working with CSS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

eriwen/gradle-css-plugin

开源软件地址(OpenSource Url):

https://github.com/eriwen/gradle-css-plugin

开源编程语言(OpenSource Language):

JavaScript 88.7%

开源软件介绍(OpenSource Introduction):

Quick Start Build Status

Managing your CSS in a Gradle build is super easy now! Just add this to your build.gradle file:

Gradle 2.1+

plugins {
  id "com.eriwen.gradle.css" version "2.14.0"
}

Gradle 2.0-

// Grab the plugin from a Maven Repo automatically
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.eriwen:gradle-css-plugin:1.11.0'
    }
}

// Invoke the plugin
apply plugin: 'css'

// Declare your sources
css.source {
    dev {
        css {
            srcDir "app/styles"
            include "*.css"
            exclude "*.min.css"
        }
    }
}

// Specify a collection of files to be combined, then minified and finally GZip compressed.
combineCss {
    source = css.source.dev.css.files
    dest = "${buildDir}/all.css"
}

minifyCss {
    source = combineCss
    dest = "${buildDir}/all-min.css"
    yuicompressor { // Optional
        lineBreakPos = -1
    }
}

gzipCss {
    source = minifyCss
    dest = "${buildDir}/all.2.0.4.css"
}

LESS Support

css.source {
    dev {
        css {
            srcDir "app/styles"
            include "*.less"
        }
    }
}

lesscss {
    source = css.source.dev.css.asFileTree
    dest = "${buildDir}/styles"
}

Supports CSS Lint v0.9.10

csslint {
    source = css.source.dev.css.files
    dest = "${buildDir}/csslint.out"
}

Available Tasks and Options

combineCss

  • source = Collection of file paths of files to merge
  • dest = File/String Path for combined output

minifyCss (Uses the YUI Compressor)

  • source = File to minify
  • dest = File for minified output
  • (Optional) yuicompressor.lineBreakPos = -1 (default) Insert a line break after the specified column number

gzipCss

  • source = File to compress
  • dest = File/String path for compressed output

less

  • source = Files to transpile
  • dest = File/String output directory

csslint

  • source = Collection of file paths of files to analyze
  • dest = File for output
  • (Optional) format = 'compact' (default), 'text', 'lint-xml', or 'checkstyle-xml'
  • (Optional) warnings = (default is all) Collection of string ids for checks. Try csslint --list-rules to see all possible IDs
  • (Optional) errors = (default is none) Collection of string ids for checks. CAUTION: These cause a non-zero exit code and fail the build!

What, you want more? Let me know!

See Also

The Gradle JS Plugin!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap