Class BootstrapArchiveWriter

java.lang.Object
org.ek9lang.compiler.BootstrapArchiveWriter

public final class BootstrapArchiveWriter extends Object
Writes the BootstrapArchive into a classes directory - run by compiler-main's build at process-classes (an instance main, launched by the JDK's own launcher through exec-maven-plugin's exec goal), so the archive is made from exactly the classes that will read it. The bytes are what InitialCompilableProgramSupplier would otherwise make on its first call: LiveBootstrap, serialised.

ALSO writes BuiltinExternInterface.RESOURCE beside the archive: the plain EK9 extern-interface text Ek9BuiltinIntrospectionSupplier introspects, so every jar that ships the archive ships this text too (2026-11-15). This calls Ek9BuiltinIntrospectionSupplier a SECOND time (the first is inside LiveBootstrap, below) - the two texts are kept equal by the extractor's own determinism across calls, not by one value feeding both, and that equality is pinned by BootstrapArchiveTest.theBundledExternInterfaceResourceIsByteForByteWhatWasIntrospected rather than assumed. The fixed BuiltinExternInterface.LOGICAL_SOURCE_NAME the archive's symbols' tokens carry is what this resource's classpath path is named after.

  • Constructor Details

    • BootstrapArchiveWriter

      public BootstrapArchiveWriter()
  • Method Details

    • main

      void main(String[] args) throws IOException
      Write the archive and the bundled extern-interface text under args[0], the classes directory.
      Throws:
      IOException