Cherry pick the banglets and such from wip-l1summercoat, this will be the basis for...
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / multivm / CheckRomShouldBuild.java
blobe14905896868ed88579f96f30efc20ae2c2d2e92
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 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.TargetClassifier;
13 import org.gradle.api.Task;
14 import org.gradle.api.specs.Spec;
16 /**
17 * Check to see if the ROM is valid.
19 * @since 2020/08/23
21 public class CheckRomShouldBuild
22 implements Spec<Task>
24 /** The classifier used. */
25 protected final TargetClassifier classifier;
27 /**
28 * Checks if a ROM should be built.
30 * @param __classifier The classifier used.
31 * @throws NullPointerException On null arguments.
32 * @since 2020/08/23
34 public CheckRomShouldBuild(TargetClassifier __classifier)
35 throws NullPointerException
37 if (__classifier == null)
38 throw new NullPointerException("NARG");
40 this.classifier = __classifier;
43 /**
44 * {@inheritDoc}
45 * @since 2020/08/23
47 @Override
48 public boolean isSatisfiedBy(Task __task)
49 throws NullPointerException
51 if (__task == null)
52 throw new NullPointerException("NARG");
54 return this.classifier.getVmType().hasRom(
55 this.classifier.getBangletVariant());