-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
95 lines (79 loc) · 2.55 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
dependencies {
compile project(':common-ui')
compile project(':common-verifier')
compile project(':signer-protocol')
compile 'org.postgresql:postgresql:42.2.7'
testCompile project(':common-util').sourceSets.test.output
}
clean {
doLast {
project.delete "vendor/engines/common-ui"
project.delete "vendor/engines/center-common"
project.delete "log/development.log"
project.delete "db"
}
}
task copyCommon(type: Copy) {
into "vendor/engines/common-ui"
from "../common-ui"
include "Gemfile"
include "Rakefile"
include "common-ui.gemspec"
include "config/"
include "lib/**"
include "app/**"
include "public/**"
}
task copyCenterCommon {
doLast {
copy {
into "vendor/engines/center-common"
from "../center-common"
include "Gemfile"
include "Rakefile"
include "center-common.gemspec"
include "config/"
include "lib/**"
include "app/**"
include "db/**"
}
copy {
into "db/migrate"
from "../center-common/db/migrate"
}
}
}
task copyDeps(dependsOn: [copyCommon, copyCenterCommon], type: Copy) {
into "$buildDir/libs"
from configurations.compile
}
// Runs the migration steps on the database.
task updateSQLiteDbSchema(dependsOn: [copyDeps, ':center-service:build'], type: Exec) {
commandLine = ['rake', 'db:migrate', 'RAILS_ENV=test']
}
task rollbackSQLiteDbSchema(dependsOn: [copyDeps, ':center-service:build'], type: Exec) {
commandLine = ['rake', 'db:rollback', 'RAILS_ENV=test']
}
// FUTURE - We might want to get rid of warning at .war file generation
task warble(dependsOn: [copyDeps, ':center-service:build'], type: Exec) {
commandLine = ['jruby', '-S', 'warble']
}
task runModelTests(dependsOn: [updateSQLiteDbSchema], type: Exec) {
commandLine = ['jruby', '-S', 'rake', 'test:units', 'RAILS_ENV=test']
}
task runControllerTests(dependsOn: [updateSQLiteDbSchema], type: Exec) {
commandLine = ['jruby', '-S', 'rake', 'test:controllers', 'RAILS_ENV=test']
}
task checkRubySource(type: Exec) {
inputs.files fileTree('app') + fileTree('lib')
outputs.files file('build/rubocop-result.json')
commandLine = getRubySourceCheckCommand("$projectDir")
}
check.dependsOn checkRubySource
build.dependsOn copyDeps
sonarqube {
properties {
properties["sonar.sources"] += [file('app'), file('lib')]
property "sonar.ruby.rubocop.reportPath", file('build/rubocop-result.json')
}
}