Add task for running tests that runs both clutter levels accordingly.
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / multivm / ident / TargetClassifier.java
blobad94de194bc5bec25a696473238883f1a9f6fbf2
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 GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.plugin.multivm.ident;
12 import cc.squirreljme.plugin.multivm.BangletVariant;
13 import cc.squirreljme.plugin.multivm.ClutterLevel;
14 import cc.squirreljme.plugin.multivm.VMSpecifier;
15 import cc.squirreljme.plugin.multivm.VMType;
16 import java.io.Serializable;
17 import lombok.AllArgsConstructor;
18 import lombok.Builder;
19 import lombok.NonNull;
20 import lombok.Value;
22 /**
23 * Represents the target classifier, the kind of virtual machine and variant
24 * is being targeted.
26 * @since 2022/10/01
28 @Value
29 @AllArgsConstructor
30 @Builder
31 public class TargetClassifier
32 implements Serializable
34 /** The virtual machine type. */
35 @NonNull
36 VMSpecifier vmType;
38 /** The banglet variant used. */
39 @NonNull
40 BangletVariant bangletVariant;
42 /** The clutter level used. */
43 @NonNull
44 ClutterLevel clutterLevel;
46 /**
47 * Sets up a new classifier with the clutter level.
49 * @param __clutterLevel The new clutter level.
50 * @return The classifier with the new clutter level.
51 * @throws NullPointerException On null arguments.
52 * @since 2023/02/05
54 public TargetClassifier withClutterLevel(ClutterLevel __clutterLevel)
55 throws NullPointerException
57 if (__clutterLevel == null)
58 throw new NullPointerException("NARG");
60 return new TargetClassifier(this.vmType, this.bangletVariant,
61 __clutterLevel);
64 /**
65 * Specifies an alternative virtual machine to use, but with the same
66 * banglet.
68 * @param __vm The virtual machine to use instead.
69 * @return The modified target classifier.
70 * @throws NullPointerException On null arguments.
71 * @since 2022/12/23
73 public TargetClassifier withVm(VMSpecifier __vm)
74 throws NullPointerException
76 if (__vm == null)
77 throw new NullPointerException("NARG");
79 return new TargetClassifier(__vm, this.bangletVariant,
80 this.clutterLevel);
83 /**
84 * Returns the classifier to be used by the emulated JIT.
86 * @return The classifier with the appropriate VM based on if it supports
87 * emulated JIT.
88 * @since 2022/12/23
90 public TargetClassifier withVmByEmulatedJit()
92 if (this.vmType.hasEmulatorJit())
93 return new TargetClassifier(VMType.SPRINGCOAT,
94 BangletVariant.NONE, ClutterLevel.DEBUG);
95 return this;