158 строки
4.1 KiB
Groovy
158 строки
4.1 KiB
Groovy
/*
|
|
* Nextcloud Android Single-Sign-On Library
|
|
*
|
|
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
|
|
import com.github.spotbugs.snom.Confidence
|
|
import com.github.spotbugs.snom.Effort
|
|
import com.github.spotbugs.snom.SpotBugsTask
|
|
|
|
repositories {
|
|
google()
|
|
maven { url "https://jitpack.io" }
|
|
mavenCentral()
|
|
maven { url 'https://plugins.gradle.org/m2/' }
|
|
}
|
|
|
|
apply plugin: 'com.android.library'
|
|
apply plugin: "com.github.spotbugs"
|
|
apply plugin: "io.gitlab.arturbosch.detekt"
|
|
apply plugin: 'maven-publish' // needed for JitPack.io
|
|
|
|
group = 'com.github.nextcloud'
|
|
|
|
spotbugs {
|
|
ignoreFailures = true // should continue checking
|
|
effort = Effort.MAX
|
|
reportLevel = Confidence.valueOf('MEDIUM')
|
|
}
|
|
|
|
configurations {
|
|
ktlint
|
|
}
|
|
|
|
android {
|
|
namespace 'com.nextcloud.android.sso'
|
|
compileSdk 35
|
|
|
|
defaultConfig {
|
|
minSdk 21
|
|
targetSdk 35
|
|
consumerProguardFiles 'consumer-proguard-rules.pro'
|
|
}
|
|
|
|
buildFeatures {
|
|
aidl true
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
coreLibraryDesugaringEnabled true
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
publishing {
|
|
singleVariant('release') {
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
}
|
|
|
|
productFlavors {}
|
|
|
|
lint {
|
|
abortOnError false
|
|
disable 'MissingTranslation', 'ExtraTranslation', 'MissingQuantity', 'InconsistentArrays', 'TypographyEllipsis', 'GradleDependency', 'VectorPath', 'IconMissingDensityFolder', 'IconDensities'
|
|
htmlOutput file("$project.layout.buildDirectory/reports/lint/lint.html")
|
|
htmlReport true
|
|
}
|
|
}
|
|
|
|
tasks.withType(SpotBugsTask).configureEach { task ->
|
|
String variantNameCap = task.name.replace("spotbugs", "")
|
|
|
|
dependsOn "compile${variantNameCap}Sources"
|
|
|
|
excludeFilter.set(file("${project.rootDir}/spotbugs-filter.xml"))
|
|
classes = fileTree("$project.layout.buildDirectory/intermediates/javac/debug/classes/")
|
|
reports {
|
|
xml {
|
|
required = true
|
|
}
|
|
html {
|
|
required = true
|
|
outputLocation = file("$project.layout.buildDirectory/reports/spotbugs/spotbugs.html")
|
|
stylesheet = 'fancy.xsl'
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.register('ktlint', JavaExec) {
|
|
description = "Check Kotlin code style."
|
|
main = "com.pinterest.ktlint.Main"
|
|
classpath = configurations.ktlint
|
|
args "--reporter=plain", "--reporter=plain,output=${project.layout.buildDirectory}/ktlint.txt,src/**/*.kt"
|
|
}
|
|
|
|
detekt {
|
|
reports {
|
|
xml {
|
|
enabled = false
|
|
}
|
|
}
|
|
config = files("detekt.yml")
|
|
input = files("src/")
|
|
}
|
|
|
|
dependencies {
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.3'
|
|
|
|
implementation "androidx.appcompat:appcompat:1.7.0"
|
|
implementation 'androidx.annotation:annotation:1.9.1'
|
|
implementation 'androidx.core:core:1.15.0'
|
|
implementation 'androidx.fragment:fragment:1.8.5'
|
|
|
|
implementation 'com.google.android.material:material:1.12.0'
|
|
|
|
api 'com.google.code.gson:gson:2.11.0'
|
|
|
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
|
|
implementation 'io.reactivex.rxjava3:rxjava:3.1.9'
|
|
|
|
implementation 'commons-io:commons-io:2.18.0'
|
|
|
|
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
|
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
|
|
|
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.13.0'
|
|
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.6.8'
|
|
|
|
ktlint "com.pinterest:ktlint:0.51.0-FINAL"
|
|
|
|
testImplementation 'junit:junit:4.13.2'
|
|
testImplementation 'org.mockito:mockito-core:5.14.2'
|
|
}
|
|
|
|
afterEvaluate {
|
|
publishing {
|
|
publications {
|
|
release(MavenPublication) {
|
|
from components.release
|
|
|
|
groupId = 'com.nextcloud.android.sso'
|
|
artifactId = 'master'
|
|
}
|
|
}
|
|
}
|
|
}
|