Class RuntimeClassExtractor
java.lang.Object
org.ek9lang.core.RuntimeClassExtractor
Extracts EK9 runtime classes (org.ek9.lang and ek9 packages) from the running JVM
and packages them into a versioned JAR file with SHA-256 checksum.
This enables per-project, versioned runtime caching: - First build: Extract ~125-130 classes from compiler JVM → create JAR + checksum - Subsequent builds: Reuse cached JAR if checksum valid - Multiple compiler versions: Each gets its own versioned JAR
Pattern follows Packager and FileHandling in core module. Uses Reflections library (same as ClassLister in java-introspection).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractRuntimeJar
(FileHandling fileHandling, String projectDir, String version) Extract EK9 runtime classes into a versioned JAR file.
-
Constructor Details
-
RuntimeClassExtractor
public RuntimeClassExtractor()
-
-
Method Details
-
extractRuntimeJar
public Optional<File> extractRuntimeJar(FileHandling fileHandling, String projectDir, String version) Extract EK9 runtime classes into a versioned JAR file. Creates JAR at:<projectDir>/.ek9/runtime/ek9-runtime-<version>.jar
Also creates corresponding .sha256 checksum file.- Parameters:
fileHandling
- FileHandling instance for JAR creation and checksumsprojectDir
- Project directory (source file directory)version
- Compiler version (e.g., "0.0.1-0")- Returns:
- Optional containing the runtime JAR file if successful
-