Apollo-android: Use of absolute string path breaks generateSources task remote cacheability

Created on 20 May 2020  路  1Comment  路  Source: apollographql/apollo-android

Summary

Input property rootFolders is referenced as an absolute path string .

If you use a gradle remote cache absolute paths may differ based on the machine used for the build.

Description
I believe we could change this to a ConfigurableFileCollection similar to graphqlFiles fix the issue

Version
1.4.5, but pretty sure this is still on master.

gradle-plugin Bug

Most helpful comment

Good catch, thank! The reason rootFolders is a ListProperty<String> and not a List<DirectoryProperty> is that, in theory at least, the src/main/graphql folder can contain something else that .graphql files and we want the task to stay UP-TO-DATE even if an unrelated file changes.
This PR changes the paths so they are relative and the task can be relocable

>All comments

Good catch, thank! The reason rootFolders is a ListProperty<String> and not a List<DirectoryProperty> is that, in theory at least, the src/main/graphql folder can contain something else that .graphql files and we want the task to stay UP-TO-DATE even if an unrelated file changes.
This PR changes the paths so they are relative and the task can be relocable

Was this page helpful?
0 / 5 - 0 ratings