forked from TeamAmaze/AmazeFileManager
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
150 lines (136 loc) · 4.5 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.10'
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.hiya:jacoco-android:0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "com.diffplug.gradle.spotless" version "4.3.0"
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://jcenter.bintray.com" }
mavenCentral()
}
tasks.withType(Test) {
maxParallelForks = 4
maxHeapSize = "4g"
forkEvery = 4
}
}
spotless {
java {
licenseHeaderFile 'spotless.license-java'
target 'app/src/**/*.java'
googleJavaFormat('1.7')
removeUnusedImports() // removes any unused imports
importOrder 'java', 'javax', 'org', 'com', 'android', 'androidx', ''
}
kotlin {
licenseHeaderFile 'spotless.license-java'
target 'app/src/**/*.kt'
ktlint("0.39.0").userData(['disabled_rules': 'no-wildcard-imports',
'kotlin_imports_layout': 'idea', 'indent_size': '4',
'max_line_length': '100'])
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}
configurations {
robo16
robo17
robo18
robo19
robo21
robo22
robo23
robo24
robo25
robo26
robo27
robo28
robo29
}
dependencies {
robo16 "org.robolectric:android-all:4.1.2_r1-robolectric-r1"
robo17 "org.robolectric:android-all:4.2.2_r1.2-robolectric-r1"
robo18 "org.robolectric:android-all:4.3_r2-robolectric-r1"
robo19 "org.robolectric:android-all:4.4_r1-robolectric-r2"
robo21 "org.robolectric:android-all:5.0.2_r3-robolectric-r0"
robo22 "org.robolectric:android-all:5.1.1_r9-robolectric-r2"
robo23 "org.robolectric:android-all:6.0.1_r3-robolectric-r1"
robo24 "org.robolectric:android-all:7.0.0_r1-robolectric-r1"
robo25 "org.robolectric:android-all:7.1.0_r7-robolectric-r1"
robo26 "org.robolectric:android-all:8.0.0_r4-robolectric-r1"
robo27 "org.robolectric:android-all:8.1.0-robolectric-4611349"
robo28 "org.robolectric:android-all:9-robolectric-4913185-2"
robo29 "org.robolectric:android-all:10-robolectric-5803371"
}
def robolectricDependencies = "${rootProject.buildDir.path}/robolectric"
task fetchRobolectricDependencies(type: Copy) {
from configurations.robo16
from configurations.robo17
from configurations.robo18
from configurations.robo19
from configurations.robo21
from configurations.robo22
from configurations.robo23
from configurations.robo24
from configurations.robo25
from configurations.robo26
from configurations.robo27
from configurations.robo28
from configurations.robo29
into robolectricDependencies
}
subprojects {
afterEvaluate {
if (project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) {
android {
testOptions.unitTests.all {
systemProperty 'robolectric.offline', 'true'
systemProperty 'robolectric.dependency.dir', robolectricDependencies
}
}
tasks.withType(Test) {
it.dependsOn fetchRobolectricDependencies
}
}
if (project.plugins.hasPlugin("jacoco-android")){
android {
testOptions.unitTests.all {
jacoco {
excludes = ['jdk.internal.*']
}
}
}
}
dependencies {
compileOnly 'com.github.pengrad:jdk9-deps:1.0'
if (project.hasProperty('kapt')) {
kapt 'javax.xml.bind:jaxb-api:2.3.1'
kapt 'com.sun.xml.bind:jaxb-core:2.3.0.1'
kapt 'com.sun.xml.bind:jaxb-impl:2.3.2'
}
annotationProcessor 'javax.xml.bind:jaxb-api:2.3.1'
annotationProcessor 'com.sun.xml.bind:jaxb-core:2.3.0.1'
annotationProcessor 'com.sun.xml.bind:jaxb-impl:2.3.2'
}
}
}