Browse Source

Build: Setup errorprone

pull/270/head
weisj 3 years ago
parent
commit
94929e5cda
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 21
      build.gradle.kts
  2. 1
      gradle.properties
  3. 7
      gradle/libs.versions.toml
  4. 3
      settings.gradle.kts

21
build.gradle.kts

@ -7,6 +7,7 @@ import com.github.vlsi.gradle.properties.dsl.stringProperty
import com.github.vlsi.gradle.properties.dsl.toBool
import com.github.vlsi.gradle.publishing.dsl.simplifyXml
import com.github.vlsi.gradle.publishing.dsl.versionFromResolution
import net.ltgt.gradle.errorprone.errorprone
plugins {
idea
@ -15,11 +16,13 @@ plugins {
id("com.github.vlsi.gradle-extensions")
id("com.github.vlsi.stage-vote-release")
id("org.ajoberstar.grgit")
id("net.ltgt.errorprone") apply false
}
val skipJavadoc by props()
val enableMavenLocal by props(false)
val enableGradleMetadata by props()
val enableErrorProne by props()
val skipAutostyle by props(false)
val isRelease = project.stringProperty("release").toBool()
val snapshotName by props("")
@ -212,6 +215,24 @@ allprojects {
}
}
if (enableErrorProne) {
apply(plugin = "net.ltgt.errorprone")
dependencies {
"errorprone"(libs.tools.errorprone.core)
"annotationProcessor"(libs.tools.errorprone.guava)
}
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(listOf("-Xmaxerrs", "10000", "-Xmaxwarns", "10000"))
options.errorprone {
errorproneArgs.add("-XepExcludedPaths:.*/javacc/.*")
disableWarningsInGeneratedCode.set(true)
disable(
"StringSplitter"
)
}
}
}
tasks {
withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"

1
gradle.properties

@ -16,3 +16,4 @@ com.github.autostyle.version = 3.1
nokee.version = 0.4.264-202107071245.986a5b8a
org.ajoberstar.grgit.version = 4.1.0
ktlint.version = 0.40.0
net.ltgt.errorprone.version = 2.0.2

7
gradle/libs.versions.toml

@ -12,6 +12,8 @@ swingDsl = "0.1.3"
nullabilityAnnotations = "16.0.2"
macOSFramework = "latest.release"
javaNativeFoundation = "1.1.1"
errorprone = "2.8.1"
guava = "1.0"
[libraries]
jxlayer = { module = "org.swinglabs:jxlayer", version.ref = "jxlayer" }
@ -40,5 +42,10 @@ test-rsyntaxtextarea = { module = "com.fifesoft:rsyntaxtextarea", version.ref =
test-swingDslInspector = { module = "com.github.weisj:swing-extensions-inspector", version = "latest.integration" }
test-jna = { module = "net.java.dev.jna:jna", version.ref = "jna" }
# Tools
tools-errorprone-core = { module = "com.google.errorprone:error_prone_core", version.ref = "errorprone" }
tools-errorprone-annotations = { module = "com.google.errorprone:error_prone_annotations", version.ref = "errorprone" }
tools-errorprone-guava = { module = "com.google.guava:guava-beta-checker", version.ref = "guava" }
[bundles]
test-miglayout = ["test-miglayout-core", "test-miglayout-swing"]

3
settings.gradle.kts

@ -10,7 +10,8 @@ pluginManagement {
idv("com.github.vlsi.gradle-extensions", "com.github.vlsi.vlsi-release-plugins")
idv("com.github.vlsi.license-gather", "com.github.vlsi.vlsi-release-plugins")
idv("com.github.vlsi.stage-vote-release", "com.github.vlsi.vlsi-release-plugins")
idv("org.ajoberstar.grgit", "org.ajoberstar.grgit")
idv("org.ajoberstar.grgit")
idv("net.ltgt.errorprone")
}
}
rootProject.name = "darklaf"

Loading…
Cancel
Save