Skip to content

Commit

Permalink
Update plugins and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tbroyer committed Jul 12, 2024
1 parent 706cc87 commit 7ccacfe
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 24 deletions.
9 changes: 8 additions & 1 deletion build-logic/src/main/kotlin/local/base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ plugins {

spotless {
kotlinGradle {
ktlint(project.the<VersionCatalogsExtension>().named("libs").findVersion("ktlint").orElseThrow().requiredVersion)
ktlint(
project
.the<VersionCatalogsExtension>()
.named("libs")
.findVersion("ktlint")
.orElseThrow()
.requiredVersion,
)
}
}
7 changes: 6 additions & 1 deletion build-logic/src/main/kotlin/local/java-base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ plugins {
spotless {
java {
googleJavaFormat(
project.the<VersionCatalogsExtension>().named("libs").findVersion("googleJavaFormat").orElseThrow().requiredVersion,
project
.the<VersionCatalogsExtension>()
.named("libs")
.findVersion("googleJavaFormat")
.orElseThrow()
.requiredVersion,
)
licenseHeaderFile(rootProject.file("LICENSE.header"))
}
Expand Down
8 changes: 7 additions & 1 deletion build-logic/src/main/kotlin/local/java-library.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ project.findProperty("test.java-toolchain")?.also { testJavaToolchain ->
}

dependencies {
errorprone(project.the<VersionCatalogsExtension>().named("libs").findBundle("errorprone").orElseThrow())
errorprone(
project
.the<VersionCatalogsExtension>()
.named("libs")
.findBundle("errorprone")
.orElseThrow(),
)
}

tasks {
Expand Down
9 changes: 8 additions & 1 deletion build-logic/src/main/kotlin/local/kotlin-base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ plugins {

spotless {
kotlin {
ktlint(project.the<VersionCatalogsExtension>().named("libs").findVersion("ktlint").orElseThrow().requiredVersion)
ktlint(
project
.the<VersionCatalogsExtension>()
.named("libs")
.findVersion("ktlint")
.orElseThrow()
.requiredVersion,
)
licenseHeaderFile(rootProject.file("LICENSE.header"))
}
}
16 changes: 8 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
autoService = "1.1.1"

# Versions used by build-logic
googleJavaFormat = "1.18.1"
ktlint = "1.0.0"
googleJavaFormat = "1.22.0"
ktlint = "1.3.1"

[libraries]
autoService = { module = "com.google.auto.service:auto-service", version.ref = "autoService" }
autoService-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoService" }
compileTesting = "com.google.testing.compile:compile-testing:0.21.0"
junit = "junit:junit:4.13.2"
truth = "com.google.truth:truth:1.1.5"
truth = "com.google.truth:truth:1.4.3"

# Used in below bundle
errorprone-core = "com.google.errorprone:error_prone_core:2.22.0"
nullaway = "com.uber.nullaway:nullaway:0.10.14"
errorprone-core = "com.google.errorprone:error_prone_core:2.28.0"
nullaway = "com.uber.nullaway:nullaway:0.11.0"

[bundles]
# Used by build-logic
errorprone = [ "errorprone-core", "nullaway" ]

[plugins]
errorprone = "net.ltgt.errorprone:3.1.0"
nullaway = "net.ltgt.nullaway:1.6.0"
spotless = "com.diffplug.spotless:6.22.0"
errorprone = "net.ltgt.errorprone:4.0.1"
nullaway = "net.ltgt.nullaway:2.0.0"
spotless = "com.diffplug.spotless:6.25.0"
20 changes: 11 additions & 9 deletions integTest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@ dependencies {

tasks {
test {
inputs.files(
localMavenRepositories.asFileTree.matching {
exclude("**/maven-metadata.*")
},
)
.withPropertyName("testRepositories")
inputs
.files(
localMavenRepositories.asFileTree.matching {
exclude("**/maven-metadata.*")
},
).withPropertyName("testRepositories")
.withPathSensitivity(PathSensitivity.RELATIVE)

val testJavaToolchain = project.findProperty("test.java-toolchain")
testJavaToolchain?.also {
val metadata =
project.javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(testJavaToolchain.toString()))
}.get().metadata
project.javaToolchains
.launcherFor {
languageVersion.set(JavaLanguageVersion.of(testJavaToolchain.toString()))
}.get()
.metadata
systemProperty("test.java-home", metadata.installationPath.asFile.canonicalPath)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,14 @@ class DynamicIncrementalProcessorIntegrationTest {
""".trimIndent(),
)
testProjectDir.newFolder("processor", "src", "main", "resources", "META-INF", "services")
testProjectDir.newFile("processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor")
testProjectDir
.newFile("processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor")
.writeText("test.processor.TestAnnotationProcessor")
}

private fun compileJava() =
GradleRunner.create()
GradleRunner
.create()
.withProjectDir(testProjectDir.root)
.withArguments("--info", "compileJava")
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ class IncrementalAnnotationProcessorProcessorIntegrationTest {
}

private fun compileJava() =
GradleRunner.create()
GradleRunner
.create()
.withProjectDir(testProjectDir.root)
.withArguments("--info", "compileJava")
.build()
Expand Down

0 comments on commit 7ccacfe

Please sign in to comment.