We are currently on a path to automatically fill t...
# compiler
j
We are currently on a path to automatically fill the current file name in our logger tags with a compiler plugin (similar to this). I now had an idea which I want to validate if the concept would even work. Yesterday after getting our compiler plugin to work I watched a

video

which in the end references metro for dependency injection. My idea was to combine the usage of metro with cite to first inject the logger (with
__FILE__
as tag) and cite replaces this afterwards with the file where it was injected.
To use both metro and cite simultaneously in a project works fine, but it seems like cite runs first as I always get the file where I declare the dependency not where I use it. Even if I list cite after metro in the plugins configuration. An explicit ordering of compiler plugins is planned with version 2.3.0, would this solve this use case or do I have a conceptual issue here? cc.: @Zac Sweers @jw Thanks in advance for your input.
j
Compiler plugins are executed in the same order you are adding them
So if you want to run cite after, apply the cite Gradle plugin after.
z
That feature in 2.3.0 will also make it possible to solve this
j
I don't see any way for this to work. Metro would need to be inlining the contents of providers into the actual injection site for you to get the correct file name.
z
Oh I didn’t even read the main goal, I was just answering the ordering bit. Yeah agreed I’m not sure how that could work
j
Alright, thx for the estimations and insights.