low priority queue, enums as low prio
All checks were successful
studiorailgun/highlevel-netcode-gen/pipeline/head This commit looks good
All checks were successful
studiorailgun/highlevel-netcode-gen/pipeline/head This commit looks good
This commit is contained in:
parent
1bb9cb1b35
commit
852251ce01
@ -29,7 +29,7 @@ public class Main {
|
||||
public static boolean LOG = true;
|
||||
|
||||
//controls whether files are actually written to disk or not
|
||||
public static boolean WRITE_TO_DISK = true;
|
||||
public static boolean WRITE_TO_DISK = false;
|
||||
|
||||
//hard-coded white list files to always parse
|
||||
static final String[] ALWAYS_PARSED_CLASSES = new String[]{
|
||||
@ -82,6 +82,7 @@ public class Main {
|
||||
*/
|
||||
static List<TargetFile> getFilesToModify(String topLevelFolderPath){
|
||||
List<TargetFile> rVal = new LinkedList<TargetFile>();
|
||||
List<TargetFile> lowPriority = new LinkedList<TargetFile>();
|
||||
File topLevelFolder = new File(topLevelFolderPath);
|
||||
List<File> fileQueue = new LinkedList<File>();
|
||||
List<File> fileQueueOpenSet = new LinkedList<File>();
|
||||
@ -98,10 +99,14 @@ public class Main {
|
||||
String content = "";
|
||||
try {
|
||||
content = Files.readString(currentFile.toPath());
|
||||
if(
|
||||
content.contains("@SynchronizedBehaviorTree") ||
|
||||
isHardCodedAlwaysParse(currentFile.getName())
|
||||
){
|
||||
if(content.contains("@SynchronizedBehaviorTree")){
|
||||
//get relative path
|
||||
Path relativePath = topLevelFolder.toPath().relativize(currentFile.toPath());
|
||||
String relativePathString = "src/main/java/electrosphere/" + relativePath.toString();
|
||||
//parse
|
||||
JavaClassSource source = parseJavaFile(content);
|
||||
lowPriority.add(new TargetFile(currentFile.getAbsolutePath(), relativePathString, content, currentFile.getName(), source));
|
||||
} else if(isHardCodedAlwaysParse(currentFile.getName())){
|
||||
//get relative path
|
||||
Path relativePath = topLevelFolder.toPath().relativize(currentFile.toPath());
|
||||
String relativePathString = "src/main/java/electrosphere/" + relativePath.toString();
|
||||
@ -126,6 +131,7 @@ public class Main {
|
||||
fileQueue.remove(currentClosedFile);
|
||||
}
|
||||
}
|
||||
rVal.addAll(lowPriority);
|
||||
return rVal;
|
||||
}
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ public class ClientAttach implements VirtualMethod {
|
||||
@Override
|
||||
public List<String> getImports(ProjectStructure projectStructure) {
|
||||
List<String> rVal = Arrays.asList(new String[]{
|
||||
"electrosphere.net.synchronization.BehaviorTreeIdEnums",
|
||||
"electrosphere.net.synchronization.enums.BehaviorTreeIdEnums",
|
||||
});
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@ -44,8 +44,8 @@ public class ClientInterrupt implements VirtualMethod {
|
||||
public List<String> getImports(ProjectStructure projectStructure) {
|
||||
List<String> rVal = Arrays.asList(new String[]{
|
||||
"electrosphere.net.parser.net.message.SynchronizationMessage",
|
||||
"electrosphere.net.synchronization.BehaviorTreeIdEnums",
|
||||
"electrosphere.net.synchronization.ServerSynchronizationManager",
|
||||
"electrosphere.net.synchronization.enums.BehaviorTreeIdEnums",
|
||||
"electrosphere.net.synchronization.server.ServerSynchronizationManager",
|
||||
});
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@ -44,8 +44,8 @@ public class ClientStart implements VirtualMethod {
|
||||
public List<String> getImports(ProjectStructure projectStructure) {
|
||||
List<String> rVal = Arrays.asList(new String[]{
|
||||
"electrosphere.net.parser.net.message.SynchronizationMessage",
|
||||
"electrosphere.net.synchronization.BehaviorTreeIdEnums",
|
||||
"electrosphere.net.synchronization.ServerSynchronizationManager",
|
||||
"electrosphere.net.synchronization.enums.BehaviorTreeIdEnums",
|
||||
"electrosphere.net.synchronization.server.ServerSynchronizationManager",
|
||||
});
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ public class ServerAttach implements VirtualMethod {
|
||||
public List<String> getImports(ProjectStructure projectStructure) {
|
||||
List<String> rVal = Arrays.asList(new String[]{
|
||||
"electrosphere.server.datacell.utils.ServerBehaviorTreeUtils",
|
||||
"electrosphere.net.synchronization.BehaviorTreeIdEnums",
|
||||
"electrosphere.net.synchronization.enums.BehaviorTreeIdEnums",
|
||||
});
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public class ServerFieldSetter implements VirtualMethod {
|
||||
List<String> rVal = Arrays.asList(new String[]{
|
||||
"electrosphere.net.parser.net.message.SynchronizationMessage",
|
||||
"electrosphere.server.datacell.utils.DataCellSearchUtils",
|
||||
"electrosphere.net.synchronization.FieldIdEnums",
|
||||
"electrosphere.net.synchronization.enums.FieldIdEnums",
|
||||
});
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ public class BTreeIdEnum extends VirtualClass {
|
||||
super(
|
||||
new TargetFile(
|
||||
null,
|
||||
"src/main/java/electrosphere/net/synchronization/BehaviorTreeIdEnums.java",
|
||||
"src/main/java/electrosphere/net/synchronization/enums/BehaviorTreeIdEnums.java",
|
||||
"",
|
||||
"BehaviorTreeIdEnums",
|
||||
null
|
||||
|
||||
@ -23,7 +23,7 @@ public class FieldIdEnum extends VirtualClass {
|
||||
super(
|
||||
new TargetFile(
|
||||
null,
|
||||
"src/main/java/electrosphere/net/synchronization/FieldIdEnums.java",
|
||||
"src/main/java/electrosphere/net/synchronization/enums/FieldIdEnums.java",
|
||||
"",
|
||||
"FieldIdEnums",
|
||||
null
|
||||
|
||||
@ -95,7 +95,7 @@ public class BTreeParser {
|
||||
// ADD IMPORTS HERE
|
||||
//
|
||||
//
|
||||
rVal.addImport("electrosphere.net.synchronization.BehaviorTreeIdEnums");
|
||||
rVal.addImport("electrosphere.net.synchronization.enums.BehaviorTreeIdEnums");
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Loading…
Reference in New Issue
Block a user