- All Known Implementing Classes:
DelegateCompilerAdvisor,DiskCompilerAdvisor,InMemoryCompilerAdvisor
public interface CompilerAdvisor
Advises the compiler to be incremental, helps in-memory analysis,
and behaves as the bridge between the library compiler and its caller.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearLibraryOutput(@NotNull LibraryOwner owner) voidclearModuleOutput(@NotNull LibrarySource source) default @NotNull org.aya.concrete.GenericAyaParsercreateParser(@NotNull org.aya.util.reporter.Reporter reporter) Used for injecting parser from IJ plugin to support on-the-fly analysis.@Nullable org.aya.resolve.ResolveInfodoLoadCompiledCore(org.aya.core.serde.SerTerm.DeState deState, @NotNull org.aya.util.reporter.Reporter reporter, @NotNull kala.collection.immutable.ImmutableSeq<String> mod, @Nullable Path sourcePath, @Nullable Path corePath, @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) Try to load the compiled core.voiddoSaveCompiledCore(org.aya.core.serde.Serializer.State serState, @NotNull LibrarySource file, @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.core.def.GenericDef> defs) static @NotNull CompilerAdvisorinMemory()booleanisSourceModified(@NotNull LibrarySource source) default @Nullable org.aya.resolve.ResolveInfoloadCompiledCore(org.aya.core.serde.SerTerm.DeState deState, @NotNull org.aya.util.reporter.Reporter reporter, @NotNull kala.collection.immutable.ImmutableSeq<String> mod, @Nullable Path sourcePath, @Nullable Path corePath, @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) default voidnotifyIncrementalJob(@NotNull kala.collection.immutable.ImmutableSeq<LibrarySource> modified, @NotNull kala.collection.immutable.ImmutableSeq<kala.collection.immutable.ImmutableSeq<LibrarySource>> affected) Called when all modified sources are detectedstatic @NotNull CompilerAdvisoronDisk()voidprepareLibraryOutput(@NotNull LibraryOwner owner) default voidsaveCompiledCore(org.aya.core.serde.Serializer.State serState, @NotNull LibrarySource file, @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.core.def.GenericDef> defs) voidupdateLastModified(@NotNull LibrarySource source)
-
Method Details
-
onDisk
-
inMemory
-
isSourceModified
-
updateLastModified
-
prepareLibraryOutput
- Throws:
IOException
-
clearLibraryOutput
- Throws:
IOException
-
clearModuleOutput
- Throws:
IOException
-
createParser
@NotNull default @NotNull org.aya.concrete.GenericAyaParser createParser(@NotNull @NotNull org.aya.util.reporter.Reporter reporter) Used for injecting parser from IJ plugin to support on-the-fly analysis. -
notifyIncrementalJob
default void notifyIncrementalJob(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<LibrarySource> modified, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<kala.collection.immutable.ImmutableSeq<LibrarySource>> affected) Called when all modified sources are detected- Parameters:
modified- User directly modified source files.affected- SCC of modified sources.- API Note:
- the SCC is ordered, but DO NOT RELY on it.
-
doLoadCompiledCore
@Nullable @Nullable org.aya.resolve.ResolveInfo doLoadCompiledCore(@NotNull org.aya.core.serde.SerTerm.DeState deState, @NotNull @NotNull org.aya.util.reporter.Reporter reporter, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<String> mod, @Nullable @Nullable Path sourcePath, @Nullable @Nullable Path corePath, @NotNull @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) throws IOException, ClassNotFoundException Try to load the compiled core. ForDiskCompilerAdvisor, returns null if the core path does not exist or either source or core path is null. ForInMemoryCompilerAdvisor, returns null if the mod does not store in memory.- Throws:
IOExceptionClassNotFoundException
-
doSaveCompiledCore
void doSaveCompiledCore(@NotNull org.aya.core.serde.Serializer.State serState, @NotNull @NotNull LibrarySource file, @NotNull @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.core.def.GenericDef> defs) throws IOException - Throws:
IOException
-
loadCompiledCore
@NonExtendable @Nullable default @Nullable org.aya.resolve.ResolveInfo loadCompiledCore(@NotNull org.aya.core.serde.SerTerm.DeState deState, @NotNull @NotNull org.aya.util.reporter.Reporter reporter, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<String> mod, @Nullable @Nullable Path sourcePath, @Nullable @Nullable Path corePath, @NotNull @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) -
saveCompiledCore
@NonExtendable default void saveCompiledCore(@NotNull org.aya.core.serde.Serializer.State serState, @NotNull @NotNull LibrarySource file, @NotNull @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.core.def.GenericDef> defs)
-