When should I use the Classpath annotation? I have...
# community-support
p
When should I use the Classpath annotation? I have a cacheable task that uses the worker api with class path isolation so I use an input property (ConfigurableFileCollection) with classpath annotation to allow customizing the classpath, But when I pass a local project/module as classpath, it is only out-of-date when I have public binary changes. And this sounds like a bug...
a
that does sound like a bug... but maybe you have build cache enabled and it's loading something from cache?
e.g. 1. the local module has some function 2. you run the task, and it successfully stores the cache 3. you change module function 4. re-run the task, and it succeeds 5. revert the module function to the original 6. re-run the task, and it's now up-to-date maybe?
p
Yeah, I use a local builder cache and it’s gone when I delete the build cache, but do I need to mark the classpath as input files too? According to the docs, I only need it with Gradle 3 compability.
Well, 4 is FROM-CACHE
And 6 too
a
just
@Classpath
should work
iirc
@Classpath
is like
@InputFiles
, but additionally ignores paths, timestamps, and somehow ignores changes to comments (unless the comments change the line numbers of code, because that affects the debug info)
p
Hm, okay, strange. I tried to reproduce it again and now it does work as expected 🫠 but it did fail multiple times in the past until I deleted the cache 🫠
But thanks anyway to confirm that it should work as expected.
a
np!