Skip to content

Commit

Permalink
Get rootDir
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Oct 12, 2024
1 parent 41d3ab8 commit 6ea86b6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
Expand Down Expand Up @@ -143,7 +144,11 @@ private static void tomlVersionsToProperties(TomlTable tomlTable, Properties pro
private static Properties getVersionProperties() {
TomlParseResult toml = null;
try {
Path path = Path.of(System.getProperty("user.dir"), "gradle/libs.versions.toml");
Path rootDir = Paths.get(System.getProperty("user.dir"));
if (rootDir.endsWith("buildSrc")) {
rootDir = rootDir.getParent();
}
Path path = rootDir.resolve("gradle/libs.versions.toml");
toml = Toml.parse(path);
} catch (IOException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit 6ea86b6

Please sign in to comment.