Kotlin support fixes

This commit is contained in:
Anuken 2021-04-03 00:59:57 -04:00
parent d538e63c4c
commit 28a2e7c697
5 changed files with 17 additions and 10 deletions

View File

@ -219,7 +219,7 @@ public abstract class BaseProcessor extends AbstractProcessor{
String path = Fi.get(filer.getResource(StandardLocation.CLASS_OUTPUT, "no", "no")
.toUri().toURL().toString().substring(OS.isWindows ? 6 : "file:".length()))
.parent().parent().parent().parent().parent().parent().parent().toString().replace("%20", " ");
rootDirectory = Fi.get(path);
rootDirectory = Fi.get(path).parent();
}catch(IOException e){
throw new RuntimeException(e);
}

View File

@ -749,6 +749,7 @@ public class EntityProcess extends BaseProcessor{
//store nulls
TypeSpec.Builder nullsBuilder = TypeSpec.classBuilder("Nulls").addModifiers(Modifier.PUBLIC).addModifiers(Modifier.FINAL);
ObjectSet<String> nullList = ObjectSet.with("unit", "blockUnit");
//create mock types of all components
for(Stype interf : allInterfaces){
@ -767,6 +768,12 @@ public class EntityProcess extends BaseProcessor{
//create null builder
String baseName = interf.name().substring(0, interf.name().length() - 1);
//prevent Nulls bloat
if(!nullList.contains(Strings.camelize(baseName))){
continue;
}
String className = "Null" + baseName;
TypeSpec.Builder nullBuilder = TypeSpec.classBuilder(className)
.addModifiers(Modifier.FINAL);

View File

@ -20,8 +20,8 @@ public class AssetsProcess extends BaseProcessor{
@Override
public void process(RoundEnvironment env) throws Exception{
processSounds("Sounds", rootDirectory + "/assets/sounds", "arc.audio.Sound");
processSounds("Musics", rootDirectory + "/assets/music", "arc.audio.Music");
processSounds("Sounds", rootDirectory + "/core/assets/sounds", "arc.audio.Sound");
processSounds("Musics", rootDirectory + "/core/assets/music", "arc.audio.Music");
processUI(env.getElementsAnnotatedWith(StyleDefaults.class));
}
@ -33,11 +33,11 @@ public class AssetsProcess extends BaseProcessor{
MethodSpec.Builder loadStyles = MethodSpec.methodBuilder("loadStyles").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
MethodSpec.Builder icload = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
CodeBlock.Builder ichinit = CodeBlock.builder();
String resources = rootDirectory + "/assets-raw/sprites/ui";
Jval icons = Jval.read(Fi.get(rootDirectory + "/assets-raw/fontgen/config.json").readString());
String resources = rootDirectory + "/core/assets-raw/sprites/ui";
Jval icons = Jval.read(Fi.get(rootDirectory + "/core/assets-raw/fontgen/config.json").readString());
ObjectMap<String, String> texIcons = new OrderedMap<>();
PropertiesUtils.load(texIcons, Fi.get(rootDirectory + "/assets/icons/icons.properties").reader());
PropertiesUtils.load(texIcons, Fi.get(rootDirectory + "/core/assets/icons/icons.properties").reader());
StringBuilder iconcAll = new StringBuilder();

View File

@ -23,7 +23,7 @@ buildscript{
}
}
plugins {
plugins{
id 'org.jetbrains.kotlin.jvm' version '1.4.32'
id "org.jetbrains.kotlin.kapt" version "1.4.32"
}
@ -295,8 +295,8 @@ project(":core"){
apply plugin: "kotlin"
apply plugin: "kotlin-kapt"
kapt {
javacOptions {
kapt{
javacOptions{
option("-source", "14")
option("-target", "1.8")
option("--enable-preview")

View File

@ -1,9 +1,9 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=0e99b0291f81d74d335dca8b0cf3bf26931f1197
# Don't recompute annotations if sources haven't been changed
kapt.incremantal.apt = true
# Multithreaded
kapt.use.worker.api=true
# Compilation avoidance (see https://kotlinlang.org/docs/kapt.html#compile-avoidance-for-kapt-since-1-3-20)
kapt.include.compile.classpath=false
archash=0e99b0291f81d74d335dca8b0cf3bf26931f1197