forked from nextcloud/Android-SingleSignOn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
156 lines (134 loc) · 4.33 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
import com.github.spotbugs.SpotBugsTask
buildscript {
ext {
kotlin_version = '1.3.50'
}
repositories {
google()
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.1"
}
}
repositories {
google()
jcenter()
}
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.github.spotbugs"
apply plugin: "io.gitlab.arturbosch.detekt"
group = 'com.github.nextcloud'
spotbugs {
toolVersion = '3.1.12'
}
configurations {
ktlint
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName '1.0'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
// translations are imported from transifex, so no need to check here
disable 'MissingTranslation'
disable 'ExtraTranslation'
disable 'MissingQuantity'
disable 'InconsistentArrays'
disable 'TypographyEllipsis'
disable 'GradleDependency'
disable 'VectorPath'
disable 'IconMissingDensityFolder'
disable 'IconDensities'
abortOnError false
htmlReport true
htmlOutput file("$project.buildDir/reports/lint/lint.html")
}
productFlavors {
}
tasks.register("spotbugsDebug", SpotBugsTask) {
ignoreFailures = false
effort = "max"
reportLevel = "medium"
classes = fileTree("$project.buildDir/intermediates/javac/debug/classes/")
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
pluginClasspath = project.configurations.spotbugsPlugins
source = fileTree('src/main/java')
classpath = files()
include '**/*.java'
exclude '**/gen/**'
reports {
xml.enabled = false
html.enabled = true
html {
destination = file("$project.buildDir/reports/spotbugs/spotbugs.html")
}
}
}
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "--reporter=plain", "--reporter=plain,output=${buildDir}/ktlint.txt,src/**/*.kt"
}
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
detekt {
reports {
xml {
enabled = false
}
}
config = files("detekt.yml")
input = files("src/")
}
dependencies {
implementation "androidx.appcompat:appcompat:1.1.0"
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.core:core:1.1.0'
implementation 'androidx.fragment:fragment:1.1.0'
api 'com.google.code.gson:gson:2.8.5'
implementation 'io.reactivex.rxjava2:rxjava:2.2.12'
implementation 'commons-io:commons-io:2.6'
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
implementation 'com.squareup.okhttp3:okhttp:3.12.5' // 3.13+ requires Lollipop, but our minSdkVersion is 14
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.9.0'
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.6'
ktlint "com.pinterest:ktlint:0.34.2"
// Required for local unit tests (JUnit 4 framework)
testImplementation 'junit:junit:4.12'
// required if you want to use Mockito for unit tests
testImplementation 'org.mockito:mockito-core:3.0.0'
}