Slackbot
04/26/2023, 9:45 AMVampire
04/26/2023, 10:58 PMif build caching is enabled?Even if you enable task output caching and the producer task in question is cacheable, this cannot be a problem. Why, you may ask. Well, the outputs of a task are packed into an archive that is stored into the cache, so it cannot be used from there directly. 🙂 That is also the reason why for example task types like
Zip or Jar or Copy are not cacheable, because it is usually faster to just create the archive or copy the files, than to get the archive from the cache - maybe even remote cache - and unpack it.
is it ok to just add something likeAs the files are not generated by
other-project but just there, and you have strict pathing requirements, I guess it is ok to do it like that, but don't nail me on it. 😄
Btw. the jacoco-report-aggregation plugin registers an outgoing variant that contains the source files. (including generated ones I think if applicable)Kristóf Marussy
04/27/2023, 12:20 PMthe outputs of a task are packed into an archive that is stored into the cache, so it cannot be used from there directlyah, I see, so this is different from the maven dependencies cache, where jars can be placed on the classpath directly from the cache (because the jvm can read jars directly)
thethis is fascinating! 😄 if I read https://github.com/gradle/gradle/blob/b45fc72c2aa0c668d6025fe089cb4affac656100/subprojects/plugins/src/main/java/org/gradle/jvm/component/internal/DefaultJvmSoftwareComponent.java#L136 correctly, every jvm component has an outgoing variant for its main source files for report aggregation purposesplugin registers an outgoing variant that contains the source filesjacoco-report-aggregation
Vampire
04/27/2023, 12:38 PMah, I see, so this is different from the maven dependencies cache, where jars can be placed on the classpath directly from the cache (because the jvm can read jars directly)Yes
every jvm component has an outgoing variant for its main source files for report aggregation purposesOh, right, I thought that plugin adds this variant, but indeed it just uses it, so yes you can just use that as you can see in
outgoingVariants task output