how do i obtain the project root as `fun hello(): ...
# kotlin-native
s
how do i obtain the project root as
fun hello(): String = "Hello, Kotlin/Native! $projectRoot"
gives me
e: /home/macropreprocessor/IdeaProjects/kpp/src/Directory Packer/src/linuxMain/kotlin/sample/SampleLinux.kt: (3, 47): Unresolved reference: projectRoot
g
What is projectRoot? Looks that you use it in your source code, not in build.gradle
s
projectRoot
would be
/home/macropreprocessor/IdeaProjects/kpp
as i doubt that relying on the existance of
IdeaProjects
or
AndroidStudioProjects
folder is 100% reliable
g
There is no such thing as projectRoot outside of Gradle, you can pass this path as system variable tho
s
how