From 2f5f32e88b1814062c6aec790365a51def034640 Mon Sep 17 00:00:00 2001 From: Miles Ziemer <45497130+milesziemer@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:31:08 -0400 Subject: [PATCH] chore(codegen): fix codegen release (#5994) Jreleaser has to work in a git repository, and uses the jgit java library to interact with git. When jgit tries to open the git repo, it tries to open `codegen/config` as a file, which blows up. I don't know of any way to configure what jgit is doing here, so I renamed the directory and it solves the issue. Also had to set `gitRootSearch` so jreleaser walks up the parent directories to find the git root. --- codegen/build.gradle.kts | 6 +++++- codegen/{config => gradleConfig}/checkstyle/checkstyle.xml | 0 .../{config => gradleConfig}/checkstyle/suppressions.xml | 0 codegen/{config => gradleConfig}/spotbugs/filter.xml | 0 4 files changed, 5 insertions(+), 1 deletion(-) rename codegen/{config => gradleConfig}/checkstyle/checkstyle.xml (100%) rename codegen/{config => gradleConfig}/checkstyle/suppressions.xml (100%) rename codegen/{config => gradleConfig}/spotbugs/filter.xml (100%) diff --git a/codegen/build.gradle.kts b/codegen/build.gradle.kts index 7bc695f061bf..2649f48ef780 100644 --- a/codegen/build.gradle.kts +++ b/codegen/build.gradle.kts @@ -183,6 +183,9 @@ subprojects { * ==================================================== */ apply(plugin = "checkstyle") + checkstyle { + configFile = File("${project.rootDir}/gradleConfig/checkstyle/checkstyle.xml") + } tasks["checkstyleTest"].enabled = false @@ -237,7 +240,7 @@ subprojects { // Configure the bug filter for spotbugs. spotbugs { setEffort("max") - val excludeFile = File("${project.rootDir}/config/spotbugs/filter.xml") + val excludeFile = File("${project.rootDir}/gradleConfig/spotbugs/filter.xml") if (excludeFile.exists()) { excludeFilter.set(excludeFile) } @@ -250,6 +253,7 @@ subprojects { */ jreleaser { dryrun = false + gitRootSearch = true // Used for creating a tagged release, uploading files and generating changelog. // In the future we can set this up to push release tags to GitHub, but for now it's diff --git a/codegen/config/checkstyle/checkstyle.xml b/codegen/gradleConfig/checkstyle/checkstyle.xml similarity index 100% rename from codegen/config/checkstyle/checkstyle.xml rename to codegen/gradleConfig/checkstyle/checkstyle.xml diff --git a/codegen/config/checkstyle/suppressions.xml b/codegen/gradleConfig/checkstyle/suppressions.xml similarity index 100% rename from codegen/config/checkstyle/suppressions.xml rename to codegen/gradleConfig/checkstyle/suppressions.xml diff --git a/codegen/config/spotbugs/filter.xml b/codegen/gradleConfig/spotbugs/filter.xml similarity index 100% rename from codegen/config/spotbugs/filter.xml rename to codegen/gradleConfig/spotbugs/filter.xml