generated from Zelaux/ZelauxMindustryModTemplate
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into drone-ai-fix
# Conflicts: # build.gradle.kts # src/omaloon/ai/DroneAI.java # src/omaloon/ai/drone/AttackDroneAI.java # src/omaloon/ai/drone/UtilityDroneAI.java # src/omaloon/entities/abilities/DroneAbility.java
- Loading branch information
Showing
209 changed files
with
11,212 additions
and
8,095 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Omaloon [debug jar]" type="GradleRunConfiguration" factoryName="Gradle"> | ||
<ExternalSystemSettings> | ||
<option name="env"> | ||
<map> | ||
<entry key="lombok.plugin.debug_sleep" value="3600"/> | ||
</map> | ||
</option> | ||
<option name="executionName"/> | ||
<option name="externalProjectPath" value="$PROJECT_DIR$"/> | ||
<option name="externalSystemIdString" value="GRADLE"/> | ||
<option name="scriptParameters" value="--stacktrace"/> | ||
<option name="taskDescriptions"> | ||
<list/> | ||
</option> | ||
<option name="taskNames"> | ||
<list> | ||
<option value="jar"/> | ||
</list> | ||
</option> | ||
<option name="vmOptions"/> | ||
</ExternalSystemSettings> | ||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
<DebugAllEnabled>false</DebugAllEnabled> | ||
<RunAsTest>false</RunAsTest> | ||
<method v="2"/> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
println("Hello from gradle") | ||
apply plugin: "java" | ||
|
||
tasks.withType(JavaCompile).tap{ | ||
configureEach{ | ||
options.fork = true | ||
options.compilerArgs += [ | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.code.Symbol=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.code.Type=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.tree.JCTree=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED', | ||
'--add-exports', 'jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED', | ||
] | ||
} | ||
} | ||
repositories{ | ||
// Necessary Maven repositories to pull dependencies from. | ||
mavenCentral() | ||
|
||
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" } | ||
maven{ url "https://oss.sonatype.org/content/repositories/releases/" } | ||
maven{ url "https://raw.githubusercontent.com/GlennFolker/EntityAnnoMaven/main" } | ||
|
||
// Use Zelaux's non-buggy repository for release Mindustry and Arc builds. | ||
maven{ url "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" } | ||
maven{ url "https://raw.githubusercontent.com/Zelaux/Repo/master/repository" } | ||
} | ||
|
||
/*tasks.withType(JavaCompile){ | ||
options.debug = true | ||
options.fork = true | ||
options.compilerArgs.add("-g") | ||
options.forkOptions.jvmArgs.add( | ||
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5008" | ||
) | ||
}*/ | ||
dependencies{ | ||
implementation asmLib.invoke(":annotations:lombok-plugin-starter") | ||
|
||
|
||
compileOnly "org.jetbrains:annotations:24.0.1" | ||
|
||
implementation "com.github.javaparser:javaparser-symbol-solver-core:$jparcerVersion" | ||
|
||
compileOnly "org.projectlombok:lombok:$lombokVersion" | ||
annotationProcessor "org.projectlombok:lombok:$lombokVersion"//,asmLib.invoke(":annotations:lombok-plugin-starter") | ||
implementation "one.util:streamex:$streamExVersion" | ||
} |
106 changes: 106 additions & 0 deletions
106
annotations/src/main/java/bytelogic/lombok/hierarchy/CollectedHierarchyInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package bytelogic.lombok.hierarchy; | ||
|
||
import bytelogic.lombok.hierarchy.info.*; | ||
import bytelogic.lombok.util.*; | ||
import lombok.javac.*; | ||
import lombok.*; | ||
import one.util.streamex.*; | ||
import org.jetbrains.annotations.*; | ||
|
||
import java.util.*; | ||
import java.util.function.*; | ||
|
||
public class CollectedHierarchyInfo{ | ||
public static final String JAVA_LANG_OBJECT = "java.lang.Object"; | ||
public static final InterfaceInfo interfacesRoot = new InterfaceInfo("?interfacesRoot?", "?interfacesRoot?"); | ||
static ClassInfo javaLangObject = new ClassInfo(JAVA_LANG_OBJECT, JAVA_LANG_OBJECT); | ||
static Map<String, ClassInfo> classInfoMap; | ||
static Map<String, InterfaceInfo> interfacesInfoMap; | ||
|
||
public static ClassInfo classInfo(String className){ | ||
return classInfoMap.get(className); | ||
} | ||
|
||
public static InterfaceInfo interfaceInfo(String name){ | ||
return interfacesInfoMap.get(name); | ||
} | ||
|
||
public static EntryStream<String, InterfaceInfo> interfaces(){ | ||
return EntryStream.of(interfacesInfoMap) | ||
.removeKeys(it -> it.equals(interfacesRoot.name)); | ||
} | ||
|
||
public static EntryStream<String, ClassInfo> classes(){ | ||
return EntryStream.of(classInfoMap); | ||
} | ||
|
||
|
||
@NotNull | ||
public static ArrayList<ClassInfo> collectAllImpl(InterfaceInfo interfaceInfo){ | ||
ArrayList<InterfaceInfo> allSubTypes = collectAllSub(interfaceInfo); | ||
val classInfoStream = allSubTypes | ||
.stream() | ||
.map(it -> it.impltypes.values()) | ||
.flatMap(Collection::stream) | ||
.distinct() | ||
.toArray(ClassInfo[]::new); | ||
; | ||
|
||
ArrayList<ClassInfo> implementedClasses = new ArrayList<>(); | ||
Set<String> visitedNames = new HashSet<>(); | ||
class Visitor{ | ||
static void visit(Set<String> visitedNames, ClassInfo info, ArrayList<ClassInfo> targetCollection){ | ||
if(!visitedNames.add(info.name)) return; | ||
targetCollection.add(info); | ||
for(ClassInfo value : info.subtypes.values()){ | ||
visit(visitedNames, value, targetCollection); | ||
} | ||
} | ||
} | ||
for(ClassInfo info : classInfoStream){ | ||
Visitor.visit(visitedNames, info, implementedClasses); | ||
} | ||
return implementedClasses; | ||
} | ||
|
||
@NotNull | ||
public static ArrayList<InterfaceInfo> collectAllSub(InterfaceInfo interfaceInfo){ | ||
ArrayList<InterfaceInfo> allSubTypes = new ArrayList<>(); | ||
//noinspection unchecked | ||
BiConsumer<String, InterfaceInfo> visitor = new BiConsumer<>(){ | ||
|
||
Set<String> visitedNames = new HashSet<>(); | ||
|
||
@Override | ||
public void accept(String name, InterfaceInfo info){ | ||
if(!visitedNames.add(info.name)) return; | ||
allSubTypes.add(info); | ||
info.subtypes.forEach(this); | ||
} | ||
}; | ||
visitor.accept(interfaceInfo.name, interfaceInfo); | ||
return allSubTypes; | ||
} | ||
|
||
public static ClassInfo classInfo(JavacNode typeNode){ | ||
return classInfo(Util.canonicalFullname(typeNode)); | ||
} | ||
|
||
public static ClassInfo classInfoOrThrown(JavacNode typeNode){ | ||
String mirrorName = Util.canonicalFullname(typeNode); | ||
ClassInfo classInfo = classInfo(mirrorName); | ||
if(classInfo == null) throw new RuntimeException("Cannot find info for class " + mirrorName); | ||
return classInfo; | ||
} | ||
|
||
public static InterfaceInfo interfaceInfo(JavacNode typeNode){ | ||
return interfaceInfo(Util.canonicalFullname(typeNode)); | ||
} | ||
|
||
public static InterfaceInfo interfaceInfoOrThrown(JavacNode typeNode){ | ||
String string = Util.canonicalFullname(typeNode); | ||
InterfaceInfo interfaceInfo = interfaceInfo(string); | ||
if(interfaceInfo == null) throw new RuntimeException("Cannot find info for interface " + string); | ||
return interfaceInfo; | ||
} | ||
} |
Oops, something went wrong.