java_library.srcs supports .srcjar files to facilitate including generated sources. .properties files included in java_library.srcs are filtered and included in java_library.resources. Consider extending the current behaviour so that .properties files included in .srcjar files are also included in java_library.resources. This will facilitate the usage of generated resources.
For example, I have a genrule that generates .java and .properties files and I don't necessarily know all of them during the analysis phase for declaration purposes. For this reason, my rule instead generates a .srcjar file. However, the .properties files inside that .srcjar file are being skipped.
There are other alternative ways of going about it:
-
There's already an internal resource_jars field that could perhaps be reused for this effect (at the moment it seems to always be forced as empty)? However, straight including .srcjar files in this field won't achieve the desired outcome as this can result in .java files appearing inside the final .jar file. Maybe somehow expose this field to users?
-
Support something like .resourcejar files in java_library.resources. This would be a breaking change 😔.
java_library.srcssupports.srcjarfiles to facilitate including generated sources..propertiesfiles included injava_library.srcsare filtered and included injava_library.resources. Consider extending the current behaviour so that.propertiesfiles included in.srcjarfiles are also included injava_library.resources. This will facilitate the usage of generated resources.For example, I have a
genrulethat generates.javaand.propertiesfiles and I don't necessarily know all of them during the analysis phase for declaration purposes. For this reason, my rule instead generates a.srcjarfile. However, the.propertiesfiles inside that.srcjarfile are being skipped.There are other alternative ways of going about it:
There's already an internal
resource_jarsfield that could perhaps be reused for this effect (at the moment it seems to always be forced as empty)? However, straight including.srcjarfiles in this field won't achieve the desired outcome as this can result in.javafiles appearing inside the final.jarfile. Maybe somehow expose this field to users?Support something like
.resourcejarfiles injava_library.resources. This would be a breaking change 😔.