1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // Multi-Phasic Applications: 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 cc
.squirreljme
.plugin
.swm
.JavaMEMidlet
;
15 import javax
.inject
.Inject
;
16 import org
.gradle
.api
.DefaultTask
;
17 import org
.gradle
.api
.Project
;
20 * Run whatever Jar we want through the build system.
24 public class VMRunWhateverTask
27 /** The classifier to use. */
28 protected final SourceTargetClassifier classifier
;
30 /** The debug server. */
31 protected final URI debugServer
;
33 /** Run main class? */
34 protected final boolean mainClass
;
36 /** Run which MIDlet? */
37 protected final int midlet
;
40 * Initializes the task.
42 * @param __classifier The classifier used.
43 * @param __mainClass The main class to run.
44 * @param __midlet The MIDlet to run.
45 * @param __debugServer The debug server to use.
49 public VMRunWhateverTask(SourceTargetClassifier __classifier
,
50 String __mainClass
, JavaMEMidlet __midlet
, URI __debugServer
)
53 this.classifier
= __classifier
;
54 this.mainClass
= "main".equals(__mainClass
);
55 this.midlet
= Integer
.parseInt((__midlet
!= JavaMEMidlet
.NONE ?
56 __midlet
.mainClass
: "-1"));
57 this.debugServer
= __debugServer
;
60 this.setGroup("squirreljmeGeneral");
61 this.setDescription("Run a Jar using the build system.");
63 // Depend on the general emulator and otherwise
64 Project project
= this.getProject();
65 Project rootProject
= project
.getRootProject();
67 project
.provider(new VMRunDependencies(rootProject
.findProject(
68 ":modules:profile-meep"),
70 project
.provider(new VMRunDependencies(rootProject
.findProject(
71 ":modules:vendor-api-ntt-docomo-doja"),
73 project
.provider(new VMEmulatorDependencies(project
,
74 __classifier
.getTargetClassifier())));
77 this.doLast(new VMRunWhateverTaskAction());