Indentations break the feed.
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / multivm / VMRunWhateverTask.java
blob7a407a37202ccb1874c3d51ae4e9559d887584a0
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;
14 import java.net.URI;
15 import javax.inject.Inject;
16 import org.gradle.api.DefaultTask;
17 import org.gradle.api.Project;
19 /**
20 * Run whatever Jar we want through the build system.
22 * @since 2024/07/28
24 public class VMRunWhateverTask
25 extends DefaultTask
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;
39 /**
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.
46 * @since 2024/07/28
48 @Inject
49 public VMRunWhateverTask(SourceTargetClassifier __classifier,
50 String __mainClass, JavaMEMidlet __midlet, URI __debugServer)
52 // Store for later
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;
59 // Describe this one
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();
66 this.dependsOn(
67 project.provider(new VMRunDependencies(rootProject.findProject(
68 ":modules:profile-meep"),
69 __classifier)),
70 project.provider(new VMRunDependencies(rootProject.findProject(
71 ":modules:vendor-api-ntt-docomo-doja"),
72 __classifier)),
73 project.provider(new VMEmulatorDependencies(project,
74 __classifier.getTargetClassifier())));
76 // Running this
77 this.doLast(new VMRunWhateverTaskAction());