forked from eriwen/gradle-js-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
issue34.gradle
49 lines (43 loc) · 1.12 KB
/
issue34.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.eriwen:gradle-js-plugin:1.2'
}
}
apply plugin: 'js'
javascript.source {
custom {
js {
srcDir "src/test/resources"
include "file*.js"
}
}
}
task combineAJs(type: com.eriwen.gradle.js.tasks.CombineJsTask) {
source = javascript.source.custom.js.files
dest = "${buildDir}/js/a.js"
}
task combineBJs(type: com.eriwen.gradle.js.tasks.CombineJsTask) {
source = javascript.source.custom.js.files
dest = "${buildDir}/js/b.js"
}
task minifyAJs(type: com.eriwen.gradle.js.tasks.MinifyJsTask) {
source = combineAJs
dest = file("${buildDir}/js/a-min.js")
closure {
compilationLevel = 'SIMPLE_OPTIMIZATIONS'
warningLevel = 'QUIET'
}
}
task minifyBJs(type: com.eriwen.gradle.js.tasks.MinifyJsTask) {
source = combineBJs
dest = file("${buildDir}/js/b-min.js")
closure {
compilationLevel = 'ADVANCED_OPTIMIZATIONS'
externs = files("src/test/resources/externs.js")
warningLevel = 'QUIET'
}
}