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
;
17 import org
.gradle
.api
.DefaultTask
;
20 * Cleans the NanoCoat built-in extracted code.
24 public class NanoCoatBuiltInCleanTask
28 /** The classifier used. */
30 private final SourceTargetClassifier classifier
;
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.
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());
61 // Performs the cleaning accordingly
62 this.doLast(new NanoCoatBuiltInCleanTaskAction(__classifier
,
63 __builtInTask
.romBasePath(), __builtInTask
.specificPath(),
64 __builtInTask
.sharedPath()));
72 public SourceTargetClassifier
getClassifier()
74 throw new Error("TODO");