-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathbuild.gradle
More file actions
131 lines (113 loc) · 3.6 KB
/
Copy pathbuild.gradle
File metadata and controls
131 lines (113 loc) · 3.6 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
buildscript {
repositories {
mavenCentral()
google()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20'
}
}
plugins {
id 'com.diffplug.spotless' version '6.25.0'
id 'com.benjaminsproule.license' version '0.16.2'
id 'net.ltgt.errorprone' version '3.1.0'
id 'com.android.library' version '8.2.0' apply false
id 'com.gradleup.nmcp' version '1.6.1' apply false
id 'com.gradleup.nmcp.aggregation' version '1.6.1'
id 'maven-publish'
}
repositories {
mavenCentral()
}
static def isAndroidProject(Project p) {
return p.plugins.findPlugin('com.android.library')
}
ext {
minSdkVersion = 14
compileSdkVersion = 33
targetSdkVersion = compileSdkVersion
versions = [
'autoValue' : '1.7',
'assertjcore' : '3.15.0',
'awaitility' : '4.0.2',
'guava' : '28.2-android',
'junit' : '4.13.2',
'logback' : '1.2.3',
'rxJava' : '1.3.8',
'rxJava2' : '2.2.17',
'rxJava3' : '3.0.0',
'slf4j' : '1.7.25',
'jsr305' : '3.0.2',
'hamcrestLibrary' : '2.2',
'mockito' : '3.10.0',
'androidxLifecycle' : '2.2.0',
'androidXCoreTesting' : '2.1.0',
'errorProne' : '2.23.0',
'kotlinxCoroutines' : '1.7.3',
]
}
spotless {
java {
target 'mobius-*/src/**/*.java'
targetExclude '**/package-info.java'
googleJavaFormat('1.17.0')
}
}
subprojects {
ext.VERSION_NAME = properties.version
apply plugin: 'net.ltgt.errorprone'
repositories {
mavenCentral()
}
dependencies {
errorprone("com.google.errorprone:error_prone_core:${versions.errorProne}")
}
group = GROUP
version = VERSION_NAME
afterEvaluate { proj ->
if (isAndroidProject(proj)) {
android.libraryVariants.all { variant ->
variant.getJavaCompileProvider().configure {
dependsOn rootProject.tasks.spotlessCheck
}
}
} else if (proj.plugins.findPlugin('java-library')) {
proj.apply from: rootProject.file('gradle/binary_compatibility.gradle')
rootProject.tasks.spotlessCheck.dependsOn(proj.tasks.compileTestJava)
}
proj.tasks.check.dependsOn(rootProject.tasks.spotlessCheck)
tasks.withType(JavaCompile).configureEach {
options.errorprone.disableWarningsInGeneratedCode = true
options.errorprone.disable("AutoValueImmutableFields")
options.errorprone.disable("AutoValueSubclassLeaked")
options.errorprone.disable("InlineMeSuggester")
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Werror"
}
}
}
allprojects {
apply plugin: 'com.benjaminsproule.license'
license {
header rootProject.file('apache2.header')
exclude("**/AutoValue_*.java")
mapping("java", "SLASHSTAR_STYLE")
}
getTasksByName('check', false).each { checkTask -> checkTask.dependsOn(tasks.withType(Javadoc)) }
}
nmcpAggregation {
centralPortal {
username = findProperty("SONATYPE_NEXUS_USERNAME") ?: ""
password = findProperty("SONATYPE_NEXUS_PASSWORD") ?: ""
publishingType = "USER_MANAGED"
}
}
dependencies {
subprojects.each { sub ->
nmcpAggregation project(sub.path)
}
}