-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
55 lines (45 loc) · 1.76 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
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.report.ReportMergeTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.7.0' apply false
id 'com.android.library' version '8.7.0' apply false
id 'org.jetbrains.kotlin.android' version '2.0.21' apply false
id 'org.jetbrains.kotlin.jvm' version '2.0.21' apply false
id("io.gitlab.arturbosch.detekt") version "1.23.7"
}
Properties sonaTypeProps = new Properties()
File sonatypePropertiesFile = project.rootProject.file("sonatype.properties")
if (sonatypePropertiesFile.exists()) {
sonaTypeProps.load(sonatypePropertiesFile.newDataInputStream())
}
ext {
groupId = 'dev.keiji.tlv'
versionCode = '0.3.3'
// versionCode = '0.3.3-SNAPSHOT'
sonatypeUsername = sonaTypeProps.get('sonatypeUsername') ?: ""
sonatypePassword = sonaTypeProps.get('sonatypePassword') ?: ""
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
repoUrl = versionCode.endsWith('-SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
tasks.register('reportMerge', ReportMergeTask) {
output = layout.buildDirectory.file("reports/detekt/detekt.xml")
}
subprojects {
apply plugin: 'io.gitlab.arturbosch.detekt'
detekt {
buildUponDefaultConfig = true
allRules = true
config.setFrom("$rootDir/config/detekt/detekt.yml")
parallel = true
}
afterEvaluate { project ->
project.tasks.withType(Detekt) {
finalizedBy reportMerge
}
}
}
tasks.register('clean', Delete) {
delete rootProject.buildDir
}