Grégory Lureau
04/14/2022, 8:32 PMTing-Yuan Huang
04/14/2022, 9:57 PMksp{}
extension in build scripts?Grégory Lureau
04/14/2022, 10:25 PMoriginFile
path for now to deduce the module name, quite limited indeed. I suppose I could add a gradle plugin to pass automatically the value from gradle to ksp 🤔 I was hoping something from KSP environment, not sure if it makes sense.Anton Popov
06/07/2022, 12:40 PMResolverImpl
contains this info, but it is not exposed through the Resolver
API. Maybe it is possible to enhance the API by adding moduleName
property to Resolver
? @Jiaxiang @Ting-Yuan Huangfun moduleName(resolver: Resolver): String {
val moduleDescriptor = resolver::class.java
.getDeclaredField("module")
.apply { isAccessible = true }
.get(resolver)
val rawName = moduleDescriptor::class.java
.getMethod("getName")
.invoke(moduleDescriptor)
.toString()
return rawName
.removeSurrounding("<", ">")
.removeSuffix("_debug")
.removeSuffix("_release")
}
Jiaxiang
06/07/2022, 5:12 PMmoduleName
thing was considered long ago, and I can’t think of any objections to this, but as we are approaching to our next release, this probably won’t be shipped until next next release.Anton Popov
06/07/2022, 5:16 PMJiaxiang
06/07/2022, 5:17 PMAnton Popov
06/07/2022, 5:27 PM