forked from FineUploader/fine-uploader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
85 lines (68 loc) · 2.08 KB
/
build.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
def version = "3.2"
def filename = "fineuploader"
def srcDir = 'client'
def jsSrcDir = "$srcDir/js"
apply plugin: 'js'
def coreFiles = ["${jsSrcDir}/header.js",
"${jsSrcDir}/util.js",
"${jsSrcDir}/button.js",
"${jsSrcDir}/uploader.basic.js",
"${jsSrcDir}/dnd.js",
"${jsSrcDir}/uploader.js",
"${jsSrcDir}/handler.base.js",
"${jsSrcDir}/handler.form.js",
"${jsSrcDir}/handler.xhr.js"]
def cssFiles = ["$srcDir/fineuploader.css"]
def imageFiles = ["$srcDir/loading.gif",
"$srcDir/processing.gif"]
def jQueryPluginFiles = ["${jsSrcDir}/jquery-plugin.js"]
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.eriwen:gradle-js-plugin:1.0.2'
}
}
combineJs {
source = files(coreFiles)
dest = file("$buildDir/${filename}-${version}.js")
}
task combineJsJquery(type: com.eriwen.gradle.js.tasks.CombineJsTask) {
source = files(coreFiles + jQueryPluginFiles)
dest = file("$buildDir/jquery.${filename}-${version}.js")
}
minifyJs {
source = combineJs
dest = file("$buildDir/${filename}-${version}.min.js")
}
task minifyJsJquery(type: com.eriwen.gradle.js.tasks.MinifyJsTask) {
source = combineJsJquery
dest = file("$buildDir/jquery.${filename}-${version}.min.js")
}
task zipJquery(type: Zip) {
baseName "jquery.$filename-$version"
from files("$buildDir")
destinationDir file('release')
}
task zip(type: Zip) {
baseName "$filename-$version"
from files("$buildDir")
destinationDir file('release')
}
task copyResources(type:Copy) {
from cssFiles + imageFiles
into 'build'
rename { String fileName ->
fileName.replace('.css', "-${version}.css")
}
}
task clean << {
delete files("$buildDir")
}
task createJQueryRelease(dependsOn: ['clean', 'minifyJsJquery', 'copyResources', 'zipJquery']) {
outputs.upToDateWhen { false }
}
task createRelease(dependsOn: ['clean', 'minifyJs', 'copyResources', 'zip']) {
outputs.upToDateWhen { false }
}