forked from woocommerce/woocommerce-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
171 lines (142 loc) · 4.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
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
buildscript {
ext.kotlinVersion = '1.3.72'
ext.navigationVersion = '2.3.0'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.automattic.android:fetchstyle:1.1'
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
}
}
apply plugin: 'com.automattic.android.fetchstyle'
allprojects {
apply plugin: 'checkstyle'
repositories {
google()
jcenter()
maven {
url 'http://www.idescout.com/maven/repo/'
}
}
task checkstyle(type: Checkstyle) {
source 'src'
classpath = files()
}
checkstyle {
toolVersion = '8.3'
configFile file("${project.rootDir}/config/checkstyle.xml")
}
}
subprojects {
configurations {
ktlint
compile.exclude group: 'org.jetbrains' , module:'annotations-java5'
}
dependencies {
ktlint 'com.github.shyiko:ktlint:0.29.0'
}
task ktlint(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
}
task ktlintFormat(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
task ciktlint(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
/**
* Copies git-hooks from the `tools/team-props/git-hooks' directory to the `.git/hooks` folder
* at the root of this project.
*/
task installGitHooks(type: Copy) {
println "Copying git-hooks scripts from tools/team-props/git-hooks to .git/hooks"
from new File(rootProject.rootDir, 'tools/team-props/git-hooks')
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0777
}
ext {
fluxCVersion = '78c6ab15b59d51fb18cbc04bcb2e783ed28b941a'
daggerVersion = '2.25.2'
glideVersion = '4.10.0'
testRunnerVersion = '1.0.1'
espressoVersion = '3.0.1'
mockitoKotlinVersion = '2.1.0'
mockitoVersion = '2.28.2'
constraintLayoutVersion = '1.1.0'
multidexVersion = '1.0.3'
libaddressinputVersion = '0.0.2'
eventBusVersion = '3.1.1'
googlePlayCoreVersion = '1.6.4'
coroutinesVersion = '1.3.6'
archComponentsVersion = '2.2.0'
assertjVersion = '3.11.1'
aztecVersion = 'v1.3.40'
flipperVersion = '0.52.0'
}
tasks.getByPath('WooCommerce:preBuild').dependsOn installGitHooks
// Onboarding and dev env setup tasks
task checkBundler(type:Exec) {
doFirst {
println "Check Bundler"
}
workingDir = './'
executable "sh"
args "-c", "if ! type 'bundle' > /dev/null; then gem install bundler; fi"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method checkBundler.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
task checkBundle(type:Exec, dependsOn:checkBundler) {
doFirst {
println "Check Bundle"
}
workingDir = './'
executable "sh"
args "-c", "bundle check --path=\${BUNDLE_PATH:-vendor/bundle} > /dev/null || bundle install --jobs=3 --retry=3 --path=\${BUNDLE_PATH:-vendor/bundle}"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method checkBundle.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
task applyCredentials(type:Exec, dependsOn:checkBundle) {
doFirst {
println "Apply credentials for this branch"
}
workingDir = './'
executable "sh"
args "-c", "FASTLANE_SKIP_UPDATE_CHECK=1 FASTLANE_ENV_PRINTER=1 bundle exec fastlane run configure_apply force:true"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method checkBundle.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
tasks.register("installDeps") {
group = 'Onboarding'
description = 'Install dependencies for production builds'
dependsOn applyCredentials
doLast {
println("Done")
}
}