Skip to content

Commit

Permalink
Use the foojay convention plugin
Browse files Browse the repository at this point in the history
This is the newer plugin and doesn't require direct interaction with the
toolchain anymore
  • Loading branch information
whodevil committed Jun 2, 2024
1 parent b12da80 commit e02d174
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ errorprone-core = { module = "com.google.errorprone:error_prone_core", version =
errorprone-plugin = { module = "net.ltgt.gradle:gradle-errorprone-plugin", version = "3.1.0" }
fasterxml-jackson-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "fasterxml-jackson" }
fasterxml-jackson-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "fasterxml-jackson" }
foojay-resolver = { module = "org.gradle.toolchains:foojay-resolver", version = "0.7.0" }
foojay-resolver = { module = "org.gradle.toolchains:foojay-resolver", version = "0.8.0" }
google-guice = { module = "com.google.inject:guice", version.ref = "guice" }
graphql = { module = "com.graphql-java:graphql-java", version.ref = "graphql" }
groovy-lang = { module = "org.codehaus.groovy:groovy", version.ref = "groovy" }
Expand Down
15 changes: 2 additions & 13 deletions plugins/src/main/kotlin/info/offthecob/gradle/SettingsPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package info.offthecob.gradle
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.initialization.Settings
import org.gradle.kotlin.dsl.jvm
import org.gradle.toolchains.foojay.FoojayToolchainResolver
import org.gradle.toolchains.foojay.FoojayToolchainsPlugin
import org.gradle.toolchains.foojay.FoojayToolchainsConventionPlugin
import org.slf4j.LoggerFactory
import java.io.File

Expand Down Expand Up @@ -62,15 +60,6 @@ class SettingsPlugin : Plugin<Any> {
private fun subDirectoriesNotNamedBuildSrc(): (File) -> Boolean = { it.isDirectory and !it.name.contains(BUILD_SRC) }

private fun toolChainSupport(settings: Settings) {
settings.plugins.apply(FoojayToolchainsPlugin::class.java)
settings.toolchainManagement.apply {
jvm {
javaRepositories {
repository("foojay") {
resolverClass.set(FoojayToolchainResolver::class.java)
}
}
}
}
settings.plugins.apply(FoojayToolchainsConventionPlugin::class.java)
}
}

0 comments on commit e02d174

Please sign in to comment.