1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
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
.util
.concurrent
.Callable
;
16 * This is the set of dependencies for {@link VMRunTask} which takes all
17 * the dependencies directly needed in order to run the program.
19 * If the virtual machine is {@link VMSpecifier#hasEmulatorJit()} then
20 * SpringCoat libraries will be used instead of the ROM libraries for running.
24 public final class VMRunDependencies
25 implements Callable
<Iterable
<VMLibraryTask
>>
27 /** The task executing under. */
28 protected final VMExecutableTask task
;
30 /** The classifier used. */
31 protected final SourceTargetClassifier classifier
;
34 * Initializes the provider.
36 * @param __task The task working under.
37 * @param __classifier The classifier used.
38 * @throws NullPointerException On null arguments.
41 public VMRunDependencies(VMExecutableTask __task
,
42 SourceTargetClassifier __classifier
)
43 throws NullPointerException
45 if (__task
== null || __classifier
== null)
46 throw new NullPointerException("NARG");
49 this.classifier
= __classifier
;
57 public final Iterable
<VMLibraryTask
> call()
59 VMExecutableTask task
= this.task
;
61 // If this is emulator that is JIT capable, instead for running
62 // load it with SpringCoat's library instead
63 boolean emuJit
= this.classifier
.getTargetClassifier().getVmType()
66 return VMHelpers
.<VMLibraryTask
>resolveProjectTasks(
67 VMLibraryTask
.class, task
.getProject(),
68 VMHelpers
.runClassTasks(this.task
.getProject(),
69 this.classifier
.withVmByEmulatedJit(), true));
71 return VMHelpers
.<VMLibraryTask
>resolveProjectTasks(
72 VMLibraryTask
.class, task
.getProject(),
73 VMHelpers
.runClassTasks(this.task
.getProject(),
74 this.classifier
, true));