-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
93 lines (83 loc) · 3.11 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
import net.ltgt.gradle.errorprone.CheckSeverity
import org.jetbrains.dokka.gradle.DokkaTaskPartial
buildscript {
apply from: rootProject.file('gradle/dependencies.gradle')
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "com.android.tools.build:gradle:${deps.build.gradlePlugins.android}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${deps.build.gradlePlugins.kotlin}"
classpath "net.ltgt.gradle:gradle-errorprone-plugin:${deps.build.gradlePlugins.errorProne}"
classpath "net.ltgt.gradle:gradle-nullaway-plugin:${deps.build.gradlePlugins.nullAway}"
classpath "com.diffplug.spotless:spotless-plugin-gradle:${deps.build.gradlePlugins.spotless}"
classpath "com.google.protobuf:protobuf-gradle-plugin:${deps.build.gradlePlugins.protobuf}"
classpath "com.vanniktech:gradle-maven-publish-plugin:${deps.build.gradlePlugins.mavenPublish}"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${deps.build.gradlePlugins.dokka}"
}
}
apply plugin: 'org.jetbrains.dokka'
tasks.dokkaHtmlMultiModule {
outputDirectory.set(new File(rootDir,"docs/0.x"))
includes.from(project.layout.projectDirectory.file("README.md"))
}
subprojects {
var isSample = project.name == "sample"
repositories {
google()
mavenCentral()
}
apply from: rootProject.file('gradle/dependencies.gradle')
apply plugin: 'com.diffplug.gradle.spotless'
spotless {
format 'misc', {
target '**/*.md', '**/.gitignore'
indentWithTabs()
trimTrailingWhitespace()
endWithNewline()
}
java {
target "**/*.java"
googleJavaFormat(deps.versions.gjf)
licenseHeaderFile rootProject.file('spotless/copyright.java')
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
groovyGradle {
target '**/*.gradle'
trimTrailingWhitespace()
endWithNewline()
}
}
apply plugin: 'net.ltgt.errorprone'
apply plugin: 'net.ltgt.nullaway'
dependencies {
errorproneJavac deps.build.errorProneJavac
errorprone deps.build.nullAway
errorprone deps.build.errorProne
}
tasks.withType(JavaCompile).configureEach {
options.errorprone.nullaway {
severity = CheckSeverity.ERROR
annotatedPackages.add("com.uber")
unannotatedSubPackages.add("com.uber.simplestore.proto")
treatGeneratedAsUnannotated = true
}
options.errorprone.disableWarningsInGeneratedCode = true
}
if (!isSample) {
apply plugin: 'org.jetbrains.dokka'
tasks.withType(DokkaTaskPartial).configureEach {
outputDirectory.set(new File(buildDir, "docs/partial"))
moduleName.set(project.property("POM_ARTIFACT_ID").toString())
moduleVersion.set(project.property("VERSION_NAME").toString())
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply from: 'gradle/dependencies.gradle'