문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
gradle:javascript [2012/10/10 12:20] kwon37xi 새로 만듦 |
gradle:javascript [2012/10/23 16:23] kwon37xi |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Gradle Javascript Plugin ====== | ====== Gradle Javascript Plugin ====== | ||
- | * http:// | ||
+ | ====== gradle-js-plugin ====== | ||
+ | * http:// | ||
+ | ====== gradle-jslint-plugin ====== | ||
+ | * https:// | ||
+ | ====== Closure Compiler API ====== | ||
+ | * [[https:// | ||
+ | <code groovy> | ||
+ | void minifyJsFile(final Set< | ||
+ | final String warningLevel, | ||
+ | Compiler compiler = new Compiler() | ||
+ | CompilationLevel.valueOf(compilationLevel).setOptionsForCompilationLevel(options) | ||
+ | WarningLevel level = WarningLevel.valueOf(warningLevel) | ||
+ | level.setOptionsForWarningLevel(options) | ||
+ | List< | ||
+ | if (externsFiles.size()) { | ||
+ | externs.addAll(externsFiles.collect() { JSSourceFile.fromFile(it) }) | ||
+ | } | ||
+ | List< | ||
+ | inputFiles.each { inputFile -> | ||
+ | inputs.add(JSSourceFile.fromFile(inputFile)) | ||
+ | } | ||
+ | Result result = compiler.compile(externs, | ||
+ | if (result.success) { | ||
+ | outputFile.write(compiler.toSource()) | ||
+ | } else { | ||
+ | result.errors.each { | ||
+ | println " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ |