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 EK9 runtime + dependency classes from compiler JVM → create JAR + checksum - Subsequent builds: Reuse cached JAR if checksum valid - Multiple compiler versions: Each gets its own versioned JAR
Extracts all EK9 runtime classes plus third-party dependencies (Jackson, JSONPath, SLF4J) including inner and anonymous classes required for runtime functionality. Uses direct JAR scanning with standard Java APIs (JarFile, ClassLoader).
-
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>.jarAlso 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
-