-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
280 lines (221 loc) · 8.04 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
import java.nio.file.StandardCopyOption;
import org.apache.tools.ant.filters.*
buildscript {
// set property in surrounding env.
ext { sbv = '1.4.3.RELEASE' }
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${sbv}")
classpath("io.spring.gradle:dependency-management-plugin:0.6.1.RELEASE")
classpath("org.hidetake:gradle-ssh-plugin:2.2.0")
}
}
ext {
vaadinv = '7.7.3'
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.hidetake.ssh'
apply plugin: 'maven'
apply plugin: 'signing'
sourceSets {
main {
resources {
exclude '**/node_modules/*'
exclude '**/bower_components/*'
}
}
}
//https://docs.gradle.org/current/userguide/signing_plugin.html
signing { sign configurations.archives }
test { filter { includeTestsMatching "*Test*" } }
def fileToPath(file) {
java.nio.file.Paths.get(file.getAbsolutePath())
}
group = "com.jianglibo"
archivesBaseName = "easyinstaller"
version = "0.1.5"
jar {
baseName = 'easyinstaller'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
maven { url "http://maven.jahia.org/maven2" }
maven { url "https://oss.sonatype.org/content/repositories/releases/"}
maven {url 'http://maven.vaadin.com/vaadin-addons'}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-jdbc")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.boot:spring-boot-starter-freemarker")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-data-rest")
compile("org.springframework.boot:spring-boot-starter-data-jpa") {
exclude group: "org.hibernate", module: "hibernate-entitymanager"
}
compile("org.springframework.boot:spring-boot-starter-hateoas")
compile("org.springframework.boot:spring-boot-devtools")
compile("com.vaadin:vaadin-spring-boot:1.1.1")
compile("de.fatalix:codmirror-addon:1.2.2")
// http://mvnrepository.com/artifact/com.vaadin/vaadin-themes
compile group: 'com.vaadin', name: 'vaadin-themes', version: "${vaadinv}"
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.6.2'
compile group: 'org.peimari', name: 'maddon', version: '1.15'
// http://mvnrepository.com/artifact/com.vaadin/vaadin-server
compile group: 'com.vaadin', name: 'vaadin-server', version: "${vaadinv}"
// http://mvnrepository.com/artifact/com.vaadin/vaadin-widgets
compile group: 'com.vaadin', name: 'vaadin-widgets', version: "${vaadinv}"
// http://mvnrepository.com/artifact/com.vaadin/vaadin-client-compiled
compile group: 'com.vaadin', name: 'vaadin-client-compiled', version: "${vaadinv}"
// https://mvnrepository.com/artifact/com.vaadin/vaadin-push
compile group: 'com.vaadin', name: 'vaadin-push', version: "${vaadinv}"
// http://mvnrepository.com/artifact/commons-beanutils/commons-beanutils
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.2'
compile("org.eclipse.persistence:org.eclipse.persistence.jpa:2.6.4")
compile('org.springframework.security:spring-security-acl:4.0.4.RELEASE')
// https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.6.6'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.6.6'
compile group: 'org.vaadin.addons.lazyquerycontainer', name: 'vaadin-lazyquerycontainer', version: '7.6.1.3'
// https://mvnrepository.com/artifact/com.h2database/h2
//compile group: 'com.h2database', name: 'h2', version: '1.4.193'
// https://mvnrepository.com/artifact/org.hsqldb/hsqldb
compile group: 'org.hsqldb', name: 'hsqldb', version: '2.3.4'
compile group: 'com.jianglibo.easyinstaller', name: 'scriptsnippets', version: '0.1.4'
compile("mysql:mysql-connector-java")
compile("commons-fileupload:commons-fileupload:1.3.1")
compile("org.apache.httpcomponents:fluent-hc:4.5")
compile("com.github.bingoohuang:patchca:0.0.1")
compile('com.jayway.jsonpath:json-path:2.1.0')
// https://mvnrepository.com/artifact/com.jcraft/jsch
compile group: 'com.jcraft', name: 'jsch', version: '0.1.54'
// https://mvnrepository.com/artifact/org.flywaydb/flyway-core
compile group: 'org.flywaydb', name: 'flyway-core', version: '4.0.3'
compile("javax.inject:javax.inject:1")
// https://mvnrepository.com/artifact/net.sourceforge.htmlunit/htmlunit
// compile group: 'net.sourceforge.htmlunit', name: 'htmlunit', version: '2.23'
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.springframework.security:spring-security-test:4.2.0.RELEASE")
testCompile("org.skyscreamer:jsonassert:1.2.3")
// https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
// https://mvnrepository.com/artifact/org.mockito/mockito-all
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}
task listJars {
doLast {
def dpFile = new File("fixtures/out/dp.txt")
PrintWriter writer = new PrintWriter(dpFile)
configurations.compile.each { File file -> writer.println(file.name) }
writer.close();
}
}
task copyember {
doLast {
copy {
from '../m3958-ember/dist'
into 'src/main/resources/static/dist'
}
FileCollection collection = files('../m3958-ember/dist/index.html','../m3958-ember/dist/crossdomain.xml','../m3958-ember/dist/robots.txt')
copy {
from collection
into 'src/main/resources/templates/llapp'
}
}
}
task fileToCopyList {
// Project.files(), always use project root folder as base.
doLast {
FileCollection collection = files('../m3958-ember/dist/index.html','../m3958-ember/dist/crossdomain.xml','../m3958-ember/dist/robots.txt')
collection.each {println it}
}
}
task wrapper(type: Wrapper) { gradleVersion = '3.2.1' }
task demoFindAll {
doLast {
def list = [1, 2, 3, 4]
def f = list.find { ele -> ele == 2 }
println f;
}
}
task demoFindFile {
// def source = fileTree(dir: '../m3958-ember').matching { include 'org/gradle/api/**' }
// 单个文件each的话,就变成了行对象。
doLast {
def source = fileTree(dir: '../m3958-ember/dist').findAll { File fn ->
String fns = fn.toString()
fns.endsWith(".js") || fns.endsWith(".css")
}
source.each {println it}
}
}
/**
gradle 的task具备许多方法和属性,https://docs.gradle.org/current/dsl/org.gradle.api.Task.html
其它对象也是。
*/
task demoSubstitude {
doLast {
def f = file('fixtures/gradle/abc.txt')
copy {
into temporaryDir
from f
filter(ReplaceTokens, tokens:[name:'jlb'])
}
println fileToPath(temporaryDir).resolve('abc.txt')
copy {
into 'fixtures/gradle'
from temporaryDir
}
}
}
/*
* 定义
* String x
def o
尾部;可选
返回值 return可选
*/
/* closure
*
{ item++ }
{ -> item++ }
{ println it }
{ it -> println it }
{ name -> println name }
{ String x, int y ->
println "hey ${x} the value is ${y}"
}
{ reader ->
def line = reader.readLine()
line.trim()
}
def code = { 123 }
assert code() == 123 same to next.
assert code.call() == 123
*/
/*
* def colors = [red: '#FF0000', green: '#00FF00', blue: '#0000FF'] map
*
*
*
* */
//copy {
// into 'build/webroot'
// exclude '**/.svn/**'
// from('src/main/webapp') {
// include '**/*.jsp'
// filter(ReplaceTokens, tokens:[copyright:'2009', version:'2.3.1'])
// }
// from('src/main/js') {
// include '**/*.js'
// }
//}