Indentations break the feed.
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / multivm / VMRomInputs.java
blobea6e4ff97189bbe71aedac396864b89b42cb2deb
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.plugin.multivm;
12 import cc.squirreljme.plugin.multivm.ident.SourceTargetClassifier;
13 import java.io.File;
14 import java.nio.file.Path;
15 import java.util.Collection;
16 import java.util.LinkedHashSet;
17 import java.util.concurrent.Callable;
19 /**
20 * Returns the inputs for the ROM.
22 * @since 2020/08/23
24 public class VMRomInputs
25 implements Callable<Iterable<Path>>
27 /** The task to generate for. */
28 protected final VMRomTask task;
30 /** The classifier used. */
31 protected final SourceTargetClassifier classifier;
33 /**
34 * Initializes the handler.
36 * @param __task The task to create for.
37 * @param __classifier The classifier used.
38 * @throws NullPointerException On null arguments.
39 * @since 2020/08/23
41 public VMRomInputs(VMRomTask __task,
42 SourceTargetClassifier __classifier)
43 throws NullPointerException
45 if (__task == null || __classifier == null)
46 throw new NullPointerException("NARG");
48 this.task = __task;
49 this.classifier = __classifier;
52 /**
53 * {@inheritDoc}
54 * @since 2020/08/23
56 @Override
57 public Iterable<Path> call()
59 // All the inputs for the ROM are the outputs of all the library tasks
60 Collection<Path> rv = new LinkedHashSet<>();
61 for (VMLibraryTask task : VMRomDependencies.libraries(this.task,
62 this.classifier))
63 for (File f : task.getOutputs().getFiles().getFiles())
64 rv.add(f.toPath());
66 return rv;