diff --git a/TinTeaTechAnnotationProcessor/src/main/java/com/xkball/tin_tea_tech/util/CodecManager.java b/TinTeaTechAnnotationProcessor/src/main/java/com/xkball/tin_tea_tech/util/CodecManager.java index 92b3c6c..2ac804a 100644 --- a/TinTeaTechAnnotationProcessor/src/main/java/com/xkball/tin_tea_tech/util/CodecManager.java +++ b/TinTeaTechAnnotationProcessor/src/main/java/com/xkball/tin_tea_tech/util/CodecManager.java @@ -1,5 +1,6 @@ package com.xkball.tin_tea_tech.util; +import com.github.javaparser.ParserConfiguration; import com.github.javaparser.StaticJavaParser; import com.sun.tools.javac.api.JavacTrees; import com.sun.tools.javac.code.Symtab; @@ -112,6 +113,7 @@ public static void addCodec(String type, String codecTypeName, String codecRef, } public static void readFromSources() { + StaticJavaParser.getParserConfiguration().setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_21); for (var env : enter.getEnvs()) { var tree = env.tree; if (!(tree instanceof JCTree.JCClassDecl classTree)) return; diff --git a/TinTeaTechAnnotationProcessor/src/main/resources/META-INF/com.xkball.codec_provider b/TinTeaTechAnnotationProcessor/src/main/resources/META-INF/com.xkball.codec_provider deleted file mode 100644 index e69de29..0000000 diff --git a/build.gradle b/build.gradle index 7bdf9a5..d0cad0a 100644 --- a/build.gradle +++ b/build.gradle @@ -8,41 +8,6 @@ plugins { id 'net.neoforged.moddev' version '2.0.16-beta' } - -//from https://github.com/teaconmc/PowerTool/blob/1.21-neoforge/build.gradle -abstract class TeaConDumpPathToGitHub extends DefaultTask { - @Input - abstract Property getPublishName() - @InputFile - abstract RegularFileProperty getTargetFile() - @TaskAction - void dump() { - if (System.env.GITHUB_ACTIONS) { - File theFile = targetFile.getAsFile().get() - - def outputFile = new File(System.env.GITHUB_OUTPUT) - // Use the env-specific line separator for maximally possible compatibility - def newLine = System.getProperty('line.separator') - println outputFile.name - println theFile.name - // Write out new env variable for later usage - outputFile << newLine << "artifact_name=${theFile.getName()}" - outputFile << newLine << "artifact_publish_name=${publishName.get()}" - outputFile << newLine << "artifact_path=${theFile.absolutePath}" - } - } -} - -tasks.register("githubActionOutput", TeaConDumpPathToGitHub) { task -> - task.onlyIf { - System.env.GITHUB_ACTIONS - } - var endfix = System.env.VERSION_IDENTIFIER +"-"+ LocalDateTime.now(ZoneOffset.ofHours(8)).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME) - task.getPublishName().set("${jar.archiveBaseName.get()}-${version}-${endfix}-nightly.jar") - task.getTargetFile().set(jar.archiveFile) -} - - tasks.named('wrapper', Wrapper).configure { // Define wrapper values here so as to not have to always do so when updating gradlew.properties. // Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with @@ -62,6 +27,11 @@ repositories { base { archivesName = mod_id + if(System.env.GITHUB_ACTIONS){ + var endfix = System.env.VERSION_IDENTIFIER +"-"+ LocalDateTime.now(ZoneOffset.ofHours(8)).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME).replace(':','-') + archivesName="${archivesName.get()}-${version}-${endfix}-nightly" + version='' + } } // Mojang ships Java 21 to end users starting in 1.20.5, so mods should target Java 21. @@ -245,6 +215,7 @@ jar { from("build/classes/java/main/META-INF"){ include '**/*' into 'META-INF' + duplicatesStrategy = DuplicatesStrategy.INCLUDE } }