-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathbuild.gradle
More file actions
138 lines (124 loc) · 4.62 KB
/
build.gradle
File metadata and controls
138 lines (124 loc) · 4.62 KB
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
/*
* Copyright (c) 2023 Sergey Komlach aka Salat-Cx65; Original project: https://github.com/Salat-Cx65/AdvancedBiometricPromptCompat
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.minSDK = 23
ext.compileSDK = 36
ext.targetSDK = 35
ext.javaVersion = JavaVersion.VERSION_17
ext.libsMajorVersion = '2.4'
ext.libsMinorVersion = "rc-23"
ext.libsVersionCode = 263
ext.libsGroupId = "dev.skomlach"
ext.libArtifactId_biometric = 'biometric'
ext.libArtifactId_common = 'common'
ext.libArtifactId_biometric_api = 'biometric-api'
ext.libArtifactId_biometric_ktx = 'biometric-ktx'
ext.libArtifactId_biometric_custom_face_tf = 'biometric-custom-face-tf'
ext.libVersion = libsMajorVersion + "." + libsMinorVersion
ext.libDesc = 'This is an Android project allowing you to use the advanced biometric authorization features.'
ext.libLicenses = ['Apache-2.0']
ext.libVCSUrl = 'https://github.com/Salat-Cx65/AdvancedBiometricPromptCompat.git'
repositories {
maven { url 'https://jitpack.io' }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
}
dependencies {
classpath libs.gradle
//Dev Tools
classpath libs.gradle.errorprone.plugin
classpath libs.gradle.nexus.staging.plugin
classpath libs.kotlin.gradle.plugin
classpath libs.firebase.crashlytics.gradle
classpath libs.google.services
classpath libs.gradle.download.task
classpath libs.detekt.gradle.plugin
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
maven { url "https://plugins.gradle.org/m2/" }
google()
}
apply plugin: "io.gitlab.arturbosch.detekt"
dependencies {
detektPlugins libs.detekt.rules.libraries
}
def qualityProperties = new Properties()
def propsFile = rootProject.file("detekt.properties")
if (propsFile.exists()) {
propsFile.withReader("UTF-8") { qualityProperties.load(it) }
}
def runOncePerWeek = qualityProperties.getProperty("runOncePerWeek")?.toBoolean() ?: false
// Detekt
detekt {
autoCorrect = true
buildUponDefaultConfig = true
allRules = false
ignoreFailures = true
source = files("src/main/java", "src/main/kotlin")
reports {
html.required = true
html.outputLocation = file("$rootDir/reports/detekt/main.html")
}
}
tasks.register("codeQualityCheck") {
group = "verification"
description = "Running code quality checks"
dependsOn(tasks.matching { it.name == "detekt" })
}
tasks.register("codeQualityCheckOncePerWeek") {
group = "verification"
def timestampFile = file("$rootDir/detekt.timestamp")
doLast {
def now = System.currentTimeMillis()
def lastRun = timestampFile.exists() ? timestampFile.text.toLong() : 0
if (now - lastRun > 7 * 24 * 60 * 60 * 1000) {
println "Running weekly check..."
timestampFile.text = now.toString()
}
}
}
afterEvaluate {
def android = extensions.findByName("android")
if (android != null) {
def variants = android.hasProperty("applicationVariants") ?
android.applicationVariants : android.libraryVariants
variants.configureEach { variant ->
if (variant.buildType.name == "debug") {
variant.assembleProvider.configure {
if (runOncePerWeek) finalizedBy("codeQualityCheckOncePerWeek")
else finalizedBy("codeQualityCheck")
}
}
}
}
}
}
subprojects { project ->
group = libsGroupId
version = libVersion
}
tasks.register('clean', Delete) {
delete rootProject.buildDir
}
apply plugin: 'io.codearte.nexus-staging'