Slackbot
04/27/2023, 8:56 AMVampire
04/27/2023, 9:03 AMVampire
04/27/2023, 9:04 AMVampire
04/27/2023, 9:06 AMsettings.gradle
or settings.gradle.kts
as with 7.0 they are mandatory. But even then you just verify that you are in the settings directory, not necessarily the root project directory.
But 100% certainty you probably just get by querying the project using the tooling api.Javi
04/27/2023, 9:08 AMIgor Wojda
04/27/2023, 9:08 AMVampire
04/27/2023, 9:08 AMrootDir
😄Javi
04/27/2023, 9:08 AMIgor Wojda
04/27/2023, 9:37 AMFile("").absoluteFile.path
to get the "current" directory path. This provides path to a source set eg. .../project/module/src/test
(thus the traversing up approach)
After @Javi "CLI question" I am thinking that It may be better to traverse up and try to run Grade command and parse rootDir
from command output 🤔 (which command would you recommend?)
BTW1 I need to explore similar approach for Maven, but this is another story
BTW2 I will provide option to manually set root dir, but it would be super convenient for devs to have a method that can simply get all of the kotlin files from the current project (Gradle project root dir)Vampire
04/27/2023, 9:39 AM