forked from PistoiaHELM/HELMWebEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
102 lines (88 loc) · 2.54 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
*/
plugins {
id "base"
id "com.eriwen.gradle.js" version "2.12.0"
}
import com.eriwen.gradle.js.tasks.MinifyJsTask
import com.eriwen.gradle.js.tasks.CombineJsTask
def name = "hwe"
version = "1.1.4"
def rootDir = "HELM/source"
def srcDir = "HELM/source/helm"
def libDir = "HELM/source/JSDraw"
def htmlDir = "HELM/source/examples"
def pakoDir = "HELM/source/pako"
def buildDir = "build"
def distDir = "dist"
def libName = "Pistoia.HELM.js"
def dynamicTaskNames = []
def dynamicTaskIndex = 1
new File(srcDir).eachFile { def file ->
def dynamicTaskName = "taskMinify${dynamicTaskIndex}"
task "${dynamicTaskName}"(type: MinifyJsTask) {
source = file.absolutePath
dest = "${buildDir}/min.${file.name}"
closure {
warningLevel = 'QUIET'
compilerOptions.languageIn = 'ECMASCRIPT5'
}
}
dynamicTaskNames << dynamicTaskName
dynamicTaskIndex++
}
task minify(dependsOn: dynamicTaskNames) {
println ("minify configured")
}
// Create new CombineJsTasks if you have multiple sets of JS files
task combine(type: CombineJsTask) {
source = files(
"${buildDir}/min.helm.js",
"${buildDir}/min.Interface.js",
"${buildDir}/min.MonomerColors.js",
"${buildDir}/min.Monomers.js",
"${buildDir}/min.Plugin.js",
"${buildDir}/min.Chain.js",
"${buildDir}/min.Layout.js",
"${buildDir}/min.IO.js",
"${buildDir}/min.MonomerExplorer.js",
"${buildDir}/min.MolViewer.js",
"${buildDir}/min.Formula.js",
"${buildDir}/min.MonomerManager.js",
"${buildDir}/min.ExtinctionCoefficient.js",
"${buildDir}/min.App.js",
"${buildDir}/min.AppToolbar.js",
"${buildDir}/min.MonomerLibApp.js",
"${buildDir}/min.RuleSet.js",
"${buildDir}/min.RuleSetApp.js",
"${buildDir}/min.Adapter.js"
)
//source = fileTree(dir: "${buildDir}")
dest = file("${distDir}/hwe/JSDraw/${libName}")
}
task copyLib(type: Copy) {
from ("${libDir}") {
include "Scilligence.JSDraw2.Lite.js", "Scilligence.JSDraw2.Resources.js"
}.
into "${distDir}/hwe/JSDraw"
}
task copyHtml(type: Copy) {
from "${htmlDir}"
into "${distDir}/hwe/examples"
}
task copyPako(type: Copy) {
from "${pakoDir}"
into "${distDir}/hwe/pako"
}
task zip(type: Zip) {
from("$distDir") {
include "hwe/**"
}
//from "${distDir}/hwe"
archiveName "${name}-${version}.zip"
destinationDir file("${distDir}")
}