-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
89 lines (73 loc) · 1.48 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
plugins {
id 'com.enonic.defaults' version "1.0.3"
id 'com.moowork.node' version "1.2.0"
id 'java'
id 'maven'
id 'maven-publish'
}
repositories {
mavenLocal()
jcenter()
maven {
url 'http://repo.enonic.net/artifactory/public'
}
}
node {
version '8.9.4'
download true
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
exclude '*'
}
}
}
task copy(type: Copy) {
from './'
into 'build/resources/main/lib/render-js/'
include(
'dom.es', // 3
'html.es', // 1
'index.js', // 1
'ncss.es', // 2
'src/**/*', // 4 obj // 5 class
'util.es'
)
rename { String fileName ->
fileName.replace('.js', '.es')
}
}
assemble.dependsOn copy
assemble.mustRunAfter copy
task webpack(type:NodeTask) {
script = file('node_modules/.bin/webpack')
args = [
'--color',
'--config', 'webpack.config.babel.js'
]
}
webpack.dependsOn npmInstall
assemble.dependsOn webpack
assemble.mustRunAfter webpack
task test(type:Exec, overwrite: true) {
executable 'npm'
args 'run', 'mocha', 'test/*.test*', 'test/*/*.test*', 'test/*/*/*.test*'
}
test.dependsOn webpack
test.mustRunAfter webpack
build.dependsOn test
build.mustRunAfter test
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}