How can i get access to the project base directory...
# ksp
c
How can i get access to the project base directory in the context of the
process
function? Not saying it's the right thing to do, but our existing code writes to other directories in a multi-module project.
i could do something like
(resolver as ResolverImpl).options.projectBaseDir
or I guess i can pass it in
j
that’s quite hacky to do as you are relying on implementation detail here.
c
yea this doesn't feel great either, but I don't want to rewrite the entire logic of this processor,
Copy code
ksp {
    arg("rootProjectDir", rootProject.projectDir.absolutePath)
}
j
your gradle snippet looks right to me, does this requires a lot of rewrite on your side?
c
nope, works like a charm
i mean, if we were to do it the "right" way yes, it would probably be some effort
j
👍
This approach of passing gradle specific attributes into KSP processor look the right way to me. Exposing it at api level can be tricky as KSP also supports cmd line mode.
🙏 1
c
ok thank you