-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
128 lines (112 loc) · 3.7 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
// Copyright (c) 2019 Gonzalo Müller Bravo.
// Licensed under the MIT License (MIT), see LICENSE.txt
plugins {
id 'all.shared.gradle.project-style-checker' version '1.0.2'
id 'all.shared.gradle.code-common-tasks' version '1.0.1'
id 'com.moowork.node' version '1.2.0'
}
repositories {
jcenter()
}
node {
version = NODE_VERSION
download = true
}
final MAIN_FOLDER = "$projectDir/src/main"
task assessStyleConfig(type: NpmTask) {
// NpmTask task settings
args = ['run', 'gradle-config-lint', baseStyleConfig.front.eslintNpmConfigArg, '--silent']
// gradle task settings
group = codeCommonTasks.groupForAssessTasks
inputs.file '.eslintrc.json'
inputs.file 'package.json'
inputs.files fileLister.obtainFullFileTree('config', [includes: ['*.js']])
inputs.property('configFile', baseStyleConfig.front.eslintNpmConfigArg)
outputs.upToDateWhen { true }
}
task assessStyleMain(type: NpmTask) {
// NpmTask task settings
args = ['run', 'main-lint', '--silent']
// gradle task settings
group = codeCommonTasks.groupForAssessTasks
inputs.file 'package.json'
inputs.file 'tslint.json'
inputs.files fileLister.obtainFullFileTree(MAIN_FOLDER, [includes: ['*.ts', '*.tsx']])
outputs.upToDateWhen { true }
}
task assessStyleCss(type: NpmTask) {
// NpmTask task settings
args = ['run', 'gradle-style-lint', baseStyleConfig.front.stylelintNpmConfigArg, '--silent']
// gradle task settings
group = codeCommonTasks.groupForAssessTasks
inputs.file 'package.json'
inputs.files fileLister.obtainFullFileTree(MAIN_FOLDER, [includes: ['*.css']])
inputs.property('configFile', baseStyleConfig.front.stylelintNpmConfigArg)
outputs.upToDateWhen { true }
shouldRunAfter 'assessStyleMain'
}
task assessMain {
dependsOn 'assessStyleMain', 'assessStyleCss'
}
task assemble(type: NpmTask) {
// NpmTask task settings
args = ['run', 'assemble', '--silent']
// gradle task settings
inputs.dir 'src/main'
inputs.file 'config/main/tsconfig.main.json'
inputs.file 'package.json'
outputs.dir 'build/www'
}
task assessStyleTest(type: NpmTask) {
// NpmTask task settings
args = ['run', 'gradle-test-eslint', baseStyleConfig.front.eslintNpmConfigArg, '--silent']
// gradle task settings
group = codeCommonTasks.groupForAssessTasks
inputs.dir 'config/test'
inputs.dir 'src/test'
inputs.file 'package.json'
inputs.file '.eslintrc.json'
inputs.property('configFile', baseStyleConfig.front.eslintNpmConfigArg)
outputs.upToDateWhen { true }
shouldRunAfter 'assessStyleMain'
}
task assessTest {
dependsOn 'assessStyleTest'
}
task test(type: NpmTask) {
// NpmTask task settings
args = ['run', 'test', '--silent']
// gradle task settings
inputs.dir 'config/test'
inputs.dir 'src/test'
inputs.file 'package.json'
outputs.dir 'build/reports/tests'
}
task assessStyleE2e(type: NpmTask) {
// NpmTask task settings
args = ['run', 'gradle-e2e-lint', baseStyleConfig.front.eslintNpmConfigArg, '--silent']
// gradle task settings
group = codeCommonTasks.groupForAssessTasks
inputs.property('configFile', baseStyleConfig.front.eslintNpmConfigArg)
inputs.dir 'src/e2e'
inputs.file '.eslintrc.json'
inputs.file 'package.json'
inputs.file 'src/e2e/.eslintrc.json'
outputs.upToDateWhen { true }
shouldRunAfter 'assessStyleMain'
}
task e2e(type: NpmTask) {
// NpmTask task settings
args = ['run', 'e2e', '--silent']
// gradle task settings
inputs.dir 'config/e2e'
inputs.dir 'src/main'
inputs.dir 'src/e2e'
inputs.file 'package.json'
shouldRunAfter 'test', 'assessStyleE2e', 'build'
outputs.dir 'build/reports/e2e'
}
task run(type: NpmTask) {
args = ['run', 'run', '--silent']
}
defaultTasks 'assessCommon', 'assessGradle', 'npmInstall', 'assessStyleConfig', 'build', 'e2e'