Limit how often GC can be run.
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / multivm / NanoCoatBuiltInCleanTask.java
blob40eb3b38100a9486a4c76c9940a9ce475d19cdba
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 java.io.IOException;
14 import java.nio.file.Files;
15 import javax.inject.Inject;
16 import lombok.Getter;
17 import org.gradle.api.DefaultTask;
19 /**
20 * Cleans the NanoCoat built-in extracted code.
22 * @since 2023/09/03
24 public class NanoCoatBuiltInCleanTask
25 extends DefaultTask
26 implements VMBaseTask
28 /** The classifier used. */
29 @Getter
30 private final SourceTargetClassifier classifier;
32 /**
33 * Initializes the full suite task.
35 * @param __classifier The classifier used.
36 * @param __builtInTask The task used to create the ROM.
37 * @throws NullPointerException On null arguments.
38 * @since 2023/09/03
40 @Inject
41 public NanoCoatBuiltInCleanTask(SourceTargetClassifier __classifier,
42 NanoCoatBuiltInTask __builtInTask)
43 throws NullPointerException
45 if (__classifier == null || __builtInTask == null)
46 throw new NullPointerException("NARG");
48 this.classifier = __classifier;
50 // Set details of this task
51 this.setGroup("squirreljmeGeneral");
52 this.setDescription(String.format("Cleans the built-in outputs of %s.",
53 __builtInTask.getName()));
55 // This is up-to-date if the target directory is missing
56 this.getOutputs().upToDateWhen((__task) ->
58 return !Files.exists(__builtInTask.specificPath().get());
59 });
61 // Performs the cleaning accordingly
62 this.doLast(new NanoCoatBuiltInCleanTaskAction(__classifier,
63 __builtInTask.romBasePath(), __builtInTask.specificPath(),
64 __builtInTask.sharedPath()));
67 /**
68 * {@inheritDoc}
69 * @since 2023/09/03
71 @Override
72 public SourceTargetClassifier getClassifier()
74 throw new Error("TODO");