NX01: Fixed M2E build cycle into normal maven style compile
This commit is contained in:
parent
c34b7694c5
commit
2395cd1f1f
14 changed files with 76 additions and 59 deletions
|
|
@ -7,4 +7,11 @@
|
|||
<version>5786.SHEVAT〄.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>nx01-kode-gen</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.nx01.kode.generator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import love.distributedrebirth.nx01.kode.generator.klass.ModelKlass;
|
||||
import love.distributedrebirth.nx01.kode.generator.klass.ModelKlassWriter;
|
||||
|
||||
/// Generated the nether tone interface tree forest.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public class ModelNetherTones implements KodeGenModel {
|
||||
|
||||
private final String BASE_PACK = "ᒢᐩᐩ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ";
|
||||
|
||||
@Override
|
||||
public String generatorKey() {
|
||||
return "nether-tone";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generatorModelHash() {
|
||||
return "16";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildModels(ModelKlassWriter writer) throws IOException {
|
||||
|
||||
// TODO: redo tree again, as a Q slug, should be usable to reuse in any other Qx slug
|
||||
// but that needs generics and than 2 equals interfaces do not match anymore...
|
||||
buildToneScript(writer);
|
||||
|
||||
buildNetherQuadrant(writer, "NetherTone", "NetherToneScript", false);
|
||||
}
|
||||
|
||||
private void buildToneScript(ModelKlassWriter writer) {
|
||||
String s = "ᔆᒼᣗᑊᣖᐪ";
|
||||
String q = "ᐊᐪᔆ";
|
||||
String e = "NetherToneScript";
|
||||
|
||||
buildNetherTreeSlug(writer, s, q + "AG1", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "AG2", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "AG3", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "BL0W", 512, e);
|
||||
buildNetherTreeSlug(writer, s, q + "CR1", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "CR2", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "CR3", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "DB1", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "DB2", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "DB3", 64, e);
|
||||
buildNetherTreeSlug(writer, s, q + "ER0W", 512, e);
|
||||
|
||||
buildNetherQuadrant(writer, e, q, true); // permits all above
|
||||
}
|
||||
|
||||
private void buildNetherTreeSlug(ModelKlassWriter writer, String subPackage, String javaName, int slugSize, String quadrant) {
|
||||
ModelKlass klass = new ModelKlass(BASE_PACK + "." + subPackage, javaName);
|
||||
klass.addJavaImport(BASE_PACK + "." + quadrant);
|
||||
writer.addModelKlass(klass);
|
||||
StringBuilder buf = klass.getBody();
|
||||
buf.append("public sealed interface ");
|
||||
buf.append(klass.getJavaName());
|
||||
buf.append(" extends ");
|
||||
buf.append(quadrant);
|
||||
buf.append(" {\n");
|
||||
for (int i = 0 ; i < slugSize; i++) {
|
||||
String partCode = "ᐅ" + String.format("%03d", i);
|
||||
if (slugSize < 100) {
|
||||
partCode = "ᐅ" + String.format("%02d", i);
|
||||
}
|
||||
String clsBase = partCode + " extends " + klass.getJavaName();
|
||||
String clsMutexExt = ", " + javaName + "Mutex<" + partCode + ">";
|
||||
buf.append("\tnon-sealed interface " + clsBase + clsMutexExt + " {}\n");
|
||||
}
|
||||
buf.append("}\n");
|
||||
|
||||
ModelKlass klassMutex = new ModelKlass(BASE_PACK + "." + subPackage, javaName + "Mutex");
|
||||
writer.addModelKlass(klassMutex);
|
||||
StringBuilder bufMutex = klassMutex.getBody();
|
||||
bufMutex.append("interface ");
|
||||
bufMutex.append(klassMutex.getJavaName());
|
||||
bufMutex.append("<T> {\n");
|
||||
bufMutex.append("}\n");
|
||||
}
|
||||
|
||||
private void buildNetherQuadrant(ModelKlassWriter writer, String javaName, String javaSearch, boolean child) {
|
||||
ModelKlass klass = new ModelKlass(BASE_PACK, javaName);
|
||||
StringBuilder buf = klass.getBody();
|
||||
buf.append("public sealed interface ");
|
||||
buf.append(klass.getJavaName());
|
||||
if (child) {
|
||||
buf.append(" extends NetherTone");
|
||||
}
|
||||
buf.append(" permits\n");
|
||||
Stream<ModelKlass> f = writer.getModelKlasses().stream().filter(v -> !v.getJavaName().contains("Mutex")).filter(v -> v.getJavaName().contains(javaSearch));
|
||||
for (Iterator<ModelKlass> i = f.iterator(); i.hasNext() ;) {
|
||||
ModelKlass mk = i.next();
|
||||
if (child) {
|
||||
klass.addJavaImport(mk.getJavaPackage() + "." + mk.getJavaName());
|
||||
}
|
||||
buf.append("\t");
|
||||
buf.append(mk.getJavaName());
|
||||
if (i.hasNext()) {
|
||||
buf.append(",\n");
|
||||
} else {
|
||||
buf.append("\n");
|
||||
}
|
||||
}
|
||||
buf.append("\t{\n");
|
||||
buf.append("}\n");
|
||||
writer.addModelKlass(klass);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
love.distributedrebirth.nx01.kode.generator.ModelNetherTones
|
||||
Loading…
Add table
Add a link
Reference in a new issue