Hi, folks! I have the following code snippet prese...
# getting-started
j
Hi, folks! I have the following code snippet presented on the screenshot and two questions related to it: 1. the
srcDirs
property provides
Set<File!>
I further use with
.map(File::toPath)
– I assume it’s rather necessary to
.filterNotNull()
before, right? 2. As I have couple of chained operations – wouldn’t it be better to convert the initial set to sequence?
1
j
1. It might not be necessary but it's good sanity check 2. If the srcDirs is small (and it often is) then converting that to sequence wouldn't really change that much
j
1. The code is a part of the Gradle plugin and pushed to God know how many projects – it has to be safe. 🙂 2. Yup, it’s a tiny list; then I’m skipping that part. Thanks, Jakub!
👍 1
s
won't the hardcoded seperator '/' in "META-INF/plugin.xml" make this code fail on Windows?? Or does
resolve()
take care of this? 🤔
j
Both
File.resolve
and
Path.resolve
resolve it properly. 🙂
👍 1